mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
gossipd: don't use peer softrefs for gossip credit.
We use a "softref" which is a magic pointer which gets NULL'ed when the object is freed. But it's heavy, and a bit tricky to use, and we only use it in gossipd. Instead, keep the nodeid, and do a lookup (now that's fast) if we want to credit the sender for valid gossip. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -808,7 +808,7 @@ const u8 *handle_reply_channel_range(struct peer *peer, const u8 *msg)
|
||||
|
||||
/* Credit peer for answering gossip, so seeker doesn't get upset:
|
||||
* since scids are only 8 bytes, use a discount over normal gossip. */
|
||||
peer_supplied_good_gossip(peer, tal_count(scids) / 20);
|
||||
peer_supplied_good_gossip(peer->daemon, &peer->id, tal_count(scids) / 20);
|
||||
|
||||
/* Old code used to set this to 1 all the time; not setting it implies
|
||||
* we're talking to an upgraded node. */
|
||||
|
||||
Reference in New Issue
Block a user