core-lightning/onchaind/onchaind_wire.c
Rusty Russell 4ffda340d3 check: make sure all files outside contrib/ include "config.h" first.
And turn "" includes into full-path (which makes it easier to put
config.h first, and finds some cases check-includes.sh missed
previously).

config.h sets _GNU_SOURCE which really needs to be done before any
'#includes': we mainly got away with it with glibc, but other platforms
like Alpine may have stricter requirements.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2021-12-06 10:05:39 +10:30

21 lines
611 B
C

#include "config.h"
#include <common/htlc_wire.h>
#include <onchaind/onchaind_wire.h>
void towire_htlc_stub(u8 **pptr, const struct htlc_stub *htlc_stub)
{
towire_side(pptr, htlc_stub->owner);
towire_u32(pptr, htlc_stub->cltv_expiry);
towire_u64(pptr, htlc_stub->id);
towire_ripemd160(pptr, &htlc_stub->ripemd);
}
void fromwire_htlc_stub(const u8 **cursor, size_t *max,
struct htlc_stub *htlc_stub)
{
htlc_stub->owner = fromwire_side(cursor, max);
htlc_stub->cltv_expiry = fromwire_u32(cursor, max);
htlc_stub->id = fromwire_u64(cursor, max);
fromwire_ripemd160(cursor, max, &htlc_stub->ripemd);
}