diff options
author | zathras-crypto <zathrasc@gmail.com> | 2015-03-25 02:04:02 -0700 |
---|---|---|
committer | dexX7 <dexx@bitwatch.co> | 2015-07-18 17:31:55 +0200 |
commit | 0aad1f13b2430165062bf9436036c1222a8724da (patch) | |
tree | 6cc83f06f73b18462985b7d90e2cdd563c4708aa /qa | |
parent | ed789ceade71f19f04340a4041d7d3ef43c44086 (diff) |
Exempt unspendable transaction outputs from dust checks
Since unspendable outputs can't be spent, there is no threshold at which it would be uneconomic to spend them.
This primarily targets transaction outputs with `OP_RETURN`.
---
Initially based on:
commit 9cf0ae26350033d43d5dd3c95054c0d1b1641eda
Author: zathras-crypto <zathrasc@gmail.com>
Date: Wed Mar 25 02:04:02 2015 -0700
Changes:
- cherry-picked on top of bitcoin:master
- added RPC test for fundrawtransaction
Diffstat (limited to 'qa')
-rwxr-xr-x | qa/rpc-tests/fundrawtransaction.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/qa/rpc-tests/fundrawtransaction.py b/qa/rpc-tests/fundrawtransaction.py index 80f1d1e128..ce52247b2e 100755 --- a/qa/rpc-tests/fundrawtransaction.py +++ b/qa/rpc-tests/fundrawtransaction.py @@ -524,6 +524,22 @@ class RawTransactionsTest(BitcoinTestFramework): self.sync_all() assert_equal(oldBalance+Decimal('50.19000000'), self.nodes[0].getbalance()) #0.19+block reward + ##################################################### + # test fundrawtransaction with OP_RETURN and no vin # + ##################################################### + + rawtx = "0100000000010000000000000000066a047465737400000000" + dec_tx = self.nodes[2].decoderawtransaction(rawtx) + + assert_equal(len(dec_tx['vin']), 0) + assert_equal(len(dec_tx['vout']), 1) + + rawtxfund = self.nodes[2].fundrawtransaction(rawtx) + dec_tx = self.nodes[2].decoderawtransaction(rawtxfund['hex']) + + assert_greater_than(len(dec_tx['vin']), 0) # at least one vin + assert_equal(len(dec_tx['vout']), 2) # one change output added + if __name__ == '__main__': RawTransactionsTest().main() |