Skip to content

Commit

Permalink
REMOVE: testing avoiding private gossip
Browse files Browse the repository at this point in the history
  • Loading branch information
endothermicdev committed Sep 18, 2023
1 parent c071d12 commit 862435f
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions gossipd/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ bool routing_add_channel_announcement(struct routing_state *rstate,
struct pubkey bitcoin_key_1;
struct pubkey bitcoin_key_2;
struct unupdated_channel *uc;
const u8 *private_updates[2] = { NULL, NULL };
// const u8 *private_updates[2] = { NULL, NULL };

/* Make sure we own msg, even if we don't save it. */
if (taken(msg))
Expand Down Expand Up @@ -965,17 +965,17 @@ bool routing_add_channel_announcement(struct routing_state *rstate,
return false;
}

/* Reload any private updates */
if (oldchan->half[0].bcast.index)
private_updates[0]
= gossip_store_get_private_update(NULL,
rstate->gs,
oldchan->half[0].bcast.index);
if (oldchan->half[1].bcast.index)
private_updates[1]
= gossip_store_get_private_update(NULL,
rstate->gs,
oldchan->half[1].bcast.index);
// /* Reload any private updates */
// if (oldchan->half[0].bcast.index)
// private_updates[0]
// = gossip_store_get_private_update(NULL,
// rstate->gs,
// oldchan->half[0].bcast.index);
// if (oldchan->half[1].bcast.index)
// private_updates[1]
// = gossip_store_get_private_update(NULL,
// rstate->gs,
// oldchan->half[1].bcast.index);

/* We don't delete it from store until *after* we've put the
* other one in! */
Expand All @@ -999,12 +999,12 @@ bool routing_add_channel_announcement(struct routing_state *rstate,
catch_node_announcement(uc, rstate, &node_id_2);

/* If we had private updates, they'll immediately create the channel. */
if (private_updates[0])
routing_add_channel_update(rstate, take(private_updates[0]), 0,
source_peer, false, false, false);
if (private_updates[1])
routing_add_channel_update(rstate, take(private_updates[1]), 0,
source_peer, false, false, false);
// if (private_updates[0])
// routing_add_channel_update(rstate, take(private_updates[0]), 0,
// source_peer, false, false, false);
// if (private_updates[1])
// routing_add_channel_update(rstate, take(private_updates[1]), 0,
// source_peer, false, false, false);

/* Now we can finish cleanup of gossip store, so there's no window where
* channel (or nodes) vanish. */
Expand Down Expand Up @@ -1558,18 +1558,18 @@ bool routing_add_channel_update(struct routing_state *rstate,
/* For private channels, we get updates without an announce: don't
* broadcast them! But save local ones to store anyway. */
assert(local_direction(rstate, chan, NULL));
/* Don't save if we're loading from store */
if (!index) {
hc->bcast.index
= gossip_store_add_private_update(rstate->gs,
update);
/* No need to separately track spam for private
* channels. */
hc->rgraph.index = hc->bcast.index;
} else {
hc->bcast.index = index;
hc->rgraph.index = index;
}
// /* Don't save if we're loading from store */
// if (!index) {
// hc->bcast.index
// = gossip_store_add_private_update(rstate->gs,
// update);
// /* No need to separately track spam for private
// * channels. */
// hc->rgraph.index = hc->bcast.index;
// } else {
// hc->bcast.index = index;
// hc->rgraph.index = index;
// }
if (!source_peer)
return true;
/* give lightningd the channel's inbound info to store to db */
Expand Down

0 comments on commit 862435f

Please sign in to comment.