mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
common/derive_basepoints: add routines for marshal/unmarshal.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
ad9dbaaa3f
commit
b2b85100d7
@@ -2,6 +2,7 @@
|
||||
#include <ccan/crypto/sha256/sha256.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/utils.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
bool derive_basepoints(const struct secret *seed,
|
||||
struct pubkey *funding_pubkey,
|
||||
@@ -85,3 +86,20 @@ bool per_commit_point(const struct sha256 *shaseed,
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void towire_basepoints(u8 **pptr, const struct basepoints *b)
|
||||
{
|
||||
towire_pubkey(pptr, &b->revocation);
|
||||
towire_pubkey(pptr, &b->payment);
|
||||
towire_pubkey(pptr, &b->htlc);
|
||||
towire_pubkey(pptr, &b->delayed_payment);
|
||||
}
|
||||
|
||||
void fromwire_basepoints(const u8 **ptr, size_t *max,
|
||||
struct basepoints *b)
|
||||
{
|
||||
fromwire_pubkey(ptr, max, &b->revocation);
|
||||
fromwire_pubkey(ptr, max, &b->payment);
|
||||
fromwire_pubkey(ptr, max, &b->htlc);
|
||||
fromwire_pubkey(ptr, max, &b->delayed_payment);
|
||||
}
|
||||
|
||||
@@ -75,4 +75,9 @@ static inline u64 revocations_received(const struct shachain *shachain)
|
||||
{
|
||||
return (1ULL << SHACHAIN_BITS) - (shachain_next_index(shachain) + 1);
|
||||
}
|
||||
|
||||
void towire_basepoints(u8 **pptr, const struct basepoints *b);
|
||||
void fromwire_basepoints(const u8 **ptr, size_t *max,
|
||||
struct basepoints *b);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_DERIVE_BASEPOINTS_H */
|
||||
|
||||
Reference in New Issue
Block a user