Finish routing output flushing

Completes the transaction-chaining scheduler.
This commit is contained in:
Luke Parker
2024-09-04 02:06:21 -04:00
parent 653ead1e8c
commit 0c1aec29bb
3 changed files with 73 additions and 13 deletions

View File

@@ -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

View File

@@ -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.
///