We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 83b515a commit caa2c45Copy full SHA for caa2c45
wallet/src/account/output_cache/mod.rs
@@ -782,9 +782,17 @@ impl OutputCache {
782
);
783
Ok(())
784
}
785
- TxState::Abandoned
786
- | TxState::Confirmed(..)
787
- | 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.
788
+ // So it's not an error only if done during this function call.
789
+ ensure!(
790
+ conflicting_txs_with_descendants.contains(&tx_id),
791
+ WalletError::CannotMarkTxAsConflictedIfInState(*tx.state())
792
+ );
793
+ Ok(())
794
+ }
795
+ TxState::Abandoned | TxState::Confirmed(..) => {
796
Err(WalletError::CannotMarkTxAsConflictedIfInState(*tx.state()))
797
798
},
0 commit comments