File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -694,6 +694,26 @@ where
694694 )
695695 . wrap_err ( "Failed to verify signature received from user for payout txin. Ensure the signature uses SinglePlusAnyoneCanPay sighash type." ) ?;
696696
697+ let fee_rate_result = self
698+ . rpc
699+ . get_fee_rate (
700+ self . config . protocol_paramset . network ,
701+ & self . config . mempool_api_host ,
702+ & self . config . mempool_api_endpoint ,
703+ self . config . tx_sender_limits . mempool_fee_rate_multiplier ,
704+ self . config . tx_sender_limits . mempool_fee_rate_offset_sat_kvb ,
705+ self . config . tx_sender_limits . fee_rate_hard_cap ,
706+ )
707+ . await ;
708+
709+ let fee_rate_option = match fee_rate_result {
710+ Ok ( fee_rate) => Some ( Amount :: from_sat ( fee_rate. to_sat_per_vb_ceil ( ) * 1000 ) ) ,
711+ Err ( e) => {
712+ tracing:: warn!( "Failed to get fee rate from mempool API; funding tx with automatic fee rate. Error: {e:?}" ) ;
713+ None
714+ }
715+ } ;
716+
697717 // send payout tx using RBF
698718 let funded_tx = self
699719 . rpc
@@ -706,7 +726,7 @@ where
706726 change_type : None ,
707727 include_watching : None ,
708728 lock_unspents : Some ( false ) ,
709- fee_rate : None ,
729+ fee_rate : fee_rate_option ,
710730 subtract_fee_from_outputs : None ,
711731 replaceable : None ,
712732 conf_target : None ,
You can’t perform that action at this time.
0 commit comments