lnrpc/routerrpc: make SendToRoute consistent with other payment RPCs
In this commitment, we make the `SendToRoute` RPC call consistent with all the other payment RPCs which will properly adhere to the current max payment sat limit. This is a prep commit for the future wumbo soft cap that will eventually land in lnd.
This commit is contained in:
parent
06e8d1c5ca
commit
392c1a9a1b
@ -470,6 +470,13 @@ func (r *RouterBackend) UnmarshallRoute(rpcroute *lnrpc.Route) (
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if routeHop.AmtToForward > r.MaxPaymentMSat {
|
||||
return nil, fmt.Errorf("payment of %v is too large, "+
|
||||
"max payment allowed is %v",
|
||||
routeHop.AmtToForward,
|
||||
r.MaxPaymentMSat.ToSatoshis())
|
||||
}
|
||||
|
||||
hops[i] = routeHop
|
||||
|
||||
prevNodePubKey = routeHop.PubKeyBytes
|
||||
|
Loading…
Reference in New Issue
Block a user