Consensus: Move CFeeRate out of libconsensus #9279
pull jtimon wants to merge 2 commits into bitcoin:master from jtimon:0.13-consensus-dust-out-minimal changing 23 files +124 −96-
jtimon commented at 5:45 am on December 5, 2016: contributorCTxOut and CTransaction shouldn’t depend on CFeeRate, which is something for policy checks and not consensus checks. This replaces #7820
-
fanquake added the label Consensus on Dec 5, 2016
-
jtimon commented at 6:39 pm on December 9, 2016: contributor
Mhmm, this fails on travis without qt but strangely it seems to work locally (ubuntu) all:
0./configure --without-gui 1./configure --disable-wallet --without-gui 2./configure --disable-wallet
-
dcousens commented at 11:49 pm on December 9, 2016: contributorconcept ACK
-
sipa commented at 11:51 pm on December 9, 2016: memberConcept ACK
-
jtimon force-pushed on Dec 13, 2016
-
jtimon force-pushed on Dec 13, 2016
-
jtimon commented at 8:31 pm on December 13, 2016: contributorRebased. Changing #include <stdlib.h> for #include <stdint.h> as suggested by ryanofsky_ on IRC solved the issue.
-
jtimon force-pushed on Jan 25, 2017
-
jtimon force-pushed on Jan 31, 2017
-
laanwj commented at 6:37 pm on February 2, 2017: memberConcept ACK. This doesn’t belong in transaction.h, or consensus code at all.
-
dcousens approved
-
dcousens commented at 1:00 am on February 3, 2017: contributorutACK
-
NicolasDorier commented at 4:47 am on February 3, 2017: contributor
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 https://github.com/bitcoin/bitcoin/issues/7677
-
jtimon force-pushed on Feb 3, 2017
-
jtimon commented at 5:17 am on February 3, 2017: contributorChanged to maintain CFeeRate param in GetDustThreshold/IsDust. And rebased without need, why not?
-
in src/qt/coincontroldialog.cpp: in 9e7f477872 outdated
432@@ -433,8 +433,7 @@ void CoinControlDialog::updateLabels(WalletModel *model, QDialog* dialog) 433 { 434 CTxOut txout(amount, (CScript)std::vector<unsigned char>(24, 0)); 435 txDummy.vout.push_back(txout); 436- if (txout.IsDust(dustRelayFee)) 437- fDust = true; 438+ fDust = IsDust(txout, ::dustRelayFee);
NicolasDorier commented at 5:33 am on February 3, 2017:should change tofDust =| IsDust(txout, ::dustRelayFee);
to maintain the logic.jtimon force-pushed on Feb 9, 2017jtimon commented at 9:31 pm on February 9, 2017: contributorFixed @NicolasDorier ’s great catch.in src/primitives/transaction.h: in 4e124f8ea7 outdated
6@@ -7,6 +7,7 @@ 7 #define BITCOIN_PRIMITIVES_TRANSACTION_H 8 9 #include "amount.h" 10+#include "policy/feerate.h"
theuni commented at 11:51 pm on February 9, 2017:Not necessary, I assume? Kinda defeats the purpose :)jtimon force-pushed on Feb 11, 2017jtimon commented at 2:53 am on February 11, 2017: contributorFixed @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) The comment on DUST_RELAY_TX_FEE delcaration (policy/policy.h) would probably need some modifications too.
jtimon force-pushed on Apr 4, 2017jtimon commented at 4:09 pm on April 4, 2017: contributorNeeded rebasein src/policy/feerate.h:2 in c32f28b402 outdated
0@@ -0,0 +1,54 @@ 1+// Copyright (c) 2009-2010 Satoshi Nakamoto 2+// Copyright (c) 2009-2015 The Bitcoin Core developers
jtimon commented at 4:18 pm on April 4, 2017:Auto-nit: s/2015/2017/ also maybe remove the line with satoshi?jtimon force-pushed on Apr 5, 2017jtimon commented at 11:08 pm on April 5, 2017: contributorRebased to make travis run again because
0E: Failed to fetch http://us-central1.gce.archive.ubuntu.com/ubuntu/pool/universe/w/wine1.6/wine1.6_1.6.2-0ubuntu4_amd64.deb 503 Service Unavailable [IP: 23.236.60.84 80] 1...
jtimon force-pushed on Apr 18, 2017jtimon commented at 7:33 pm on April 18, 2017: contributorNeeded rebaseNicolasDorier commented at 3:03 am on April 19, 2017: contributorutACK 11ba99fcb6f5bcf64342f61c9c580d70873933e2jtimon force-pushed on Apr 20, 2017jtimon commented at 10:43 pm on April 20, 2017: contributorneeded trivial rebase (6)
EDIT: I was also removing includes to amount.h that I didn’t need to
jtimon force-pushed on Apr 20, 2017sipa commented at 0:18 am on April 21, 2017: memberutACK 57c109a2f92decfc407e1205e247668c84b411e2. I’m very happy to see those dust functions mode out of CTransaction.Consensus: Minimal way to move dust out of consensus 330bb5a456Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module
...from amount.o to policy/feerate.o Policy, because it moves policy code to the policy directory (common module)
jtimon force-pushed on May 3, 2017jtimon commented at 4:01 pm on May 3, 2017: contributorneeded trivial rebase (7)in src/policy/policy.cpp:18 in 330bb5a456 outdated
14@@ -15,6 +15,43 @@ 15 16 #include <boost/foreach.hpp> 17 18+CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee)
ryanofsky commented at 9:48 pm on May 8, 2017:In commit “Consensus: Minimal way to move dust out of consensus”
In
IsDust
andGetDustThreshold
, it might be good to give thedustRelayFee
arguments a name that doesn’t shadow the global::dustRelayFee
variable.
paveljanik commented at 9:13 am on May 9, 2017:Yes, this nit was not handled before merge so current master:
0policy/policy.cpp:18:63: warning: declaration shadows a variable in the global namespace [-Wshadow] 1CAmount GetDustThreshold(const CTxOut& txout, const CFeeRate& dustRelayFee) 2 ^ 3./policy/policy.h:101:17: note: previous declaration is here 4extern CFeeRate dustRelayFee; 5 ^ 6policy/policy.cpp:50:50: warning: declaration shadows a variable in the global namespace [-Wshadow] 7bool IsDust(const CTxOut& txout, const CFeeRate& dustRelayFee) 8 ^ 9./policy/policy.h:101:17: note: previous declaration is here 10extern CFeeRate dustRelayFee; 11 ^ 122 warnings generated.
ryanofsky commented at 10:11 pm on May 8, 2017: memberutACK 381a46e38fa9262c868e5fee9ed0d1f71af4059e. The two commits seem like they could be separate PRs. But they are both good cleanups.laanwj merged this on May 9, 2017laanwj closed this on May 9, 2017
laanwj referenced this in commit 08a7316c14 on May 9, 2017jtimon deleted the branch on May 30, 2017markblundeberg referenced this in commit 7cb2307fdf on May 23, 2019markblundeberg referenced this in commit a83e457a8f on May 23, 2019PastaPastaPasta referenced this in commit 386883e7cb on Jun 10, 2019PastaPastaPasta referenced this in commit 68014b3ca3 on Jun 10, 2019PastaPastaPasta referenced this in commit 47a96b6aa7 on Jun 10, 2019jonspock referenced this in commit cfb4dfce57 on Jun 13, 2019PastaPastaPasta referenced this in commit 46f96686e0 on Jun 19, 2019PastaPastaPasta referenced this in commit 47cf476cf7 on Jun 19, 2019PastaPastaPasta referenced this in commit fd60ab0cb2 on Jun 19, 2019PastaPastaPasta referenced this in commit 9e36fcb278 on Jun 19, 2019PastaPastaPasta referenced this in commit f2971473f9 on Jun 19, 2019PastaPastaPasta referenced this in commit 413ba9b806 on Jun 19, 2019PastaPastaPasta referenced this in commit dba6bf57d7 on Jun 19, 2019PastaPastaPasta referenced this in commit 93436270f4 on Jun 20, 2019PastaPastaPasta referenced this in commit 5003445e24 on Jun 22, 2019PastaPastaPasta referenced this in commit fae2af39e4 on Jun 22, 2019PastaPastaPasta referenced this in commit 0685795c42 on Jun 22, 2019PastaPastaPasta referenced this in commit a6b4ebca59 on Jun 22, 2019PastaPastaPasta referenced this in commit f3fb007451 on Jun 24, 2019PastaPastaPasta referenced this in commit dffade9edf on Jun 26, 2019PastaPastaPasta referenced this in commit 39cfd61c07 on Jun 26, 2019jtoomim referenced this in commit a9b3a1e660 on Jun 29, 2019jtoomim referenced this in commit 1aea2acb9c on Jun 29, 2019barrystyle referenced this in commit 2cb78e63de on Jan 22, 2020random-zebra referenced this in commit 676f6a79bf on Nov 6, 2020DrahtBot locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-19 00:12 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me