Skip to content

Commit

Permalink
Merge pull request #2374 from Roasbeef/increase-lightning-block-size
Browse files Browse the repository at this point in the history
cmd/lncli: increase lightning gRPC block size to 50MB
  • Loading branch information
Roasbeef committed Dec 28, 2018
2 parents e6623f9 + 0453078 commit c0087e8
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/lncli/main.go
Expand Up @@ -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) {
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit c0087e8

Please sign in to comment.