gossipd: simplify seeker state machine.

We eliminate the "need peer" states and instead check if the
random_peer_softref has been cleared.

We can also unify our restart handlers for all these cases; even the
probe_scids case, by giving gossip credit for the scids as they come
in (at a discount, since scids are 8 bytes vs the ~200 bytes for
normal gossip messages).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-10-08 11:56:24 +10:30
committed by neil saitug
parent 918478b0ef
commit 869b5e40b5
12 changed files with 70 additions and 132 deletions

View File

@@ -2178,7 +2178,7 @@ bool routing_add_channel_update(struct routing_state *rstate,
= gossip_store_add(rstate->gs, update,
hc->bcast.timestamp,
NULL);
peer_supplied_good_gossip(peer);
peer_supplied_good_gossip(peer, 1);
}
if (uc) {
@@ -2497,7 +2497,7 @@ bool routing_add_node_announcement(struct routing_state *rstate,
node->bcast.index
= gossip_store_add(rstate->gs, msg,
node->bcast.timestamp, NULL);
peer_supplied_good_gossip(peer);
peer_supplied_good_gossip(peer, 1);
}
return true;
}