mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 20:59:23 +00:00
Pass the latest active key to the Block's scan function
Effectively necessary for networks on which we utilize account abstraction in order to know what key to associate the received coins with.
This commit is contained in:
@@ -273,6 +273,18 @@ impl<D: Db, S: ScannerFeed, Sch: Scheduler<S>> ContinuallyRan for EventualityTas
|
||||
log::debug!("checking eventuality completions in block: {} ({b})", hex::encode(block.id()));
|
||||
|
||||
let (keys, keys_with_stages) = self.keys_and_keys_with_stages(b);
|
||||
let latest_active_key = {
|
||||
let mut keys_with_stages = keys_with_stages.clone();
|
||||
loop {
|
||||
// Use the most recent key
|
||||
let (key, stage) = keys_with_stages.pop().unwrap();
|
||||
// Unless this key is active, but not yet reporting
|
||||
if stage == LifetimeStage::ActiveYetNotReporting {
|
||||
continue;
|
||||
}
|
||||
break key;
|
||||
}
|
||||
};
|
||||
|
||||
let mut txn = self.db.txn();
|
||||
|
||||
@@ -307,7 +319,7 @@ impl<D: Db, S: ScannerFeed, Sch: Scheduler<S>> ContinuallyRan for EventualityTas
|
||||
}
|
||||
|
||||
// Fetch all non-External outputs
|
||||
let mut non_external_outputs = block.scan_for_outputs(key.key);
|
||||
let mut non_external_outputs = block.scan_for_outputs(latest_active_key, key.key);
|
||||
non_external_outputs.retain(|output| output.kind() != OutputType::External);
|
||||
// Drop any outputs less than the dust limit
|
||||
non_external_outputs.retain(|output| {
|
||||
|
||||
Reference in New Issue
Block a user