@@ -150,6 +150,9 @@ pub enum PsbtCmd<S: clap::Args> {
150150 value : u64 ,
151151 /// Recipient address
152152 address : Address < NetworkUnchecked > ,
153+ /// Set the feerate of the tx (sat/vbyte)
154+ #[ clap( long, short, default_value = "1.0" ) ]
155+ feerate : Option < f32 > ,
153156 /// Set max absolute timelock (from consensus value)
154157 #[ clap( long, short) ]
155158 after : Option < u32 > ,
@@ -260,6 +263,7 @@ pub fn create_tx<O: ChainOracle>(
260263 cs_algorithm : CoinSelectionAlgo ,
261264 address : Address ,
262265 value : u64 ,
266+ feerate : f32 ,
263267) -> anyhow:: Result < ( Psbt , Option < ChangeInfo > ) >
264268where
265269 O :: Error : std:: error:: Error + Send + Sync + ' static ,
@@ -332,7 +336,10 @@ where
332336 . iter ( )
333337 . map ( |output| ( output. weight ( ) . to_wu ( ) as u32 , output. value . to_sat ( ) ) ) ,
334338 ) ,
335- fee : TargetFee :: default ( ) ,
339+ fee : TargetFee {
340+ rate : FeeRate :: from_sat_per_vb ( feerate) ,
341+ ..Default :: default ( )
342+ } ,
336343 } ;
337344
338345 let change_policy = ChangePolicy {
@@ -584,6 +591,7 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
584591 PsbtCmd :: New {
585592 value,
586593 address,
594+ feerate,
587595 after,
588596 older,
589597 coin_select,
@@ -611,7 +619,15 @@ pub fn handle_commands<CS: clap::Subcommand, S: clap::Args>(
611619 assets = assets. older ( relative:: LockTime :: from_consensus ( n) ?) ;
612620 }
613621
614- create_tx ( & mut graph, & * chain, & assets, coin_select, address, value) ?
622+ create_tx (
623+ & mut graph,
624+ & * chain,
625+ & assets,
626+ coin_select,
627+ address,
628+ value,
629+ feerate. expect ( "must have feerate" ) ,
630+ ) ?
615631 } ;
616632
617633 if let Some ( ChangeInfo {
0 commit comments