iuna

iuna

iuna - experimental mainnet-candidate protocol
git clone https://getiuna.org/git/iuna.git
Log | Files | Refs | README | LICENSE

commit edbd2594b380fb49c76e8d64d63d9daf440e7a45
parent 46bd7da82ad2a1e81b97359653dc55d75847f261
Author: Joris Hartog <jorishartog@hotmail.com>
Date:   Thu,  3 Sep 2026 20:34:09 +0200

Fix orphaned finalizer burn recovery

Diffstat:
Msrc/app/automatic_mining.rs | 14+++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/app/automatic_mining.rs b/src/app/automatic_mining.rs @@ -592,11 +592,15 @@ impl NodeCore { let Some((height, burn)) = &self.local_block_anchor_burn else { return (ledger, None); }; - if *height == ledger.height() && !ledger.has_transaction(burn.signature()) { - // `submit_transaction` returns `Ok(false)` when another pending - // transaction already spends the anchor input. Prefer an existing - // pending burn from this wallet. Otherwise rebuild this cloned - // block-building mempool with the liveness anchor first. + let anchor_is_pending = ledger + .pending() + .iter() + .any(|transaction| transaction.signature() == burn.signature()); + if *height == ledger.height() && !anchor_is_pending { + // `has_transaction` also includes orphans, which cannot anchor a + // block. Try to promote the local burn, prefer another eligible + // wallet burn, or rebuild this cloned mempool with the liveness + // anchor first when a pending transaction spends the same input. if ledger.submit_transaction(burn.clone()).unwrap_or(false) { return (ledger, Some(burn.signature().to_string())); }