mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Don't scan outputs which are dust, track dust change as operating costs
Fixes #299.
This commit is contained in:
@@ -745,9 +745,8 @@ impl<D: Db, N: Network> MultisigManager<D, N> {
|
||||
res.push((key, id, tx, eventuality));
|
||||
}
|
||||
|
||||
// TODO: If the TX is None, restore its inputs to the scheduler
|
||||
// Otherwise, if the TX had a change output, dropping its inputs would burn funds
|
||||
// Are there exceptional cases upon rotation?
|
||||
// TODO: If the TX is None, restore its inputs to the scheduler for efficiency's sake
|
||||
// If this TODO is removed, also reduce the operating costs
|
||||
}
|
||||
res
|
||||
};
|
||||
|
||||
@@ -553,7 +553,9 @@ impl<N: Network, D: Db> Scanner<N, D> {
|
||||
// TODO: These lines are the ones which will cause a really long-lived lock acquisiton
|
||||
for output in network.get_outputs(&block, key).await {
|
||||
assert_eq!(output.key(), key);
|
||||
outputs.push(output);
|
||||
if output.amount() >= N::DUST {
|
||||
outputs.push(output);
|
||||
}
|
||||
}
|
||||
|
||||
for (id, (block_number, tx)) in network
|
||||
|
||||
@@ -435,6 +435,7 @@ impl<N: Network> Scheduler<N> {
|
||||
let mut remainder = diff - (per_payment * payments_len);
|
||||
|
||||
for payment in payments.iter_mut() {
|
||||
// TODO: This usage of saturating_sub is invalid as we *need* to subtract this value
|
||||
payment.amount = payment.amount.saturating_sub(per_payment + remainder);
|
||||
// Only subtract the remainder once
|
||||
remainder = 0;
|
||||
|
||||
Reference in New Issue
Block a user