From 04e7a88a838c7943d6a0711c480833c56c246de0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 25 Aug 2016 16:25:23 -0700 Subject: [PATCH] lnwallet: fix bug in lockTimeToSequence function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit fixes a bug in the lockTimeToSequence function when mapping a block-based relative lock time to the proper sequence number. Applying the mask isn’t necessary since the values are expected to be blow 65K blocks. --- lnwallet/script_utils.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lnwallet/script_utils.go b/lnwallet/script_utils.go index 0b2ce31af..942c39581 100644 --- a/lnwallet/script_utils.go +++ b/lnwallet/script_utils.go @@ -522,10 +522,8 @@ func receiverHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount, // * (Compatibility) func lockTimeToSequence(isSeconds bool, locktime uint32) uint32 { if !isSeconds { - // The locktime is to be expressed in confirmations. Apply the - // mask to restrict the number of confirmations to 65,535 or - // 1.25 years. - return SequenceLockTimeMask & locktime + // The locktime is to be expressed in confirmations. + return locktime } // Set the 22nd bit which indicates the lock time is in seconds, then