mirror of
https://github.com/serai-dex/serai.git
synced 2025-04-13 09:41:57 +00:00
Update scan.rs
This commit is contained in:
parent
259e5815c8
commit
4871fc7441
1 changed files with 4 additions and 2 deletions
|
@ -373,7 +373,7 @@ impl Scanner {
|
|||
};
|
||||
|
||||
let mut res = vec![];
|
||||
for tx in txs {
|
||||
for (i, tx) in txs.drain(..).enumerate() {
|
||||
if let Some(timelock) = map(self.scan_transaction(&tx), index) {
|
||||
res.push(timelock);
|
||||
}
|
||||
|
@ -381,7 +381,9 @@ impl Scanner {
|
|||
.prefix
|
||||
.outputs
|
||||
.iter()
|
||||
.filter_map(|output| Some(1).filter(|_| output.amount == 0))
|
||||
// Filter to miner TX outputs/0-amount outputs since we're tacking the 0-amount index
|
||||
.filter_map(|output| Some(1).filter(|_| (i == 0) || (output.amount == 0)))
|
||||
// Since we can't get the length of an iterator, map each value to 1 and sum
|
||||
.sum::<u64>();
|
||||
}
|
||||
Ok(res)
|
||||
|
|
Loading…
Reference in a new issue