From 49fadd1378cbc864bd0800a4078c3c5836984473 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Fri, 1 Sep 2023 17:58:47 +0800 Subject: [PATCH] chain(fix): conflict resolution for txs with same last_seen --- crates/chain/src/tx_graph.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/chain/src/tx_graph.rs b/crates/chain/src/tx_graph.rs index 1f7bcdb122..6fb1ee4fa7 100644 --- a/crates/chain/src/tx_graph.rs +++ b/crates/chain/src/tx_graph.rs @@ -789,6 +789,12 @@ impl TxGraph { 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); + } } }