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:
Rusty Russell
2018-09-21 10:01:45 +09:30
committed by Christian Decker
parent 48de77d56e
commit 8455b12781
4 changed files with 16 additions and 47 deletions

View File

@@ -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, &timestamp,
&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;
}