Replaces the validation check for "amount == 0" with an isDust check, so very small output amounts are caught before the wallet is unlocked, a transaction is created, etc.
Reject dust amounts during validation #2885
pull gavinandresen wants to merge 1 commits into bitcoin:master from gavinandresen:gui_rejectdust changing 3 files +20 −12-
gavinandresen commented at 3:12 AM on August 8, 2013: contributor
-
6407dc93a5
Reject dust amounts during validation
Replaces the validation check for "amount == 0" with an isDust check, so very small output amounts are caught before the wallet is unlocked, a transaction is created, etc.
-
BitcoinPullTester commented at 4:00 AM on August 8, 2013: none
Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/6407dc93a5165aaf016118bad211d8415b92f4e7 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.
-
in src/qt/guiutil.cpp:None in 6407dc93a5
147 | @@ -148,6 +148,14 @@ bool parseBitcoinURI(QString uri, SendCoinsRecipient *out) 148 | return parseBitcoinURI(uriInstance, out); 149 | } 150 | 151 | +bool isDust(const QString& address, qint64 amount) 152 | +{ 153 | + CTxDestination dest = CBitcoinAddress(address.toStdString()).Get();
sipa commented at 9:47 PM on August 15, 2013:Any reason to bother copying the script?
gavinandresen commented at 2:00 AM on August 16, 2013:@sipa: Not sure I follow. Are you suggesting avoiding a copy by doing something like:
CTxOut txOut; txOut.nValue = amount; txOut.scriptPubKey.SetDestination(dest);Performance doesn't matter here, and accessing the CTxOut members directly makes me feel a little dirty...
gavinandresen commented at 2:02 AM on August 16, 2013:Oh, or are you suggesting that an empty CScript would work for the isDust() call? CTxOut::isDust() does use the size of the scriptPubKey.
sipa commented at 4:04 PM on August 25, 2013:Resolved. @gavinandresen I missed the fact that it uses the serialized size.
sipa commented at 4:05 PM on August 25, 2013: memberACK but needs rebase.
Diapolo commented at 1:27 PM on August 29, 2013: noneping @gavinandresen Wasn't this included in your paymentrequest-pull?
gavinandresen commented at 1:10 AM on August 30, 2013: contributor@Diapolo : yes, this was part of the paymentrequest pull. Closing.
gavinandresen closed this on Aug 30, 2013gavinandresen deleted the branch on Nov 4, 2013IntegralTeam referenced this in commit 4dee7c4a25 on Jun 4, 2019DrahtBot locked this on Sep 8, 2021Contributors
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: 2026-05-02 15:15 UTC
More mirrored repositories can be found on mirror.b10c.me