Browse Source

moveonly: Move find_pending_cannouncement up

ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
e2f5e4bb3c
  1. 31
      gossipd/routing.c

31
gossipd/routing.c

@ -519,6 +519,22 @@ static bool check_channel_announcement(
check_signed_hash(&hash, bitcoin2_sig, bitcoin2_key); 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( const struct short_channel_id *handle_channel_announcement(
struct routing_state *rstate, struct routing_state *rstate,
const u8 *announce TAKES) const u8 *announce TAKES)
@ -606,21 +622,6 @@ const struct short_channel_id *handle_channel_announcement(
return &pending->short_channel_id; 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, bool handle_pending_cannouncement(struct routing_state *rstate,
const struct short_channel_id *scid, const struct short_channel_id *scid,
const u8 *outscript) const u8 *outscript)

Loading…
Cancel
Save