From e2f5e4bb3c960e349e116256efcad848aa101406 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 29 Jan 2018 23:10:48 +0100 Subject: [PATCH] moveonly: Move find_pending_cannouncement up --- gossipd/routing.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/gossipd/routing.c b/gossipd/routing.c index 1cbfdc991..1a505cc7f 100644 --- a/gossipd/routing.c +++ b/gossipd/routing.c @@ -519,6 +519,22 @@ static bool check_channel_announcement( check_signed_hash(&hash, bitcoin2_sig, bitcoin2_key); } +/* While master always processes in order, bitcoind is async, so they could + * theoretically return out of order. */ +static struct pending_cannouncement * +find_pending_cannouncement(struct routing_state *rstate, + const struct short_channel_id *scid) +{ + struct pending_cannouncement *i; + + list_for_each(&rstate->pending_cannouncement, i, list) { + if (short_channel_id_eq(scid, &i->short_channel_id)) + return i; + } + return NULL; +} + + const struct short_channel_id *handle_channel_announcement( struct routing_state *rstate, const u8 *announce TAKES) @@ -606,21 +622,6 @@ const struct short_channel_id *handle_channel_announcement( return &pending->short_channel_id; } -/* While master always processes in order, bitcoind is async, so they could - * theoretically return out of order. */ -static struct pending_cannouncement * -find_pending_cannouncement(struct routing_state *rstate, - const struct short_channel_id *scid) -{ - struct pending_cannouncement *i; - - list_for_each(&rstate->pending_cannouncement, i, list) { - if (short_channel_id_eq(scid, &i->short_channel_id)) - return i; - } - return NULL; -} - bool handle_pending_cannouncement(struct routing_state *rstate, const struct short_channel_id *scid, const u8 *outscript)