mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-05-21 09:10:03 +02:00
lnd: allow large GRPC messages
This commit is contained in:
parent
996be217b9
commit
eeea141e01
@ -39,7 +39,7 @@ var (
|
|||||||
|
|
||||||
// maxMsgRecvSize is the largest message our client will receive. We
|
// maxMsgRecvSize is the largest message our client will receive. We
|
||||||
// set this to 200MiB atm.
|
// set this to 200MiB atm.
|
||||||
maxMsgRecvSize = grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 200)
|
maxMsgRecvSize = grpc.MaxCallRecvMsgSize(lnrpc.MaxGrpcMsgSize)
|
||||||
)
|
)
|
||||||
|
|
||||||
func fatal(err error) {
|
func fatal(err error) {
|
||||||
|
5
lnd.go
5
lnd.go
@ -268,6 +268,9 @@ func Main(cfg *Config, lisCfg ListenerCfg, implCfg *ImplementationCfg,
|
|||||||
|
|
||||||
rpcServerOpts := interceptorChain.CreateServerOpts()
|
rpcServerOpts := interceptorChain.CreateServerOpts()
|
||||||
serverOpts = append(serverOpts, rpcServerOpts...)
|
serverOpts = append(serverOpts, rpcServerOpts...)
|
||||||
|
serverOpts = append(
|
||||||
|
serverOpts, grpc.MaxRecvMsgSize(lnrpc.MaxGrpcMsgSize),
|
||||||
|
)
|
||||||
|
|
||||||
grpcServer := grpc.NewServer(serverOpts...)
|
grpcServer := grpc.NewServer(serverOpts...)
|
||||||
defer grpcServer.Stop()
|
defer grpcServer.Stop()
|
||||||
@ -771,7 +774,7 @@ func getTLSConfig(cfg *Config) ([]grpc.ServerOption, []grpc.DialOption,
|
|||||||
restDialOpts := []grpc.DialOption{
|
restDialOpts := []grpc.DialOption{
|
||||||
grpc.WithTransportCredentials(restCreds),
|
grpc.WithTransportCredentials(restCreds),
|
||||||
grpc.WithDefaultCallOptions(
|
grpc.WithDefaultCallOptions(
|
||||||
grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 200),
|
grpc.MaxCallRecvMsgSize(lnrpc.MaxGrpcMsgSize),
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,4 +14,8 @@ var (
|
|||||||
regexp.MustCompile("^/v1/channels/transaction-stream$"),
|
regexp.MustCompile("^/v1/channels/transaction-stream$"),
|
||||||
regexp.MustCompile("^/v2/router/htlcinterceptor$"),
|
regexp.MustCompile("^/v2/router/htlcinterceptor$"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// MaxGrpcMsgSize is used when we configure both server and clients to
|
||||||
|
// allow sending/receiving at most 200 MiB GRPC messages.
|
||||||
|
MaxGrpcMsgSize = 200 * 1024 * 1024
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user