htlcswitch: add ForwardingError constructor

Add a constructor for the creation of forwarding errors.
A special constructor is added for the case where we have
an unknown wire failure, and must set a nil failure message.
This commit is contained in:
carla committed 2020-01-14 15:07:29 +02:00
1 parent daa08be62a
commit 6f0a342f92
4 files changed
+89 -94

No files matched your search

+1 -4
View File
@@ -400,10 +400,7 @@ func (o *mockDeobfuscator) DecryptError(reason lnwire.OpaqueReason) (*Forwarding
return nil, err
}
return &ForwardingError{
FailureSourceIdx: 1,
FailureMessage: failure,
}, nil
return NewForwardingError(failure, 1, ""), nil
}
var _ ErrorDecrypter = (*mockDeobfuscator)(nil)