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
2020-01-14 15:07:29 +02:00
parent daa08be62a
commit 6f0a342f92
4 changed files with 89 additions and 94 deletions

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)