diff --git a/lightningd/peer_htlcs.c b/lightningd/peer_htlcs.c index 804c50389..cfed09ca0 100644 --- a/lightningd/peer_htlcs.c +++ b/lightningd/peer_htlcs.c @@ -981,9 +981,12 @@ htlc_accepted_hook_callback(struct htlc_accepted_hook_payload *request, case htlc_accepted_continue: /* *Now* we barf if it failed to decode */ if (!request->payload) { - log_debug(channel->log, "Failing HTLC because of an invalid payload"); - local_fail_in_htlc_badonion(hin, - WIRE_INVALID_ONION_PAYLOAD); + log_debug(channel->log, + "Failing HTLC because of an invalid payload"); + local_fail_in_htlc(hin, + take(towire_invalid_onion_payload( + NULL, request->failtlvtype, + request->failtlvpos))); } else if (rs->nextcase == ONION_FORWARD) { forward_htlc(hin, hin->cltv_expiry, request->payload->amt_to_forward, diff --git a/tests/test_pay.py b/tests/test_pay.py index d4e41fab6..28274c224 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -2806,7 +2806,6 @@ caused a crash in 0.8.0, so we then disallowed it. assert inv['amount_received_msat'] == Millisatoshi(1001) -@pytest.mark.xfail(strict=True) def test_reject_invalid_payload(node_factory): """Send an onion payload with an unknown even type.