mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Finish routing output flushing
Completes the transaction-chaining scheduler.
This commit is contained in:
@@ -455,7 +455,9 @@ impl<D: Db, S: ScannerFeed, Sch: Scheduler<S>> ContinuallyRan for EventualityTas
|
||||
key.key != keys.last().unwrap().key,
|
||||
"key which was forwarding was the last key (which has no key after it to forward to)"
|
||||
);
|
||||
Sch::flush_key(&mut txn, &block, key.key, keys.last().unwrap().key);
|
||||
let new_eventualities =
|
||||
Sch::flush_key(&mut txn, &block, key.key, keys.last().unwrap().key);
|
||||
intake_eventualities::<S>(&mut txn, new_eventualities);
|
||||
}
|
||||
|
||||
// Now that we've intaked any Eventualities caused, check if we're retiring any keys
|
||||
|
||||
@@ -259,13 +259,12 @@ pub trait Scheduler<S: ScannerFeed>: 'static + Send {
|
||||
///
|
||||
/// If the retiring key has any unfulfilled payments associated with it, those MUST be made
|
||||
/// the responsibility of the new key.
|
||||
// TODO: This needs to return a HashMap for the eventualities
|
||||
fn flush_key(
|
||||
txn: &mut impl DbTxn,
|
||||
block: &BlockFor<S>,
|
||||
retiring_key: KeyFor<S>,
|
||||
new_key: KeyFor<S>,
|
||||
);
|
||||
) -> HashMap<Vec<u8>, Vec<EventualityFor<S>>>;
|
||||
|
||||
/// Retire a key as it'll no longer be used.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user