mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02: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:
@@ -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,
|
||||
|
Reference in New Issue
Block a user