Skip to content

Commit 92787dd

Browse files
committed
test: raise an error when target_vsize is below tx virtual size
1 parent a8780c9 commit 92787dd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/test_framework/wallet.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,9 @@ def _bulk_tx(self, tx, target_vsize):
121121
"""Pad a transaction with extra outputs until it reaches a target vsize.
122122
returns the tx
123123
"""
124+
if target_vsize < tx.get_vsize():
125+
raise RuntimeError(f"target_vsize {target_vsize} is less than transaction virtual size {tx.get_vsize()}")
126+
124127
tx.vout.append(CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN])))
125128
# determine number of needed padding bytes
126129
dummy_vbytes = target_vsize - tx.get_vsize()

0 commit comments

Comments
 (0)