lnwire+htlcswitch: only use references for failure messages
Methods on failure message types used to be defined on value receivers. This allowed assignment of a failure message to ForwardingError both as a value and as a pointer. This is error-prone, especially when using a type switch. In this commit the failure message methods are changed so that they target pointer receivers. Two instances where a value was assigned instead of a reference are fixed.
This commit is contained in:
4 files changed
+36
-36
No files matched your search
@@ -981,7 +981,7 @@ func (s *Switch) parseFailedPayment(deobfuscator ErrorDecrypter,
|
||||
return &ForwardingError{
|
||||
FailureSourceIdx: 0,
|
||||
ExtraMsg: userErr,
|
||||
FailureMessage: lnwire.FailPermanentChannelFailure{},
|
||||
FailureMessage: &lnwire.FailPermanentChannelFailure{},
|
||||
}
|
||||
|
||||
// A regular multi-hop payment error that we'll need to
|
||||
|
||||
Reference in new issue
Block a user