mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
Add test for unspendable transactions and parameter 'maxburnamount' to sendrawtransaction.
'maxburnamount' sets a maximum value for outputs heuristically deemed unspendable including datacarrier scripts that begin with `OP_RETURN`.
This commit is contained in:
@@ -156,9 +156,10 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||
|
||||
# Generate and send another tx with an OP_RETURN output (which is unspendable)
|
||||
tx2 = self.wallet.create_self_transfer(utxo_to_spend=tx1_out_21)['tx']
|
||||
tx2.vout = [CTxOut(int(Decimal('20.99') * COIN), CScript([OP_RETURN] + [OP_FALSE] * 30))]
|
||||
tx2_val = '20.99'
|
||||
tx2.vout = [CTxOut(int(Decimal(tx2_val) * COIN), CScript([OP_RETURN] + [OP_FALSE] * 30))]
|
||||
tx2_hex = tx2.serialize().hex()
|
||||
self.nodes[0].sendrawtransaction(tx2_hex)
|
||||
self.nodes[0].sendrawtransaction(tx2_hex, 0, tx2_val)
|
||||
|
||||
# Include both txs in a block
|
||||
self.generate(self.nodes[0], 1)
|
||||
|
||||
Reference in New Issue
Block a user