mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 10:11:11 +02:00
routing+zpay32: copy pubkeys before nilling Curve and spewing
Since nilling the pubkey curve will lead to a nil-pointer exception if the key is later used for signature verification, we make sure to make a copy before nilling and spewing.
This commit is contained in:
@@ -29,3 +29,15 @@ type HopHint struct {
|
||||
// CLTVExpiryDelta is the time-lock delta of the channel.
|
||||
CLTVExpiryDelta uint16
|
||||
}
|
||||
|
||||
// Copy returns a deep copy of the hop hint.
|
||||
func (h HopHint) Copy() HopHint {
|
||||
nodeID := *h.NodeID
|
||||
return HopHint{
|
||||
NodeID: &nodeID,
|
||||
ChannelID: h.ChannelID,
|
||||
FeeBaseMSat: h.FeeBaseMSat,
|
||||
FeeProportionalMillionths: h.FeeProportionalMillionths,
|
||||
CLTVExpiryDelta: h.CLTVExpiryDelta,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user