short_channel_id: don't use bitfields.

I leave all the now-unnecessary accessors in place to avoid churn, but
the use of bitfields has been more pain than help.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2018-03-01 19:52:24 +10:30
committed by Christian Decker
parent 6f14736803
commit 042d5d13f5
7 changed files with 52 additions and 45 deletions

View File

@@ -89,7 +89,9 @@ static void get_txout(struct subd *gossip, const u8 *msg)
/* FIXME: Block less than 6 deep? */
bitcoind_getoutput(gossip->ld->topology->bitcoind,
scid->blocknum, scid->txnum, scid->outnum,
short_channel_id_blocknum(scid),
short_channel_id_txnum(scid),
short_channel_id_outnum(scid),
got_txout, scid);
}

View File

@@ -256,7 +256,7 @@ remote_routing_failure(const tal_t *ctx,
const struct pubkey *erring_node;
const struct short_channel_id *route_channels;
const struct short_channel_id *erring_channel;
static const struct short_channel_id dummy_channel = { 0, 0, 0 };
static const struct short_channel_id dummy_channel = { 0 };
int origin_index;
bool retry_plausible;
bool report_to_gossipd;

View File

@@ -521,9 +521,9 @@ static enum watch_result funding_lockin_cb(struct channel *channel,
/* If we restart, we could already have peer->scid from database */
if (!channel->scid) {
channel->scid = tal(channel, struct short_channel_id);
channel->scid->blocknum = loc->blkheight;
channel->scid->txnum = loc->index;
channel->scid->outnum = channel->funding_outnum;
mk_short_channel_id(channel->scid,
loc->blkheight, loc->index,
channel->funding_outnum);
}
tal_free(loc);