Skip to content

Commit caa2c45

Browse files
committed
Fix conflicting duplicates
1 parent 83b515a commit caa2c45

File tree

1 file changed

+11
-3
lines changed
  • wallet/src/account/output_cache

1 file changed

+11
-3
lines changed

wallet/src/account/output_cache/mod.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -782,9 +782,17 @@ impl OutputCache {
782782
);
783783
Ok(())
784784
}
785-
TxState::Abandoned
786-
| TxState::Confirmed(..)
787-
| TxState::Conflicted(..) => {
785+
TxState::Conflicted(..) => {
786+
// It's possible to try to mark descendant as conflicting twice
787+
// 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(..) => {
788796
Err(WalletError::CannotMarkTxAsConflictedIfInState(*tx.state()))
789797
}
790798
},

0 commit comments

Comments
 (0)