multi: deprecate IncorrectHtlcAmount onion error

In this commit, we deprecate the `IncorrectHtlcAmount` onion error.
We'll still decode this error to use when retrying paths, but we'll no
longer send this ourselves. The `UnknownPaymentHash` error has been
amended to also include the value of the payment as well. This allows us
to worry about one less error.
This commit is contained in:
orbitalturtle authored and Olaoluwa Osuntokun committed 2019-01-29 18:21:13 -08:00
1 parent fd1bbe63cf
commit 08750f180b
5 files changed
+85 -39

No files matched your search

+6 -5
View File
@@ -587,11 +587,11 @@ func TestExitNodeAmountPayloadMismatch(t *testing.T) {
).Wait(30 * time.Second)
if err == nil {
t.Fatalf("payment should have failed but didn't")
} else if err.Error() != lnwire.CodeIncorrectPaymentAmount.String() {
} else if !strings.Contains(err.Error(), lnwire.CodeUnknownPaymentHash.String()) {
// TODO(roasbeef): use proper error after error propagation is
// in
t.Fatalf("incorrect error, expected insufficient value, "+
"instead have: %v", err)
t.Fatalf("expected %v got %v", err,
lnwire.CodeUnknownPaymentHash)
}
}
@@ -1017,8 +1017,9 @@ func TestChannelLinkMultiHopUnknownPaymentHash(t *testing.T) {
n.firstBobChannelLink.ShortChanID(), htlc,
newMockDeobfuscator(),
)
if err.Error() != lnwire.CodeUnknownPaymentHash.String() {
t.Fatal("error haven't been received")
if !strings.Contains(err.Error(), lnwire.CodeUnknownPaymentHash.String()) {
t.Fatalf("expected %v got %v", err,
lnwire.CodeUnknownPaymentHash)
}
// Wait for Alice to receive the revocation.