mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-03 02:06:18 +00:00
test: raise an error when target_vsize is below tx virtual size
This commit is contained in:
parent
a8780c937f
commit
92787dd52c
@ -121,6 +121,9 @@ class MiniWallet:
|
||||
"""Pad a transaction with extra outputs until it reaches a target vsize.
|
||||
returns the tx
|
||||
"""
|
||||
if target_vsize < tx.get_vsize():
|
||||
raise RuntimeError(f"target_vsize {target_vsize} is less than transaction virtual size {tx.get_vsize()}")
|
||||
|
||||
tx.vout.append(CTxOut(nValue=0, scriptPubKey=CScript([OP_RETURN])))
|
||||
# determine number of needed padding bytes
|
||||
dummy_vbytes = target_vsize - tx.get_vsize()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user