From 74854963bfe9b3d82670415f4b64b220c82e78c0 Mon Sep 17 00:00:00 2001 From: bryanvu Date: Wed, 3 May 2017 00:48:50 -0700 Subject: [PATCH] lnwallet: remove OP_CHECKSEQUENCEVERIFY variable Primarily to avoid linting errors, the lnwallet.OP_CHECKSEQUENCEVERIFY variable was removed and references to it replaced with txscript.OP_CHECKSEQUENCEVERIFY. --- lnwallet/script_utils.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 01233574..e7f06257 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -24,8 +24,6 @@ var ( // time is in seconds. SequenceLockTimeSeconds = uint32(1 << 22) - OP_CHECKSEQUENCEVERIFY byte = txscript.OP_NOP3 - // TimelockShift is used to make sure the commitment transaction is // spendable by setting the locktime with it so that it is larger than // 500,000,000, thus interpreting it as Unix epoch timestamp and not @@ -236,7 +234,7 @@ func senderHTLCScript(absoluteTimeout, relativeTimeout uint32, senderKey, builder.AddInt64(int64(absoluteTimeout)) builder.AddOp(txscript.OP_CHECKLOCKTIMEVERIFY) builder.AddInt64(int64(relativeTimeout)) - builder.AddOp(OP_CHECKSEQUENCEVERIFY) + builder.AddOp(txscript.OP_CHECKSEQUENCEVERIFY) builder.AddOp(txscript.OP_2DROP) builder.AddData(senderKey.SerializeCompressed()) builder.AddOp(txscript.OP_CHECKSIG) @@ -401,7 +399,7 @@ func receiverHTLCScript(absoluteTimeout, relativeTimeout uint32, senderKey, builder.AddData(paymentHash) builder.AddOp(txscript.OP_EQUALVERIFY) builder.AddInt64(int64(relativeTimeout)) - builder.AddOp(OP_CHECKSEQUENCEVERIFY) + builder.AddOp(txscript.OP_CHECKSEQUENCEVERIFY) builder.AddOp(txscript.OP_DROP) builder.AddData(receiverKey.SerializeCompressed()) builder.AddOp(txscript.OP_CHECKSIG) @@ -599,7 +597,7 @@ func commitScriptToSelf(csvTimeout uint32, selfKey, revokeKey *btcec.PublicKey) builder.AddData(selfKey.SerializeCompressed()) builder.AddOp(txscript.OP_CHECKSIGVERIFY) builder.AddInt64(int64(csvTimeout)) - builder.AddOp(OP_CHECKSEQUENCEVERIFY) + builder.AddOp(txscript.OP_CHECKSEQUENCEVERIFY) builder.AddOp(txscript.OP_ENDIF)