Skip to content

Commit 19dd91a

Browse files
committed
qa: remove a redundant condition in fee estimation test
Signed-off-by: Antoine Poinsot <[email protected]>
1 parent 7908772 commit 19dd91a

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

test/functional/feature_fee_estimation.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,12 @@ def small_txpuzzle_randfee(from_node, conflist, unconflist, amount, min_fee, fee
6767
t = conflist.pop(0)
6868
total_in += t["amount"]
6969
tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
70+
while total_in <= (amount + fee) and len(unconflist) > 0:
71+
t = unconflist.pop(0)
72+
total_in += t["amount"]
73+
tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
7074
if total_in <= amount + fee:
71-
while total_in <= (amount + fee) and len(unconflist) > 0:
72-
t = unconflist.pop(0)
73-
total_in += t["amount"]
74-
tx.vin.append(CTxIn(COutPoint(int(t["txid"], 16), t["vout"]), b""))
75-
if total_in <= amount + fee:
76-
raise RuntimeError(f"Insufficient funds: need {amount + fee}, have {total_in}")
75+
raise RuntimeError(f"Insufficient funds: need {amount + fee}, have {total_in}")
7776
tx.vout.append(CTxOut(int((total_in - amount - fee) * COIN), P2SH_1))
7877
tx.vout.append(CTxOut(int(amount * COIN), P2SH_2))
7978
# These transactions don't need to be signed, but we still have to insert

0 commit comments

Comments
 (0)