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:
2 files changed
+35
-8
No files matched your search
@@ -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