mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Better document the forwarded output flow
This commit is contained in:
@@ -352,19 +352,24 @@ impl<D: Db, S: ScannerFeed, Sch: Scheduler<S>> ContinuallyRan for EventualityTas
|
||||
non_external_outputs.iter().filter(|output| output.kind() == OutputType::Forwarded)
|
||||
{
|
||||
let Some(eventuality) = completed_eventualities.get(&output.transaction_id()) else {
|
||||
// Output sent to the forwarding address yet not actually forwarded
|
||||
// Output sent to the forwarding address yet not one we made
|
||||
continue;
|
||||
};
|
||||
let Some(forwarded) = eventuality.forwarded_output() else {
|
||||
// This was a TX made by us, yet someone burned to the forwarding address
|
||||
let Some(forwarded) = eventuality.singular_spent_output() else {
|
||||
// This was a TX made by us, yet someone burned to the forwarding address as it doesn't
|
||||
// follow the structure of forwarding transactions
|
||||
continue;
|
||||
};
|
||||
|
||||
let (return_address, in_instruction) =
|
||||
let Some((return_address, in_instruction)) =
|
||||
ScannerGlobalDb::<S>::return_address_and_in_instruction_for_forwarded_output(
|
||||
&txn, &forwarded,
|
||||
)
|
||||
.expect("forwarded an output yet didn't save its InInstruction to the DB");
|
||||
else {
|
||||
// This was a TX made by us, coincidentally with the necessary structure, yet wasn't
|
||||
// forwarding an output
|
||||
continue;
|
||||
};
|
||||
queue_output_until_block::<S>(
|
||||
&mut txn,
|
||||
b + S::WINDOW_LENGTH,
|
||||
|
||||
@@ -216,14 +216,24 @@ pub struct SchedulerUpdate<S: ScannerFeed> {
|
||||
|
||||
impl<S: ScannerFeed> SchedulerUpdate<S> {
|
||||
/// The outputs to accumulate.
|
||||
///
|
||||
/// These MUST be accumulated.
|
||||
pub fn outputs(&self) -> &[OutputFor<S>] {
|
||||
&self.outputs
|
||||
}
|
||||
|
||||
/// The outputs to forward to the latest multisig.
|
||||
///
|
||||
/// These MUST be forwarded in a 1-input 1-output transaction or dropped (if the fees are too
|
||||
/// high to make the forwarding transaction).
|
||||
pub fn forwards(&self) -> &[OutputFor<S>] {
|
||||
&self.forwards
|
||||
}
|
||||
|
||||
/// The outputs to return.
|
||||
///
|
||||
/// These SHOULD be returned as specified (potentially in batch). They MAY be dropped if the fees
|
||||
/// are too high to make the return transaction.
|
||||
pub fn returns(&self) -> &[Return<S>] {
|
||||
&self.returns
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user