We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa3e06a commit f87218fCopy full SHA for f87218f
wallet/src/account/output_cache/mod.rs
@@ -834,9 +834,17 @@ impl OutputCache {
834
);
835
Ok(())
836
}
837
- TxState::Abandoned
838
- | TxState::Confirmed(..)
839
- | 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.
840
+ // So it's not an error only if done during this function call.
841
+ ensure!(
842
+ conflicting_txs_with_descendants.contains(&tx_id),
843
+ WalletError::CannotMarkTxAsConflictedIfInState(*tx.state())
844
+ );
845
+ Ok(())
846
+ }
847
+ TxState::Abandoned | TxState::Confirmed(..) => {
848
Err(WalletError::CannotMarkTxAsConflictedIfInState(*tx.state()))
849
850
},
0 commit comments