lnwallet+itest: fix PaymentDescriptor creation for blinded path htlc

This commit fixes the instantiation of the BlindingPoint member of
PaymentDescriptor during the conversion from persisted LogUpdates.
Previously, the blinding point was not set correctly. The test from the
previous commit is also updated to now assert that this behaviour is now
correct.
This commit is contained in:
Elle Mouton 2024-08-22 11:22:53 +02:00
parent 9ac8e673b4
commit b0852a22fd
No known key found for this signature in database
GPG key ID: D7D916376026F177
2 changed files with 2 additions and 9 deletions

View file

@ -1428,10 +1428,6 @@ func testMPPToMultipleBlindedPaths(ht *lntest.HarnessTest) {
// a blinded path payment since this adds a new blinding point field to
// UpdateAddHTLC which we need to ensure gets included in the message on
// restart.
//
// NOTE: this first version of this test asserts that this fails. This is to
// demonstrate that a bug exists in the reloading and forwarding code. This will
// be fixed in a following commit.
func testBlindedPaymentHTLCReForward(ht *lntest.HarnessTest) {
// Setup a test case.
ctx, testCase := newBlindedForwardTest(ht)
@ -1452,9 +1448,6 @@ func testBlindedPaymentHTLCReForward(ht *lntest.HarnessTest) {
}
// In a goroutine, we let Alice pay the invoice from dave.
//
// NOTE: for now, we assert that this attempt fails. Once the noted bug
// is fixed, this will be changed to a success assertion.
done := make(chan struct{})
go func() {
defer close(done)
@ -1464,7 +1457,7 @@ func testBlindedPaymentHTLCReForward(ht *lntest.HarnessTest) {
)
require.NoError(testCase.ht, err)
require.Equal(
testCase.ht, lnrpc.HTLCAttempt_FAILED,
testCase.ht, lnrpc.HTLCAttempt_SUCCEEDED,
htlcAttempt.Status,
)
}()

View file

@ -205,7 +205,7 @@ func PayDescsFromRemoteLogUpdates(chanID lnwire.ShortChannelID, height uint64,
Height: height,
Index: uint16(i),
},
BlindingPoint: pd.BlindingPoint,
BlindingPoint: wireMsg.BlindingPoint,
}
pd.OnionBlob = make([]byte, len(wireMsg.OnionBlob))
copy(pd.OnionBlob[:], wireMsg.OnionBlob[:])