Skip to content

Commit

Permalink
Fix conflicting duplicates
Browse files Browse the repository at this point in the history
  • Loading branch information
azarovh committed Mar 5, 2025
1 parent aa3e06a commit f87218f
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions wallet/src/account/output_cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,17 @@ impl OutputCache {
);
Ok(())
}
TxState::Abandoned
| TxState::Confirmed(..)
| TxState::Conflicted(..) => {
TxState::Conflicted(..) => {
// It's possible to try to mark descendant as conflicting twice
// because unconfirmed_descendants contains a tx as child and as parent.
// So it's not an error only if done during this function call.
ensure!(
conflicting_txs_with_descendants.contains(&tx_id),
WalletError::CannotMarkTxAsConflictedIfInState(*tx.state())
);
Ok(())
}
TxState::Abandoned | TxState::Confirmed(..) => {
Err(WalletError::CannotMarkTxAsConflictedIfInState(*tx.state()))
}
},
Expand Down

0 comments on commit f87218f

Please sign in to comment.