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:
Joost Jager committed 2019-07-11 19:49:47 +02:00
1 parent 418fe364de
commit c6f9517e48
4 files changed
+36 -36

No files matched your search

+1 -1
View File
@@ -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