submarine swap: add comment to explain witness script asymmetry

This commit is contained in:
ThomasV 2020-10-22 17:24:44 +02:00
parent 08f70420e3
commit edc593a886

View file

@ -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),