mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 08:55:59 +01:00
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:
parent
37484239fb
commit
04e7a88a83
1 changed files with 2 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue