-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Consensus: Move CFeeRate out of libconsensus #9279
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
|
Mhmm, this fails on travis without qt but strangely it seems to work locally (ubuntu) all: |
|
concept ACK |
|
Concept ACK |
53955e9 to
b5ba7f4
Compare
|
Rebased. Changing #include <stdlib.h> for #include <stdint.h> as suggested by ryanofsky_ on IRC solved the issue. |
54981f2 to
976261f
Compare
|
Rebased, @morcos mentioned the possibility of keep passing the CFeeRate to the new function, but after separating dustRelayFee, I'm not sure how he feels about it. |
|
Concept ACK. This doesn't belong in transaction.h, or consensus code at all. |
dcousens
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
|
Concept ACK. I would prefer that IsDust get an optional parameter to setup the dust FeeRate. A reason to not use the same global everywhere is if we decide to have a Dust FeeRate higher at the wallet level. I detailed the reason at #7677 |
976261f to
9e7f477
Compare
|
Changed to maintain CFeeRate param in GetDustThreshold/IsDust. |
src/qt/coincontroldialog.cpp
Outdated
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 change to fDust =| IsDust(txout, ::dustRelayFee); to maintain the logic.
9e7f477 to
4e124f8
Compare
|
Fixed @NicolasDorier 's great catch. |
src/primitives/transaction.h
Outdated
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.
Not necessary, I assume? Kinda defeats the purpose :)
|
@jtimon what do you think about removing the factor of 3 in the formula, and then just increasing the dustRelayTxFee in the code to 3000 sat/KB. Seems unnecessarily complicated as is. |
|
I think your suggestion makes sense, but I would really try to avoid scope creep here. I've been wanting to move this for very long...(see #5114 ). |
4e124f8 to
45ba355
Compare
|
Fixed @theuni 's nit. I was going to add @morcos ' suggestion too, but I'm not sure how to rephrase this: "Fee rate (in %s/kB) used to defined dust, the value of an output such that it will cost about 1/3 of its value in fees at this fee rate to spend it." (init.cpp) |
45ba355 to
c32f28b
Compare
|
Needed rebase |
src/policy/feerate.h
Outdated
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.
Auto-nit: s/2015/2017/
also maybe remove the line with satoshi?
c32f28b to
cb9d875
Compare
|
Rebased to make travis run again because |
381a46e Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module (Jorge Timón) 330bb5a Consensus: Minimal way to move dust out of consensus (Jorge Timón) Tree-SHA512: 19a2ea8169afd5a9d3f940d8974e34cfaead153e3ff3068ac82fccdb8694d19d9b45938904ec9e8cd095bd5ca3a0080364da29372f6aaf56b11a6c2ccd6c7a4d
Summary: Backport of Core PR9278 bitcoin/bitcoin#9279 Test Plan: make check test_runner.py Reviewers: deadalnix, jasonbcox, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3039
Summary: Backport of Core PR9279 bitcoin/bitcoin#9279 Test Plan: make check test_runner.py Reviewers: deadalnix, jasonbcox, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3039
Summary: Backport of Core PR9278 bitcoin/bitcoin#9279 Test Plan: make check test_runner.py Reviewers: deadalnix, jasonbcox, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3039
381a46e Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module (Jorge Timón) 330bb5a Consensus: Minimal way to move dust out of consensus (Jorge Timón) Tree-SHA512: 19a2ea8169afd5a9d3f940d8974e34cfaead153e3ff3068ac82fccdb8694d19d9b45938904ec9e8cd095bd5ca3a0080364da29372f6aaf56b11a6c2ccd6c7a4d
Summary: Backport of Core PR9278 bitcoin/bitcoin#9279 Test Plan: make check test_runner.py Reviewers: deadalnix, jasonbcox, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3039
Summary: Backport of Core PR9279 bitcoin/bitcoin#9279 Test Plan: make check test_runner.py Reviewers: deadalnix, jasonbcox, Fabien, markblundeberg, O1 Bitcoin ABC, #bitcoin_abc Reviewed By: Fabien, O1 Bitcoin ABC, #bitcoin_abc Differential Revision: https://reviews.bitcoinabc.org/D3039
874096e [MOVEONLY] Move CFeeRate out of the consensus module (random-zebra) Pull request description: After #1950, this PR completes the backport of bitcoin#9279 to move CFeeRate out of libconsensus. > CTxOut and CTransaction shouldn't depend on CFeeRate, which is something for policy checks and not consensus checks. ACKs for top commit: furszy: all good now, utACK 874096e Fuzzbawls: utACK 874096e Tree-SHA512: e5c33d7e26003a1c4acb5159c24be5ac0209fe9875b7b7d430cd8927c2174ea4727a8728a065dcf0bf8be4389b8f90fdfab227face458c014cf409385a106baa
CTxOut and CTransaction shouldn't depend on CFeeRate, which is something for policy checks and not consensus checks.
This replaces #7820