[0.21] wallet: Avoid requesting fee rates multiple times during coin selection#21520
Merged
fanquake merged 5 commits intobitcoin:0.21from Apr 16, 2021
Merged
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
reviewed
Apr 1, 2021
Member
maflcko
left a comment
There was a problem hiding this comment.
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
Member
|
cherry-pick-only re-ACK d61fb07 🔙 Show signature and timestampSignature: Timestamp of file with hash |
Member
|
utACK d61fb07 |
Contributor
|
Code review ACK d61fb07 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #21083