diff --git a/cmd/lncli/main.go b/cmd/lncli/main.go index d5f994c1..b5c2db5b 100644 --- a/cmd/lncli/main.go +++ b/cmd/lncli/main.go @@ -37,6 +37,10 @@ const ( var ( defaultLndDir = btcutil.AppDataDir("lnd", false) 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) { @@ -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 // and not just TCP addresses. - opts = append( - opts, grpc.WithDialer( - lncfg.ClientAddressDialer(defaultRPCPort), - ), - ) + genericDialer := lncfg.ClientAddressDialer(defaultRPCPort) + opts = append(opts, grpc.WithDialer(genericDialer)) + opts = append(opts, grpc.WithDefaultCallOptions(maxMsgRecvSize)) + conn, err := grpc.Dial(ctx.GlobalString("rpcserver"), opts...) if err != nil { fatal(fmt.Errorf("unable to connect to RPC server: %v", err))