readability change: OP_n calculation from boolean arithmetic to ternary

This commit is contained in:
SomberNight 2017-09-16 03:43:08 +02:00
parent 653c7acb48
commit a339270c07
1 changed files with 1 additions and 1 deletions

View File

@ -338,7 +338,7 @@ def address_to_script(addr):
if is_segwit_address(addr):
witver, witprog = segwit_addr.decode(SEGWIT_HRP, addr)
assert (0 <= witver <= 16)
OP_n = (witver+0x50) * (witver > 0)
OP_n = witver + 0x50 if witver > 0 else 0
script = bytes([OP_n]).hex()
script += push_script(bytes(witprog).hex())
return script