File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -588,20 +588,21 @@ void payment_failed(struct lightningd *ld,
588588 onion_wire_name (fail -> failcode ));
589589 failstr = localfail ;
590590 pay_errcode = PAY_TRY_OTHER_ROUTE ;
591- } else if (payment -> path_secrets == NULL ) {
592- /* This was a payment initiated with `sendonion`/`injectonionmessage`, we therefore
593- * don't have the path secrets and cannot decode the error
594- * onion. We hand it to the user. */
595- pay_errcode = PAY_UNPARSEABLE_ONION ;
596- fail = NULL ;
597- failstr = NULL ;
598591 } else if (failmsg ) {
599592 /* This can happen when a direct peer told channeld it's a
600593 * malformed onion using update_fail_malformed_htlc. */
601594 failstr = "local failure" ;
602595 origin_index = 0 ;
603596 pay_errcode = PAY_TRY_OTHER_ROUTE ;
604597 goto use_failmsg ;
598+ } else if (payment -> path_secrets == NULL ) {
599+ /* This was a payment initiated with `sendonion`/`injectonionmessage`, we therefore
600+ * don't have the path secrets and cannot decode the error
601+ * onion. We hand it to the user. */
602+ assert (failonion != NULL );
603+ pay_errcode = PAY_UNPARSEABLE_ONION ;
604+ fail = NULL ;
605+ failstr = NULL ;
605606 } else {
606607 /* Must be normal remote fail with an onion-wrapped error. */
607608 failstr = "reply from remote" ;
Original file line number Diff line number Diff line change @@ -2116,7 +2116,6 @@ def test_bad_onion(node_factory, bitcoind):
21162116 assert err .value .error ['data' ]['erring_channel' ] == route [1 ]['channel' ]
21172117
21182118
2119- @pytest .mark .xfail (strict = True )
21202119def test_bad_onion_immediate_peer (node_factory , bitcoind ):
21212120 """Test that we handle the malformed msg when we're the origin"""
21222121 l1 , l2 = node_factory .line_graph (2 , opts = [{}, {'dev-fail-process-onionpacket' : None }])
You can’t perform that action at this time.
0 commit comments