Part of #1969. Changing min fee calculation also changes the dust threshold.
This commit is contained in:
@@ -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
|
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 })
|
recipients.append({"address":self.nodes[0].getnewaddress(), "amount":amount })
|
||||||
myopid = self.nodes[0].z_sendmany(mytaddr, recipients)
|
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
|
# Send will fail because send amount is too big, even when including coinbase utxos
|
||||||
errorString = ""
|
errorString = ""
|
||||||
|
|||||||
@@ -274,7 +274,7 @@ public:
|
|||||||
// to spend something, then we consider it dust.
|
// to spend something, then we consider it dust.
|
||||||
// A typical txout is 34 bytes big, and will
|
// A typical txout is 34 bytes big, and will
|
||||||
// need a CTxIn of at least 148 bytes to spend:
|
// 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.
|
// with default minRelayTxFee.
|
||||||
size_t nSize = GetSerializeSize(SER_DISK,0)+148u;
|
size_t nSize = GetSerializeSize(SER_DISK,0)+148u;
|
||||||
return 3*minRelayTxFee.GetFee(nSize);
|
return 3*minRelayTxFee.GetFee(nSize);
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandard)
|
|||||||
string reason;
|
string reason;
|
||||||
BOOST_CHECK(IsStandardTx(t, reason));
|
BOOST_CHECK(IsStandardTx(t, reason));
|
||||||
|
|
||||||
t.vout[0].nValue = 501; // dust
|
t.vout[0].nValue = 53; // dust
|
||||||
BOOST_CHECK(!IsStandardTx(t, reason));
|
BOOST_CHECK(!IsStandardTx(t, reason));
|
||||||
|
|
||||||
t.vout[0].nValue = 2730; // not dust
|
t.vout[0].nValue = 2730; // not dust
|
||||||
@@ -639,7 +639,7 @@ BOOST_AUTO_TEST_CASE(test_IsStandardV2)
|
|||||||
BOOST_CHECK(IsStandardTx(t, reason));
|
BOOST_CHECK(IsStandardTx(t, reason));
|
||||||
|
|
||||||
// v2 transactions can still be non-standard for the same reasons as v1.
|
// 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));
|
BOOST_CHECK(!IsStandardTx(t, reason));
|
||||||
|
|
||||||
// v3 is not standard.
|
// v3 is not standard.
|
||||||
|
|||||||
Reference in New Issue
Block a user