@@ -789,22 +789,22 @@ impl<A: Anchor> TxGraph<A> {
789789 if conflicting_tx. last_seen_unconfirmed > tx_last_seen {
790790 return Ok ( None ) ;
791791 }
792- }
793- if conflicting_tx. last_seen_unconfirmed == * last_seen {
794- // Check if conflicting tx has higher absolute fee and fee rate
795- if let ( Ok ( fee) , Ok ( conflicting_fee) ) =
796- ( self . calculate_fee ( tx) , self . calculate_fee ( & conflicting_tx) )
797- {
798- let fee_rate = fee as f32 / tx. weight ( ) . to_vbytes_ceil ( ) as f32 ;
799- let conflicting_fee_rate =
800- conflicting_fee as f32 / conflicting_tx. weight ( ) . to_vbytes_ceil ( ) as f32 ;
801- if conflicting_fee > fee && conflicting_fee_rate > fee_rate {
792+ if conflicting_tx. last_seen_unconfirmed == * last_seen {
793+ // Check if conflicting tx has higher absolute fee and fee rate
794+ if let ( Ok ( fee) , Ok ( conflicting_fee) ) =
795+ ( self . calculate_fee ( tx) , self . calculate_fee ( & conflicting_tx) )
796+ {
797+ let fee_rate = fee as f32 / tx. weight ( ) . to_vbytes_ceil ( ) as f32 ;
798+ let conflicting_fee_rate = conflicting_fee as f32
799+ / conflicting_tx. weight ( ) . to_vbytes_ceil ( ) as f32 ;
800+ if conflicting_fee > fee && conflicting_fee_rate > fee_rate {
801+ return Ok ( None ) ;
802+ }
803+ } else if conflicting_tx. txid ( ) > tx. txid ( ) {
804+ // If fee rates cannot be distinguished, then conflicting tx has priority if
805+ // txid of conflicting tx > txid of original tx
802806 return Ok ( None ) ;
803807 }
804- } else if conflicting_tx. txid ( ) > tx. txid ( ) {
805- // If fee rates cannot be distinguished, then conflicting tx has priority if
806- // txid of conflicting tx > txid of original tx
807- return Ok ( None ) ;
808808 }
809809 }
810810 }
0 commit comments