Rusty Russell
7 years ago
3 changed files with 39 additions and 1 deletions
@ -0,0 +1,19 @@ |
|||||
|
#include <ccan/structeq/structeq.h> |
||||
|
#include <lightningd/htlc_wire.h> |
||||
|
#include <lightningd/onchain/onchain_wire.h> |
||||
|
#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); |
||||
|
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); |
||||
|
fromwire_ripemd160(cursor, max, &htlc_stub->ripemd); |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
#ifndef LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H |
||||
|
#define LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H |
||||
|
#include "config.h" |
||||
|
#include <ccan/short_types/short_types.h> |
||||
|
#include <ccan/tal/tal.h> |
||||
|
#include <daemon/htlc.h> |
||||
|
|
||||
|
/* The minimal info about an htlc. */ |
||||
|
struct htlc_stub { |
||||
|
enum side owner; |
||||
|
u32 cltv_expiry; |
||||
|
struct ripemd160 ripemd; |
||||
|
}; |
||||
|
|
||||
|
void towire_htlc_stub(u8 **pptr, const struct htlc_stub *htlc_stub); |
||||
|
void fromwire_htlc_stub(const u8 **cursor, size_t *max, |
||||
|
struct htlc_stub *htlc_stub); |
||||
|
#endif /* LIGHTNING_LIGHTNINGD_ONCHAIN_WIRE_H */ |
Loading…
Reference in new issue