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

@@ -158,15 +158,7 @@ void fromwire_channel_id(const u8 **cursor, size_t *max,
void fromwire_short_channel_id(const u8 **cursor, size_t *max,
struct short_channel_id *short_channel_id)
{
be32 txnum = 0, blocknum = 0;
/* Pulling 3 bytes off wire is tricky; they're big-endian. */
fromwire(cursor, max, (char *)&blocknum + 1, 3);
short_channel_id->blocknum = be32_to_cpu(blocknum);
fromwire(cursor, max, (char *)&txnum + 1, 3);
short_channel_id->txnum = be32_to_cpu(txnum);
short_channel_id->outnum = fromwire_u16 (cursor, max);
short_channel_id->u64 = fromwire_u64(cursor, max);
}
void fromwire_sha256(const u8 **cursor, size_t *max, struct sha256 *sha256)