Skip to content

Commit

Permalink
Allow SegWit versions 0-16
Browse files Browse the repository at this point in the history
BIP173 permits witness versions up to 16.

Sending to future native witness outputs will be standard in the 0.19 Bitcoin Core release: bitcoin/bitcoin#15846
  • Loading branch information
Sjors committed Jun 11, 2019
1 parent 22bc5f8 commit 6969493
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bech32.c
Expand Up @@ -245,8 +245,7 @@ int wally_addr_segwit_to_bytes(const char *addr, const char *addr_family,
if (flags || !addr_family || !addr || !bytes_out || !len || !written)
return WALLY_EINVAL;

/* Only v0 witness programs are currently allowed */
if (!segwit_addr_decode(&witver, decoded, written, addr_family, addr) || witver != 0)
if (!segwit_addr_decode(&witver, decoded, written, addr_family, addr) || witver > 16)
ret = WALLY_EINVAL;
else
ret = wally_witness_program_from_bytes(decoded, *written, flags, bytes_out, len, written);
Expand Down

0 comments on commit 6969493

Please sign in to comment.