Part of #1969. Changing min fee calculation also changes the dust threshold.

This commit is contained in:
Simon 2017-02-28 11:44:07 -08:00
parent 0f724e716d
commit ebe750a882
3 changed files with 4 additions and 4 deletions

View File

@ -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 = ""

View File

@ -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);

View File

@ -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.