increase default pool capacity

Ignore lower values, lntop won't start with pool_capacity <= 3 due to
router rpc handle.
pull/22/head
Martin Milata 3 years ago
parent f0dedd5d2a
commit 2e9cced9c3

@ -39,7 +39,7 @@ macaroon = "/root/.lnd/data/chain/bitcoin/mainnet/admin.macaroon"
macaroon_timeout = 60 macaroon_timeout = 60
max_msg_recv_size = 52428800 max_msg_recv_size = 52428800
conn_timeout = 1000000 conn_timeout = 1000000
pool_capacity = 3 pool_capacity = 4
[views] [views]
# views.channels is the view displaying channel list. # views.channels is the view displaying channel list.

@ -105,7 +105,7 @@ func NewDefault() *Config {
MacaroonTimeOut: 60, MacaroonTimeOut: 60,
MaxMsgRecvSize: 52428800, MaxMsgRecvSize: 52428800,
ConnTimeout: 1000000, ConnTimeout: 1000000,
PoolCapacity: 3, PoolCapacity: 4,
}, },
} }
} }

@ -21,6 +21,7 @@ import (
const ( const (
lndDefaultInvoiceExpiry = 3600 lndDefaultInvoiceExpiry = 3600
lndMinPoolCapacity = 4
) )
type Client struct { type Client struct {
@ -479,6 +480,10 @@ func New(c *config.Network, logger logging.Logger) (*Backend, error) {
logger: logger.With(logging.String("name", c.Name)), logger: logger.With(logging.String("name", c.Name)),
} }
if c.PoolCapacity < lndMinPoolCapacity {
c.PoolCapacity = lndMinPoolCapacity
logger.Info("pool_capacity too small, ignoring")
}
backend.pool, err = pool.New(backend.NewClientConn, c.PoolCapacity, time.Duration(c.ConnTimeout)) backend.pool, err = pool.New(backend.NewClientConn, c.PoolCapacity, time.Duration(c.ConnTimeout))
if err != nil { if err != nil {
return nil, err return nil, err

Loading…
Cancel
Save