chain(fix): conflict resolution for txs with same last_seen

The tx conflict `Scenario` test for unconfirmed txs with the same
last_seen has been amended for its corresponding conflict
resolution bug fix.
This commit is contained in:
Wei Chen
2023-09-01 17:58:47 +08:00
parent 2f2f138595
commit afbf83c8b0
2 changed files with 11 additions and 7 deletions

View File

@@ -789,6 +789,12 @@ impl<A: Anchor> TxGraph<A> {
if conflicting_tx.last_seen_unconfirmed > tx_last_seen {
return Ok(None);
}
if conflicting_tx.last_seen_unconfirmed == *last_seen
&& conflicting_tx.txid() > tx.txid()
{
// Conflicting tx has priority if txid of conflicting tx > txid of original tx
return Ok(None);
}
}
}