Merge pull request #8627 from feelancer21/inbound-fees-reject

lnrpc: rejects positive inbound fees by default
This commit is contained in:
Oliver Gugger
2024-04-22 01:56:02 -06:00
committed by GitHub
5 changed files with 32 additions and 3 deletions

View File

@ -7109,6 +7109,20 @@ func (r *rpcServer) UpdateChannelPolicy(ctx context.Context,
MaxTimeLockDelta)
}
// By default, positive inbound fees are rejected.
if !r.cfg.AcceptPositiveInboundFees {
if req.InboundBaseFeeMsat > 0 {
return nil, fmt.Errorf("positive values for inbound "+
"base fee msat are not supported: %v",
req.InboundBaseFeeMsat)
}
if req.InboundFeeRatePpm > 0 {
return nil, fmt.Errorf("positive values for inbound "+
"fee rate ppm are not supported: %v",
req.InboundFeeRatePpm)
}
}
baseFeeMsat := lnwire.MilliSatoshi(req.BaseFeeMsat)
feeSchema := routing.FeeSchema{
BaseFee: baseFeeMsat,