-
Notifications
You must be signed in to change notification settings - Fork 36.2k
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
[wallet] Use destination groups instead of coins in coin select #12257
Merged
laanwj
merged 10 commits into
bitcoin:master
from
kallewoof:feature-addrgrouped-coinselect
Jul 24, 2018
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
173e18a
utils: Add insert() convenience templates
kallewoof a443d7a
moveonly: CoinElegibilityFilter into coinselection.h
kallewoof 65b3eda
wallet: Add input bytes to CInputCoin
kallewoof bb629cb
Add -avoidpartialspends and m_avoid_partial_spends
kallewoof 87ebce2
wallet: Add output grouping
kallewoof 59d6f7b
wallet: Switch to using output groups instead of coins in coin selection
kallewoof 0128121
test: Add basic testing for wallet groups
kallewoof 43e04d1
wallet: Remove deprecated OutputEligibleForSpending
kallewoof e00b469
clean-up: Remove no longer used ivars from CInputCoin
kallewoof 232f96f
doc: Add release notes for -avoidpartialspends
kallewoof File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Notable changes | ||
=============== | ||
|
||
Coin selection | ||
-------------- | ||
- A new `-avoidpartialspends` flag has been added (default=false). If enabled, the wallet will try to spend UTXO's that point at the same destination | ||
together. This is a privacy increase, as there will no longer be cases where a wallet will inadvertently spend only parts of the coins sent to | ||
the same address (note that if someone were to send coins to that address after it was used, those coins will still be included in future | ||
coin selections). |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2018 The Bitcoin Core developers | ||
// Distributed under the MIT software license, see the accompanying | ||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||
|
||
#include <wallet/coincontrol.h> | ||
|
||
#include <util.h> | ||
|
||
void CCoinControl::SetNull() | ||
{ | ||
destChange = CNoDestination(); | ||
m_change_type.reset(); | ||
fAllowOtherInputs = false; | ||
fAllowWatchOnly = false; | ||
m_avoid_partial_spends = gArgs.GetBoolArg("-avoidpartialspends", DEFAULT_AVOIDPARTIALSPENDS); | ||
setSelected.clear(); | ||
m_feerate.reset(); | ||
fOverrideFeeRate = false; | ||
m_confirm_target.reset(); | ||
m_signal_bip125_rbf.reset(); | ||
m_fee_mode = FeeEstimateMode::UNSET; | ||
} | ||
|
This file contains 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
Oops, something went wrong.
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.
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.
Generally, we initialize all non-static class members where they are declared. Ensure determinism by avoiding accidental use of uninitialized values. Also, static analyzers balk about this. Initializing the members in the declaration makes it easy to spot uninitialized ones.
https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#c-data-structures
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.
It would duplicate the initialization in the
SetNull()
method as well as in the variable declarations. I assume that's okay, then?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.
Ah, sorry. I had missed that
SetNull()
is used in the gui code once.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.
NP! I am unsure if c942091 should be dropped or if it's a-good to have. Keeping it unless/until someone complains.