Skip to content

Commit

Permalink
patch bad-gossip-debug.patch
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyrussell committed Feb 7, 2024
1 parent f56b9e9 commit 31cc626
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 9 additions & 2 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <wire/peer_wire.h>
#include <wire/wire_io.h>
#include <wire/wire_sync.h>

Expand Down Expand Up @@ -1851,8 +1852,11 @@ static void peer_send_msg(struct io_conn *conn,
/* This can happen if peer hung up on us (or wrong counter
* if it reconnected). */
peer = peer_htable_get(daemon->peers, &id);
if (peer && peer->counter == counter)
if (peer && peer->counter == counter) {
status_debug("Sending %s from lightningd",
peer_wire_name(fromwire_peektype(sendmsg)));
inject_peer_msg(peer, take(sendmsg));
}
}

static void dev_connect_memleak(struct daemon *daemon, const u8 *msg)
Expand Down Expand Up @@ -2175,8 +2179,11 @@ static struct io_plan *recv_gossip(struct io_conn *conn,
fromwire_peektype(msg));

peer = peer_htable_get(daemon->peers, &dst);
if (peer)
if (peer) {
status_debug("Sending %s from gossipd",
peer_wire_name(fromwire_peektype(gossip_msg)));
inject_peer_msg(peer, take(gossip_msg));
}

return daemon_conn_read_next(conn, daemon->gossipd);
}
Expand Down
7 changes: 6 additions & 1 deletion connectd/multiplex.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,8 @@ static u8 *maybe_from_gossip_store(const tal_t *ctx, struct peer *peer)
msg = tal_free(msg);
goto again;
}
status_debug("Sending %s from gossip_store",
peer_wire_name(fromwire_peektype(msg)));
status_peer_io(LOG_IO_OUT, &peer->id, msg);
return msg;
}
Expand Down Expand Up @@ -581,8 +583,11 @@ void send_custommsg(struct daemon *daemon, const u8 *msg)

/* Races can happen: this might be gone by now. */
peer = peer_htable_get(daemon->peers, &id);
if (peer)
if (peer) {
status_debug("Sending %s from custommsg",
peer_wire_name(fromwire_peektype(custommsg)));
inject_peer_msg(peer, take(custommsg));
}
}

static void handle_ping_in(struct peer *peer, const u8 *msg)
Expand Down
2 changes: 2 additions & 0 deletions gossipd/gossmap_manage.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,8 @@ const char *gossmap_manage_channel_update(const tal_t *ctx,
if (!gossmap_find_chan(gossmap, &scid)
&& source_peer
&& sigcheck_channel_update(tmpctx, source_peer, &signature, update) == NULL) {
status_debug("gossip update for unknown channel %s",
type_to_string(tmpctx, struct short_channel_id, &scid));
tell_lightningd_peer_update(gm->daemon, source_peer,
scid, fee_base_msat,
fee_proportional_millionths,
Expand Down

0 comments on commit 31cc626

Please sign in to comment.