lnrpc: rejects positive inbound fees by default

Positive inbound are now rejected by default. The user can enable positive
inbound fees with the option 'accept-positive-inbound-fees'.
This commit is contained in:
feelancer21
2024-04-06 18:45:04 +02:00
parent 6377f98536
commit a2319e4313
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,