File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,13 @@ impl BitcoindWallet {
5353 conf_target : None ,
5454 } ;
5555
56+ // Set locktime to current block height for anti-fee-sniping
57+ // This is to follow wallet fingerprinting best practices and set and opinionated
58+ // default for external wallet integrations to follow along with
59+ let locktime = Some ( tokio:: task:: block_in_place ( || {
60+ tokio:: runtime:: Handle :: current ( ) . block_on ( async { self . rpc . get_block_count ( ) . await } )
61+ } ) ? as u32 ) ;
62+
5663 // Sync wrapper around async call - use tokio handle to avoid deadlock
5764 let result = tokio:: task:: block_in_place ( || {
5865 tokio:: runtime:: Handle :: current ( ) . block_on ( async {
@@ -66,7 +73,7 @@ impl BitcoindWallet {
6673 amount : v. to_btc ( ) ,
6774 } )
6875 . collect :: < Vec < _ > > ( ) ,
69- None , // locktime
76+ locktime,
7077 Some ( options) ,
7178 None ,
7279 )
You can’t perform that action at this time.
0 commit comments