Skip to content

Commit f87218f

Browse files
committed
Fix conflicting duplicates
1 parent aa3e06a commit f87218f

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
@@ -834,9 +834,17 @@ impl OutputCache {
834834
);
835835
Ok(())
836836
}
837-
TxState::Abandoned
838-
| TxState::Confirmed(..)
839-
| TxState::Conflicted(..) => {
837+
TxState::Conflicted(..) => {
838+
// It's possible to try to mark descendant as conflicting twice
839+
// 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(..) => {
840848
Err(WalletError::CannotMarkTxAsConflictedIfInState(*tx.state()))
841849
}
842850
},

0 commit comments

Comments
 (0)