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

Better sats/vb conversion #86

Conversation

benthecarman
Copy link
Contributor

Use min of 1 because of policy not relaying transactions under this limit

253 => 1.0,
_ => fee_sats_per_1000_wu as f32 / 250.0,
} as f32;
let sat_per_vb = std::cmp::min(1.0, fee_sats_per_1000_wu as f32 / 250.0);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still not entirely sure this is right either. I'm pretty sure 253 "fee_sats_per_1000_wu" is supposed to be 1.0 sat_per_vb. If you always just divide by 250.0 you get 1.012. Which I guess probably gets rounded to 1 or I guess even if not it means you'd pay an extra sat for every 100 vbytes? Not really a big deal.

Matt ended up opening this issue in bdk bitcoindevkit/bdk#608

I'm still not entirely sure the best way to do this for now but maybe your simplification is fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

@johncantrell97 @benthecarman given that the minimum fee in sats_per_kwu is 253. Will std::cmp::min(1.0, fee_sats_per_1000_wu as f32 / 250.0) not always produce a fee rate of 1.0. Is there something am missing here?

@benthecarman benthecarman deleted the better-sat-per-vb-conversion branch August 1, 2022 21:59
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.

3 participants