lnwallet: fix bug in lockTimeToSequence function

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.
This commit is contained in:
Olaoluwa Osuntokun 2016-08-25 16:25:23 -07:00
parent 37484239fb
commit 04e7a88a83
No known key found for this signature in database
GPG Key ID: 9CC5B105D03521A2
1 changed files with 2 additions and 4 deletions

View File

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