From 40ce81723543cf3573e8c08d8ca579b65c58f627 Mon Sep 17 00:00:00 2001 From: Jim Posen Date: Mon, 25 Sep 2017 13:28:30 -0700 Subject: [PATCH] lnwallet: Add missing opcode in senderHTLCScript. As specified in BOLT 03. --- lnwallet/script_utils.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 509a69d1..ec56f853 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -260,6 +260,10 @@ func senderHTLCScript(senderKey, receiverKey, revocationKey *btcec.PublicKey, builder.AddData(ripemd160H(paymentHash)) builder.AddOp(txscript.OP_EQUALVERIFY) + // This checks the receiver's signature so that a third party with + // knowledge of the payment preimage still cannot steal the output. + builder.AddOp(txscript.OP_CHECKSIG) + // Close out the OP_IF statement above. builder.AddOp(txscript.OP_ENDIF)