-
Notifications
You must be signed in to change notification settings - Fork 38.8k
[0.21] wallet: Avoid requesting fee rates multiple times during coin selection #21520
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
Conversation
During each loop of CreateTransaction, instead of constantly getting a new feerate, use the feerate that we have already fetched for all fee calculations. Thix fixes a race condition where the feerate required changes during each iteration of the loop. This commit changes behavior as the "Fee estimation failed" error will now take priority over "Signing transaction failed". Github-Pull: bitcoin#21083 Rebased-From: 1a6a0b0
Make sure that all fee calculations use the same feerate. coin_selection_params.effective_fee is the variable we use for all fee calculations, so get rid of remaining nFeeRateNeeded usages and just directly set coin_selection_params.effective_fee. Does not change behavior. Github-Pull: bitcoin#21083 Rebased-From: e2f429e
Instead of setting the long term feerate for each SelectCoinsMinConf iteration, set it once during CreateTransaction and let it be shared with each SelectCoinsMinConf through coin_selection_params.m_long_term_feerate. Does not change behavior. Github-Pull: bitcoin#21083 Rebased-From: 448d04b
Instead of fetching the discard feerate for each SelectCoinsMinConf iteration, fetch and cache it once during CreateTransaction so that it is shared for each SelectCoinsMinConf through coin_selection_params.m_discard_feerate. Does not change behavior. Github-Pull: bitcoin#21083 Rebased-From: bdd0c29
maflcko
left a comment
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.
cherry-pick-only ACK 4b7d19d 🐒
Show signature and timestamp
Signature:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
cherry-pick-only ACK 4b7d19d456a3a1e54bc6f24d4b4e7e8f417896df 🐒
-----BEGIN PGP SIGNATURE-----
iQGzBAEBCgAdFiEE+rVPoUahrI9sLGYTzit1aX5ppUgFAlwqrYAACgkQzit1aX5p
pUil9wwAvjp9CweUIZcOEI6yjlm/XfbmPfpsNi20feQmD0jg/crBv4zwIRzdAY4L
zuzIhrJ9eG4ylMzQviuAtTS2UBx7BhQCBrMY3ZCNqZSS9m49zT/uhXdlXYXVacIG
prL/i1oL5J77jgxCrt3+zVC6XfO1BHXk8GgA2vWnIpI2MbNC3xS6ulZ2mbTosjsy
QlMv/0+H1qWLmK8Ce6t2S4EszyMHpsiatmIgJsLboIM1NpnwLPoXP7PFbJWW8wEx
eGe7yKd1UldUe6ryu9DOdcWsWNyZzHu9RHVlu5Q9UqUGF0CoXrdLQbC+kX1KcSE6
T0wMNdCN1udoDT3+uUxAtZJsBFbLKqQwhtZBvfHueZrVgAP5fIb9rABMvlBR2jOF
KGw287OdGzh46r/A+GC4sfZRRtol0gR9vr6TlfwU3m+tWO7LfO2YvdjQO6oX5YJS
9m1o4i/f8PEcae1L3SSTiGpZ92mcvNolk3Q+Yr9JfEvaGTmH5m4Rj00zJ7lG4pNG
GpufZO4/
=kp7c
-----END PGP SIGNATURE-----
Timestamp of file with hash 03e63e4b18da74fc9ba5be4a98a589d33a69777e74b0004659c5bb473a8cb037 -
It's a feerate, not a fee. Also follow the style guide for member names. Github-Pull: bitcoin#21083 Rebased-From: f9cd2bf
4b7d19d to
d61fb07
Compare
|
cherry-pick-only re-ACK d61fb07 🔙 Show signature and timestampSignature: Timestamp of file with hash |
|
utACK d61fb07 |
|
Code review ACK d61fb07 |
Backport of #21083