mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 22:46:40 +01:00
rpcserver: use the first hop pubkey as the dest to the htlcSwitch
This commit modifies the sendpayment command slightly to use the pub key of the *first* hop within the route as the destination within the htlcPacket sent to the htlcSwitch. Previously, since only single hop was implemented, the final destination would be set within the htlcPkt, causing the route to fail as the switch doesn’t have a direct link to the dest in the multi-hop case.
This commit is contained in:
parent
9d5b0885d4
commit
17249316d6
1 changed files with 5 additions and 1 deletions
|
@ -510,7 +510,11 @@ func (r *rpcServer) SendPayment(paymentStream lnrpc.Lightning_SendPaymentServer)
|
|||
RedemptionHashes: [][32]byte{rHash},
|
||||
OnionBlob: sphinxPacket,
|
||||
}
|
||||
destAddr := wire.ShaHash(fastsha256.Sum256(nextPayment.Dest))
|
||||
firstHopPub, err := hex.DecodeString(path[1].String())
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
destAddr := wire.ShaHash(fastsha256.Sum256(firstHopPub))
|
||||
htlcPkt := &htlcPacket{
|
||||
dest: destAddr,
|
||||
msg: htlcAdd,
|
||||
|
|
Loading…
Add table
Reference in a new issue