2017-08-28 18:05:01 +02:00
|
|
|
#include <common/htlc_wire.h>
|
2017-08-29 06:12:04 +02:00
|
|
|
#include <onchaind/onchain_wire.h>
|
2017-08-18 06:43:52 +02:00
|
|
|
#include <wire/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);
|
2018-10-23 11:40:22 +02:00
|
|
|
towire_u64(pptr, htlc_stub->id);
|
2017-08-18 06:43:52 +02:00
|
|
|
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);
|
2018-10-23 11:40:22 +02:00
|
|
|
htlc_stub->id = fromwire_u64(cursor, max);
|
2017-08-18 06:43:52 +02:00
|
|
|
fromwire_ripemd160(cursor, max, &htlc_stub->ripemd);
|
|
|
|
}
|