moveonly: Move find_pending_cannouncement up

This commit is contained in:
Christian Decker 2018-01-29 23:10:48 +01:00 committed by Rusty Russell
parent 8248dccaee
commit e2f5e4bb3c

View File

@ -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)