mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-18 14:44:22 +01:00
Merge pull request #1482 from cfromknecht/uniform-fee-update-timeout
htlcswitch/link: correct bias in fee update backoff
This commit is contained in:
@@ -995,12 +995,7 @@ out:
|
||||
func (l *channelLink) randomFeeUpdateTimeout() time.Duration {
|
||||
lower := int64(l.cfg.MinFeeUpdateTimeout)
|
||||
upper := int64(l.cfg.MaxFeeUpdateTimeout)
|
||||
rand := prand.Int63n(upper)
|
||||
if rand < lower {
|
||||
rand = lower
|
||||
}
|
||||
|
||||
return time.Duration(rand)
|
||||
return time.Duration(prand.Int63n(upper-lower) + lower)
|
||||
}
|
||||
|
||||
// handleDownStreamPkt processes an HTLC packet sent from the downstream HTLC
|
||||
|
||||
Reference in New Issue
Block a user