aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_rbf.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/feature_rbf.py')
-rwxr-xr-xtest/functional/feature_rbf.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/test/functional/feature_rbf.py b/test/functional/feature_rbf.py
index c6f55c62b4..344db5f652 100755
--- a/test/functional/feature_rbf.py
+++ b/test/functional/feature_rbf.py
@@ -6,6 +6,7 @@
from decimal import Decimal
+from test_framework.blocktools import COINBASE_MATURITY
from test_framework.messages import COIN, COutPoint, CTransaction, CTxIn, CTxOut
from test_framework.script import CScript, OP_DROP
from test_framework.test_framework import BitcoinTestFramework
@@ -27,18 +28,13 @@ def make_utxo(node, amount, confirmed=True, scriptPubKey=DUMMY_P2WPKH_SCRIPT):
"""
fee = 1*COIN
while node.getbalance() < satoshi_round((amount + fee)/COIN):
- node.generate(100)
+ node.generate(COINBASE_MATURITY)
new_addr = node.getnewaddress()
txid = node.sendtoaddress(new_addr, satoshi_round((amount+fee)/COIN))
tx1 = node.getrawtransaction(txid, 1)
txid = int(txid, 16)
- i = None
-
- for i, txout in enumerate(tx1['vout']):
- if txout['scriptPubKey']['addresses'] == [new_addr]:
- break
- assert i is not None
+ i, _ = next(filter(lambda vout: new_addr == vout[1]['scriptPubKey']['address'], enumerate(tx1['vout'])))
tx2 = CTransaction()
tx2.vin = [CTxIn(COutPoint(txid, i))]