mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user