mirror of
https://github.com/aljazceru/breez-lnd.git
synced 2025-12-17 22:24:21 +01: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