mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +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
@ -522,10 +522,8 @@ func receiverHtlcSpendTimeout(commitScript []byte, outputAmt btcutil.Amount,
|
|||||||
// * (Compatibility)
|
// * (Compatibility)
|
||||||
func lockTimeToSequence(isSeconds bool, locktime uint32) uint32 {
|
func lockTimeToSequence(isSeconds bool, locktime uint32) uint32 {
|
||||||
if !isSeconds {
|
if !isSeconds {
|
||||||
// The locktime is to be expressed in confirmations. Apply the
|
// The locktime is to be expressed in confirmations.
|
||||||
// mask to restrict the number of confirmations to 65,535 or
|
return locktime
|
||||||
// 1.25 years.
|
|
||||||
return SequenceLockTimeMask & locktime
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the 22nd bit which indicates the lock time is in seconds, then
|
// Set the 22nd bit which indicates the lock time is in seconds, then
|
||||||
|
Loading…
Reference in New Issue
Block a user