mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
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:
committed by
Christian Decker
parent
6f14736803
commit
042d5d13f5
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user