2021-12-04 21:53:56 +10:30
|
|
|
#include "config.h"
|
2017-08-29 01:35:01 +09:30
|
|
|
#include <common/htlc_wire.h>
|
2020-08-25 11:45:48 +09:30
|
|
|
#include <onchaind/onchaind_wire.h>
|
2017-08-18 14:13:52 +09:30
|
|
|
|
|
|
|
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 20:10:22 +10:30
|
|
|
towire_u64(pptr, htlc_stub->id);
|
2017-08-18 14:13:52 +09:30
|
|
|
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 20:10:22 +10:30
|
|
|
htlc_stub->id = fromwire_u64(cursor, max);
|
2017-08-18 14:13:52 +09:30
|
|
|
fromwire_ripemd160(cursor, max, &htlc_stub->ripemd);
|
|
|
|
}
|