-
Notifications
You must be signed in to change notification settings - Fork 37.8k
[wallet] Refactor to use new MIN_CHANGE #6669
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
12ff907
to
d266b80
Compare
I will add some more tests later. |
ping @dooglus: As you are one of the authors of the coin selection code and tests, would you mind giving a concept ACK or concept NACK on this pull? |
Looks good to me. It makes sense to have the minimum change not be hardcoded to 0.01. |
utACK |
//! -maxtxfee default | ||
static const CAmount DEFAULT_TRANSACTION_MAXFEE = 0.1 * COIN; | ||
//! minimum change amount | ||
static const CAmount nMinChange = CENT; |
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.
If it's a constant, please use an all-upper-case name to make that clear, like MINIMUM_CHANGE.
If you plan to turn it into a runtime variable later, it's probably better to make it a runtime variable immediately now, and initialize it with a constant, for example DEFAULT_MINIMUM_CHANGE.
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.
No plans yet to turn it into a runtime variable.
baab750
to
c3c98ff
Compare
Addressed nit by @sipa in follow up commit c3c98ffcb6c27fb836754d54954d2f273928c164. |
c3c98ff
to
bb3ed07
Compare
Add mention of the addition of DEFAULT_TRANSACTION_MINFEE to the commit message? |
Anything holding this back? Does this need more review or additional test cases? |
@MarcoFalke oh? it appeared that the commits in this PR added it. |
Concept & light code review ACK. |
* Introduce new constant MIN_CHANGE and use it instead of the hardcoded "CENT" * Add test case for MIN_CHANGE * Introduce new constant for -mintxfee default: DEFAULT_TRANSACTION_MINFEE = 1000
bb3ed07
to
5190276
Compare
5190276
to
a9c73a1
Compare
@wtogami Done. (Fixed commit msg) |
Concept ACK. After this we could completely get rid of CENT. |
@@ -41,8 +41,12 @@ extern bool fPayAtLeastCustomFee; | |||
static const CAmount DEFAULT_TRANSACTION_FEE = 0; | |||
//! -paytxfee will warn if called with a higher fee than this amount (in satoshis) per KB | |||
static const CAmount nHighTransactionFeeWarning = 0.01 * COIN; | |||
//! -mintxfee default | |||
static const CAmount DEFAULT_TRANSACTION_MINFEE = 1000; |
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.
Should use this new default constant in init.cpp as well (e.g. HelpMessage)
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.
@laanwj Done
utACK |
Bitcoin 0.12 cleanup PRs 2 Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#6631 - bitcoin/bitcoin#6664 - Only the first commit (we already had the second through bitcoin/bitcoin#6825). - bitcoin/bitcoin#6669 - bitcoin/bitcoin#6887 - Only the non-QT parts. - bitcoin/bitcoin#6962 - bitcoin/bitcoin#6822 - Only first and third commits (we already had the second through an earlier PR). - bitcoin/bitcoin#7136 - Excludes Travis CI changes, and fixes to documents we don't have anymore. - bitcoin/bitcoin#7084 - bitcoin/bitcoin#7509 - bitcoin/bitcoin#7617 - bitcoin/bitcoin#7726 Part of #2074.
Introduce a new constant
MIN_CHANGE
and use it in appropriate places.