Skip to content
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

Merged
merged 1 commit into from
Oct 22, 2023

Conversation

jbesraa
Copy link
Contributor

@jbesraa jbesraa commented Oct 3, 2023

resolves #100

@jbesraa jbesraa changed the title Add fee_rate argument to payjoin-cli Draft: Add fee_rate argument to payjoin-cli Oct 3, 2023
@jbesraa jbesraa force-pushed the fee-rate-arg-in-cli branch from f202190 to b4f4714 Compare October 3, 2023 19:04
Copy link
Contributor

@DanGould DanGould left a 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

Comment on lines 18 to 22
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)?;
Copy link
Contributor

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

Copy link
Contributor Author

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

@jbesraa jbesraa force-pushed the fee-rate-arg-in-cli branch 2 times, most recently from bee886a to 95ab22b Compare October 19, 2023 13:57
@jbesraa jbesraa changed the title Draft: Add fee_rate argument to payjoin-cli Add fee_rate argument to payjoin-cli Oct 19, 2023
Comment on lines 17 to 22
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
}
Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good. yes.

@jbesraa jbesraa force-pushed the fee-rate-arg-in-cli branch from 95ab22b to 04e98fc Compare October 20, 2023 14:12
@DanGould DanGould force-pushed the fee-rate-arg-in-cli branch from 04e98fc to 0c553b0 Compare October 20, 2023 16:35
    - Add `fee_rate` to `send_payjoin`
    - make `fee_rate` required
@DanGould DanGould force-pushed the fee-rate-arg-in-cli branch from 0c553b0 to 048ec97 Compare October 20, 2023 16:38
@DanGould
Copy link
Contributor

formatted and rebased on the new RequestBuilder pattern change

@DanGould DanGould merged commit d1d1a8a into payjoin:master Oct 22, 2023
7 checks passed
@DanGould
Copy link
Contributor

i smoke tested on my machine before merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configure send FeeRate from payjoin-cli
2 participants