1
0

psbt: implement CompactSize key types (previously single-byte types)

based on latest BIP-0174 update: bitcoin/bips#849
This commit is contained in:
SomberNight
2019-11-07 03:27:38 +01:00
parent aa518c0ea5
commit 83740c1a78
2 changed files with 33 additions and 14 deletions

View File

@@ -240,6 +240,7 @@ def var_int(i: int) -> str:
# https://en.bitcoin.it/wiki/Protocol_specification#Variable_length_integer
# https://github.com/bitcoin/bitcoin/blob/efe1ee0d8d7f82150789f1f6840f139289628a2b/src/serialize.h#L247
# "CompactSize"
assert i >= 0, i
if i<0xfd:
return int_to_hex(i)
elif i<=0xffff: