forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Slightly optimize ApproximateBestSubset and its usage for PS txes #3184
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
Merged
Conversation
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
codablock
reviewed
Nov 4, 2019
codablock
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.
See inline comments.
codablock
approved these changes
Nov 4, 2019
codablock
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.
utACK
codablock
pushed a commit
to codablock/dash
that referenced
this pull request
Nov 19, 2019
…shpay#3184) * From 2 best sets with the same `nTotal` in ApproximateBestSubset prefer the one with less inputs * There is no reason to run ApproximateBestSubset again if nMinChange is 0 * Apply review suggestions
MIPPL
pushed a commit
to biblepay/biblepay
that referenced
this pull request
Nov 24, 2019
* commit '8b14adb206d76fbc6307385999a1c512052e93fa': (21 commits) [v0.14.0.x] Update release notes with change log (dashpay#3213) [v0.14.0.x] Bump version to 0.14.0.4 and draft release notes (dashpay#3203) Circumvent BIP69 sorting in fundrawtransaction.py test (dashpay#3100) Fix compile issues Merge bitcoin#11397: net: Improve and document SOCKS code Slightly optimize ApproximateBestSubset and its usage for PS txes (dashpay#3184) Update activemn if protx info changed (dashpay#3176) Actually update spent index on DisconnectBlock (dashpay#3167) Only track last seen time instead of first and last seen time (dashpay#3165) Merge bitcoin#17118: build: depends macOS: point --sysroot to SDK (dashpay#3161) Simulate BlockConnected/BlockDisconnected for PS caches Few fixes related to SelectCoinsGroupedByAddresses (dashpay#3144) Various fixes for mixing queues (dashpay#3138) Also consider txindex for transactions in AlreadyHave() (dashpay#3126) Ignore recent rejects filter for locked txes (dashpay#3124) Make orphan TX map limiting dependent on total TX size instead of TX count (dashpay#3121) Update/modernize macOS plist (dashpay#3074) Fix bip69 vs change position issue (dashpay#3063) Partially revert 3061 (dashpay#3150) Fix SelectCoinsMinConf to allow instant respends (dashpay#3061) ... # Conflicts: # configure.ac # doc/man/biblepay-cli.1 # doc/man/biblepay-qt.1 # doc/man/biblepay-tx.1 # doc/man/biblepayd.1 # doc/release-notes.md # src/clientversion.h # src/wallet/wallet.cpp
FornaxA
pushed a commit
to ioncoincore/ion
that referenced
this pull request
Dec 3, 2019
…shpay#3184) * From 2 best sets with the same `nTotal` in ApproximateBestSubset prefer the one with less inputs * There is no reason to run ApproximateBestSubset again if nMinChange is 0 * Apply review suggestions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I noticed that
ApproximateBestSubsetpicks quite suboptimal sets of coins sometimes. This isn't a big deal for regular txes with some random amounts but for PS txes this means that instead of picking say 2x0.1 it's quite common to have 1x0.1 and 10x0.01 i.e. 11 inputs instead of just two. Doing so not only spams blockchain with needlessly oversized txes but can also degrade user privacy. ae2f68d fixes this by picking subsets with less inputs for the same amounts.Also, we do not allow any change outputs for PS txes, so running
ApproximateBestSubsettwice makes no sense and we can save some cpu here (5d89b84).