Skip to main content

set_transactions_failed

Function set_transactions_failed 

Source
pub fn set_transactions_failed(
    wallet_transactions: &mut HashMap<TxId, WalletTransaction>,
    failed_txids: Vec<TxId>,
)
Expand description

Sets transactions associated with list of failed_txids in wallet_transactions to Failed status.

Sets the spending_transaction fields of any outputs spent in these transactions to None.

Transactions with Confirmed status are skipped with a warning. A mined transaction cannot fail, since only a reorg can un-mine it, and reorgs are handled by truncation, which reopens the affected scan ranges. For a confirmed transaction the note’s spending_transaction field is the wallet’s only durable record of the on-chain spend (the nullifier-map entry is pruned once the fully scanned height passes the spending block), so resetting it here would create a permanent phantom unspent note that no forward sync can correct.