| 369 | } |
| 370 | |
| 371 | static struct node *new_node(struct routing_state *rstate, |
| 372 | const struct node_id *id) |
| 373 | { |
| 374 | struct node *n; |
| 375 | |
| 376 | assert(!get_node(rstate, id)); |
| 377 | |
| 378 | n = tal(rstate, struct node); |
| 379 | n->id = *id; |
| 380 | memset(n->chans.arr, 0, sizeof(n->chans.arr)); |
| 381 | broadcastable_init(&n->bcast); |
| 382 | broadcastable_init(&n->rgraph); |
| 383 | n->tokens = TOKEN_MAX; |
| 384 | node_map_add(rstate->nodes, n); |
| 385 | tal_add_destructor2(n, destroy_node, rstate); |
| 386 | |
| 387 | return n; |
| 388 | } |
| 389 | |
| 390 | /* We've received a channel_announce for a channel attached to this node: |
| 391 | * otherwise it's in the map only because it's a peer, or us. */ |
no test coverage detected