tx,bugfix: correct signature length estimate

71-bytes for a signature already includes the sighash byte.

 2-bytes	30 44 (DER- prefix thing)
34-bytes	02 20 6e29c8df67fffdda1613cef1413eb1a9ef3627f1fc5e4d910837274eafcc7b2a (r)
34-bytes	02 20 4b8563d79b92fdd830a546862439f80b24132d09318af2c7220c791067067e29 (s)
 1-byte		01 (sighash)
==
71-bytes
This commit is contained in:
niftynei
2020-10-19 13:55:37 -05:00
committed by Rusty Russell
parent f8c4cc73ae
commit 26bc4f5239
4 changed files with 29 additions and 29 deletions

View File

@@ -578,7 +578,7 @@ def test_utxopsbt(node_factory, bitcoind, chainparams):
assert psbt2['tx']['vin'] == psbt['tx']['vin']
if chainparams['elements']:
# elements includes the fee as an output
addl_fee = Millisatoshi(fee_val * start_weight // 1000 * 1000)
addl_fee = Millisatoshi((fee_val * start_weight + 999) // 1000 * 1000)
assert psbt2['tx']['vout'][0]['value'] == psbt['tx']['vout'][0]['value'] + addl_fee.to_btc()
else:
assert psbt2['tx']['vout'] == psbt['tx']['vout']