mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-23 03:59:22 +00:00
Correct global index offsetting
Technically, non-0-amount outputs can still appear and this considered them as part of the global 0-amount pool. Now, only outputs which are 0-amount are counted.
This commit is contained in:
parent
d5a5704ba4
commit
259e5815c8
1 changed files with 6 additions and 1 deletions
|
@ -377,7 +377,12 @@ impl Scanner {
|
|||
if let Some(timelock) = map(self.scan_transaction(&tx), index) {
|
||||
res.push(timelock);
|
||||
}
|
||||
index += u64::try_from(tx.prefix.outputs.len()).unwrap();
|
||||
index += tx
|
||||
.prefix
|
||||
.outputs
|
||||
.iter()
|
||||
.filter_map(|output| Some(1).filter(|_| output.amount == 0))
|
||||
.sum::<u64>();
|
||||
}
|
||||
Ok(res)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue