-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add fee_rate
argument to payjoin-cli
#109
Conversation
fee_rate
argument to payjoin-cli
fee_rate
argument to payjoin-cli
f202190
to
b4f4714
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the right idea
payjoin-cli/src/main.rs
Outdated
let fee_rate_sat_per_vb = sub_matches.get_one::<f32>("fee_rate").unwrap_or(&2.1); | ||
let fee_rate_sat_per_kwu = fee_rate_sat_per_vb * 250.0_f32; | ||
let fee_rate: bitcoin::FeeRate = | ||
bitcoin::FeeRate::from_sat_per_kwu(fee_rate_sat_per_kwu.ceil() as u64); | ||
app.send_payjoin(bip21, fee_rate)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the BIP21 Uri is parsed from String inside send_payjoin, I think it would be good form to do the same parsing FeeRate from f32 with this feerate parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved to send_payjoin
and added log in the cli to indicate we are using default fee_rate
in case its not provided
bee886a
to
95ab22b
Compare
fee_rate
argument to payjoin-cli
fee_rate
argument to payjoin-cli
payjoin-cli/src/main.rs
Outdated
let fee_rate_sat_per_vb = match sub_matches.get_one::<f32>("fee_rate") { | ||
Some(fee_rate) => fee_rate, | ||
None => { | ||
log::info!("No fee rate specified, using default of 2.1 sat/vB"); | ||
&2.1 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2.1 sats/vB is a pretty weird default. It begets a setting for either core fallback fee config, non-optional fee_rate param, bitcoin core estimatesmartfee, etc.
I think this should turn into an issue to solve for before we publish a binary of this tool.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to required for now - should I open an issue to get minimum fee rate accepted in mempool?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good. yes.
95ab22b
to
04e98fc
Compare
04e98fc
to
0c553b0
Compare
- Add `fee_rate` to `send_payjoin` - make `fee_rate` required
0c553b0
to
048ec97
Compare
formatted and rebased on the new RequestBuilder pattern change |
i smoke tested on my machine before merge |
resolves #100