Merge pull request #2374 from Roasbeef/increase-lightning-block-size

cmd/lncli: increase lightning gRPC block size to 50MB
This commit is contained in:
Olaoluwa Osuntokun 2018-12-28 15:12:04 -06:00 committed by GitHub
commit c0087e8be5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -37,6 +37,10 @@ const (
var ( var (
defaultLndDir = btcutil.AppDataDir("lnd", false) defaultLndDir = btcutil.AppDataDir("lnd", false)
defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename) defaultTLSCertPath = filepath.Join(defaultLndDir, defaultTLSCertFilename)
// maxMsgRecvSize is the largest message our client will receive. We
// set this to ~50Mb atm.
maxMsgRecvSize = grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 50)
) )
func fatal(err error) { func fatal(err error) {
@ -131,11 +135,10 @@ func getClientConn(ctx *cli.Context, skipMacaroons bool) *grpc.ClientConn {
// We need to use a custom dialer so we can also connect to unix sockets // We need to use a custom dialer so we can also connect to unix sockets
// and not just TCP addresses. // and not just TCP addresses.
opts = append( genericDialer := lncfg.ClientAddressDialer(defaultRPCPort)
opts, grpc.WithDialer( opts = append(opts, grpc.WithDialer(genericDialer))
lncfg.ClientAddressDialer(defaultRPCPort), opts = append(opts, grpc.WithDefaultCallOptions(maxMsgRecvSize))
),
)
conn, err := grpc.Dial(ctx.GlobalString("rpcserver"), opts...) conn, err := grpc.Dial(ctx.GlobalString("rpcserver"), opts...)
if err != nil { if err != nil {
fatal(fmt.Errorf("unable to connect to RPC server: %v", err)) fatal(fmt.Errorf("unable to connect to RPC server: %v", err))