mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-04 12:42:05 +02:00
test: use MiniWallet for feature_maxuploadtarget.py
This test can now be run even with the Bitcoin Core wallet disabled.
This commit is contained in:
@ -573,17 +573,17 @@ def create_lots_of_big_transactions(node, txouts, utxos, num, fee):
|
||||
return txids
|
||||
|
||||
|
||||
def mine_large_block(test_framework, node, utxos=None):
|
||||
def mine_large_block(test_framework, mini_wallet, node):
|
||||
# generate a 66k transaction,
|
||||
# and 14 of them is close to the 1MB block limit
|
||||
num = 14
|
||||
txouts = gen_return_txouts()
|
||||
utxos = utxos if utxos is not None else []
|
||||
if len(utxos) < num:
|
||||
utxos.clear()
|
||||
utxos.extend(node.listunspent())
|
||||
fee = 100 * node.getnetworkinfo()["relayfee"]
|
||||
create_lots_of_big_transactions(node, txouts, utxos, num, fee=fee)
|
||||
from .messages import COIN
|
||||
fee = 100 * int(node.getnetworkinfo()["relayfee"] * COIN)
|
||||
for _ in range(14):
|
||||
tx = mini_wallet.create_self_transfer(from_node=node, fee_rate=0, mempool_valid=False)['tx']
|
||||
tx.vout[0].nValue -= fee
|
||||
tx.vout.extend(txouts)
|
||||
mini_wallet.sendrawtransaction(from_node=node, tx_hex=tx.serialize().hex())
|
||||
test_framework.generate(node, 1)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user