File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ const PUBSIGNALS_SECRET_HASH_INDEX: usize = 8;
5151
5252/// Number of the BDK wallet's sync tries to find the taproot atomic-swap transaction on-chain that
5353/// has been published by a counterparty.
54- const MAX_NUMBER_OF_ATTEMPTS_TO_SYNC : usize = 150 ;
54+ const MAX_NUMBER_OF_ATTEMPTS_TO_SYNC : usize = 300 ;
5555
5656/// Delay between attempts to sync the BDK wallet to find the taproot atomic-swap transaction.
5757const DELAY_BETWEEN_SYNC_ATTEMPT_SEC : u64 = 5 ;
@@ -499,7 +499,13 @@ impl SwapParticipant {
499499 self . bitcoin_wallet . network ( ) ,
500500 ) ?;
501501
502+ let feerate = self
503+ . bitcoin_client
504+ . estimate_fee ( 2 )
505+ . wrap_err ( "failed to estimate fee" ) ?;
506+
502507 builder
508+ . fee_rate ( feerate)
503509 . drain_wallet ( )
504510 . drain_to ( recepient_address. script_pubkey ( ) )
505511 . policy_path ( path, KeychainKind :: External ) ;
@@ -589,7 +595,15 @@ impl SwapParticipant {
589595
590596 let ( mut psbt, _details) = {
591597 let mut tx_builder = self . bitcoin_wallet . build_tx ( ) ;
592- tx_builder. add_recipient ( address. script_pubkey ( ) , sats_amount) ;
598+
599+ let feerate = self
600+ . bitcoin_client
601+ . estimate_fee ( 2 )
602+ . wrap_err ( "failed to estimate fee" ) ?;
603+
604+ tx_builder
605+ . fee_rate ( feerate)
606+ . add_recipient ( address. script_pubkey ( ) , sats_amount) ;
593607 tx_builder. finish ( ) ?
594608 } ;
595609
You can’t perform that action at this time.
0 commit comments