mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-19 04:54:25 +01:00
onion: Print the extracted channel_update and onionreply to debug
This adds one line with the onion and the channel_update we extract from it. This in turn allows us to check that the channel_update in the onion is not type prefixed, and that we patch it correctly before passing it to gossipd.
This commit is contained in:
committed by
Rusty Russell
parent
6bbea741d1
commit
d3edfc8028
@@ -297,7 +297,8 @@ remote_routing_failure(const tal_t *ctx,
|
||||
bool *p_retry_plausible,
|
||||
bool *p_report_to_gossipd,
|
||||
const struct wallet_payment *payment,
|
||||
const struct onionreply *failure)
|
||||
const struct onionreply *failure,
|
||||
struct log *log)
|
||||
{
|
||||
enum onion_type failcode = fromwire_peektype(failure->msg);
|
||||
u8 *channel_update;
|
||||
@@ -318,6 +319,11 @@ remote_routing_failure(const tal_t *ctx,
|
||||
channel_update
|
||||
= channel_update_from_onion_error(routing_failure,
|
||||
failure->msg);
|
||||
if (channel_update)
|
||||
log_debug(log, "Extracted channel_update %s from onionreply %s",
|
||||
tal_hex(tmpctx, channel_update),
|
||||
tal_hex(tmpctx, failure->msg));
|
||||
|
||||
retry_plausible = true;
|
||||
report_to_gossipd = true;
|
||||
|
||||
@@ -521,7 +527,8 @@ void payment_failed(struct lightningd *ld, const struct htlc_out *hout,
|
||||
fail = remote_routing_failure(tmpctx,
|
||||
&retry_plausible,
|
||||
&report_to_gossipd,
|
||||
payment, reply);
|
||||
payment, reply,
|
||||
hout->key.channel->log);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user