Browse Source

submarine swap: add comment to explain witness script asymmetry

master
ThomasV 5 years ago
parent
commit
edc593a886
  1. 8
      electrum/submarine_swaps.py

8
electrum/submarine_swaps.py

@ -47,6 +47,14 @@ WITNESS_TEMPLATE_SWAP = [
]
# The script of the reverse swaps has one extra check in it to verify
# that the length of the preimage is 32. This is required because in
# the reverse swaps the preimage is generated by the user and to
# settle the hold invoice, you need a preimage with 32 bytes . If that
# check wasn't there the user could generate a preimage with a
# different length which would still allow for claiming the onchain
# coins but the invoice couldn't be settled
WITNESS_TEMPLATE_REVERSE_SWAP = [
opcodes.OP_SIZE,
OPPushDataGeneric(None),

Loading…
Cancel
Save