File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -238,7 +238,20 @@ impl BroadcasterInterface for BitcoindClient {
238238 let tx_serialized = serde_json:: json!( encode:: serialize_hex( tx) ) ;
239239 tokio:: spawn ( async move {
240240 let mut rpc = bitcoind_rpc_client. lock ( ) . await ;
241- rpc. call_method :: < RawTx > ( "sendrawtransaction" , & vec ! [ tx_serialized] ) . await . unwrap ( ) ;
241+ // This may error due to RL calling `broadcast_transaction` with the same transaction
242+ // multiple times, but the error is safe to ignore.
243+ match rpc. call_method :: < RawTx > ( "sendrawtransaction" , & vec ! [ tx_serialized] ) . await {
244+ Ok ( _) => { }
245+ Err ( e) => {
246+ let err_str = e. get_ref ( ) . unwrap ( ) . to_string ( ) ;
247+ if !err_str. contains ( "Transaction already in block chain" )
248+ && !err_str. contains ( "Missing inputs" )
249+ && !err_str. contains ( "non-BIP68-final" )
250+ {
251+ panic ! ( "{}" , e) ;
252+ }
253+ }
254+ }
242255 } ) ;
243256 }
244257}
You can’t perform that action at this time.
0 commit comments