mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-01 02:51:37 +02:00
server: send 0 bandwidth hints for links that can't add htlc
This commit is contained in:
@ -718,6 +718,12 @@ func newServer(cfg *Config, listenAddrs []net.Addr,
|
||||
return 0
|
||||
}
|
||||
|
||||
// If our link isn't currently in a state where it can
|
||||
// add another outgoing htlc, treat the link as unusable.
|
||||
if err := link.MayAddOutgoingHtlc(); err != nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Otherwise, we'll return the current best estimate
|
||||
// for the available bandwidth for the link.
|
||||
return link.Bandwidth()
|
||||
|
Reference in New Issue
Block a user