From ebe750a88220a4917dc80be56b6ce7497f3485bd Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 28 Feb 2017 11:44:07 -0800 Subject: [PATCH] Part of #1969. Changing min fee calculation also changes the dust threshold. --- qa/rpc-tests/wallet_protectcoinbase.py | 2 +- src/primitives/transaction.h | 2 +- src/test/transaction_tests.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qa/rpc-tests/wallet_protectcoinbase.py b/qa/rpc-tests/wallet_protectcoinbase.py index 7eefb8b9b..1ed0d5b1f 100755 --- a/qa/rpc-tests/wallet_protectcoinbase.py +++ b/qa/rpc-tests/wallet_protectcoinbase.py @@ -181,7 +181,7 @@ class WalletProtectCoinbaseTest (BitcoinTestFramework): amount = Decimal('10.0') - Decimal('0.00010000') - Decimal('0.00000001') # this leaves change at 1 zatoshi less than dust threshold recipients.append({"address":self.nodes[0].getnewaddress(), "amount":amount }) myopid = self.nodes[0].z_sendmany(mytaddr, recipients) - self.wait_and_assert_operationid_status(myopid, "failed", "Insufficient transparent funds, have 10.00, need 0.00000545 more to avoid creating invalid change output 0.00000001 (dust threshold is 0.00000546)") + self.wait_and_assert_operationid_status(myopid, "failed", "Insufficient transparent funds, have 10.00, need 0.00000053 more to avoid creating invalid change output 0.00000001 (dust threshold is 0.00000054)") # Send will fail because send amount is too big, even when including coinbase utxos errorString = "" diff --git a/src/primitives/transaction.h b/src/primitives/transaction.h index 829588371..06a5e80ca 100644 --- a/src/primitives/transaction.h +++ b/src/primitives/transaction.h @@ -274,7 +274,7 @@ public: // to spend something, then we consider it dust. // A typical txout is 34 bytes big, and will // need a CTxIn of at least 148 bytes to spend: - // so dust is a txout less than 546 satoshis + // so dust is a txout less than 54 satoshis // with default minRelayTxFee. size_t nSize = GetSerializeSize(SER_DISK,0)+148u; return 3*minRelayTxFee.GetFee(nSize); diff --git a/src/test/transaction_tests.cpp b/src/test/transaction_tests.cpp index ad4a6e00e..b8f9efd17 100644 --- a/src/test/transaction_tests.cpp +++ b/src/test/transaction_tests.cpp @@ -560,7 +560,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard) string reason; BOOST_CHECK(IsStandardTx(t, reason)); - t.vout[0].nValue = 501; // dust + t.vout[0].nValue = 53; // dust BOOST_CHECK(!IsStandardTx(t, reason)); t.vout[0].nValue = 2730; // not dust @@ -639,7 +639,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandardV2) BOOST_CHECK(IsStandardTx(t, reason)); // v2 transactions can still be non-standard for the same reasons as v1. - t.vout[0].nValue = 501; // dust + t.vout[0].nValue = 53; // dust BOOST_CHECK(!IsStandardTx(t, reason)); // v3 is not standard.