mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-21 08:04:26 +01:00
Revert "gossipd: handle premature node_announcements in the store."
This reverts commit e2f426903d.
With the new store version, this can't happen.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
48de77d56e
commit
8455b12781
@@ -1285,9 +1285,7 @@ static struct wireaddr *read_addresses(const tal_t *ctx, const u8 *ser)
|
||||
return wireaddrs;
|
||||
}
|
||||
|
||||
bool routing_add_node_announcement(struct routing_state *rstate,
|
||||
const u8 *msg TAKES,
|
||||
bool *unknown_node)
|
||||
bool routing_add_node_announcement(struct routing_state *rstate, const u8 *msg TAKES)
|
||||
{
|
||||
struct node *node;
|
||||
secp256k1_ecdsa_signature signature;
|
||||
@@ -1301,21 +1299,15 @@ bool routing_add_node_announcement(struct routing_state *rstate,
|
||||
if (!fromwire_node_announcement(tmpctx, msg,
|
||||
&signature, &features, ×tamp,
|
||||
&node_id, rgb_color, alias,
|
||||
&addresses)) {
|
||||
if (unknown_node)
|
||||
*unknown_node = false;
|
||||
&addresses))
|
||||
return false;
|
||||
}
|
||||
|
||||
node = get_node(rstate, &node_id);
|
||||
|
||||
/* May happen if we accepted the node_announcement due to a local
|
||||
* channel, for which we didn't have the announcement yet. */
|
||||
if (node == NULL) {
|
||||
if (unknown_node)
|
||||
*unknown_node = true;
|
||||
if (node == NULL)
|
||||
return false;
|
||||
}
|
||||
|
||||
wireaddrs = read_addresses(tmpctx, addresses);
|
||||
tal_free(node->addresses);
|
||||
@@ -1468,7 +1460,7 @@ u8 *handle_node_announcement(struct routing_state *rstate, const u8 *node_ann)
|
||||
status_trace("Received node_announcement for node %s",
|
||||
type_to_string(tmpctx, struct pubkey, &node_id));
|
||||
|
||||
applied = routing_add_node_announcement(rstate, serialized, NULL);
|
||||
applied = routing_add_node_announcement(rstate, serialized);
|
||||
assert(applied);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user