Merge pull request #6576 from ellemouton/paymentAddrBuildRouteFlag
lncli: add payment-addr flag to buildroute
This commit is contained in:
2 files changed
+20
No files matched your search
@@ -1360,6 +1360,11 @@ var buildRouteCommand = cli.Command{
|
|||||||
"use for the first hop of the payment",
|
"use for the first hop of the payment",
|
||||||
Value: 0,
|
Value: 0,
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "payment_addr",
|
||||||
|
Usage: "hex encoded payment address to set in the " +
|
||||||
|
"last hop's mpp record",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1394,12 +1399,24 @@ func buildRoute(ctx *cli.Context) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
payAddr []byte
|
||||||
|
err error
|
||||||
|
)
|
||||||
|
if ctx.IsSet("payment_addr") {
|
||||||
|
payAddr, err = hex.DecodeString(ctx.String("payment_addr"))
|
||||||
|
if err != nil {
|
||||||
|
return fmt.Errorf("error parsing payment_addr: %v", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Call BuildRoute rpc.
|
// Call BuildRoute rpc.
|
||||||
req := &routerrpc.BuildRouteRequest{
|
req := &routerrpc.BuildRouteRequest{
|
||||||
AmtMsat: amtMsat,
|
AmtMsat: amtMsat,
|
||||||
FinalCltvDelta: int32(ctx.Int64("final_cltv_delta")),
|
FinalCltvDelta: int32(ctx.Int64("final_cltv_delta")),
|
||||||
HopPubkeys: rpcHops,
|
HopPubkeys: rpcHops,
|
||||||
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
OutgoingChanId: ctx.Uint64("outgoing_chan_id"),
|
||||||
|
PaymentAddr: payAddr,
|
||||||
}
|
}
|
||||||
|
|
||||||
route, err := client.BuildRoute(ctxc, req)
|
route, err := client.BuildRoute(ctxc, req)
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ releases. Backward compatibility is not guaranteed!
|
|||||||
caveats/restrictions to be added to an existing macaroon (instead of needing
|
caveats/restrictions to be added to an existing macaroon (instead of needing
|
||||||
to bake a new one).
|
to bake a new one).
|
||||||
|
|
||||||
|
* [Add `payment_addr` flag to `buildroute`](https://github.com/lightningnetwork/lnd/pull/6576)
|
||||||
|
so that the mpp record of the route can be set correctly.
|
||||||
|
|
||||||
## Neutrino
|
## Neutrino
|
||||||
|
|
||||||
[Neutrino now suports BIP
|
[Neutrino now suports BIP
|
||||||
|
|||||||
Reference in new issue
Block a user