mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-19 13:04:37 +01:00
gossip: formalize passing of siphash_seed.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <bitcoin/shadouble.h>
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/build_assert/build_assert.h>
|
||||
#include <ccan/crypto/siphash24/siphash24.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
@@ -256,3 +257,9 @@ struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
|
||||
{
|
||||
return pull_bitcoin_tx(ctx, cursor, max);
|
||||
}
|
||||
|
||||
void fromwire_siphash_seed(const u8 **cursor, size_t *max,
|
||||
struct siphash_seed *seed)
|
||||
{
|
||||
fromwire(cursor, max, seed, sizeof(*seed));
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <bitcoin/shadouble.h>
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/crypto/ripemd160/ripemd160.h>
|
||||
#include <ccan/crypto/siphash24/siphash24.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
@@ -168,3 +169,8 @@ void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx)
|
||||
towire_u8_array(pptr, lin, tal_len(lin));
|
||||
tal_free(tmpctx);
|
||||
}
|
||||
|
||||
void towire_siphash_seed(u8 **pptr, const struct siphash_seed *seed)
|
||||
{
|
||||
towire(pptr, seed, sizeof(*seed));
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ struct bitcoin_blkid;
|
||||
struct bitcoin_txid;
|
||||
struct preimage;
|
||||
struct ripemd160;
|
||||
struct siphash_seed;
|
||||
|
||||
/* Makes generate-wire.py work */
|
||||
typedef char wirestring;
|
||||
@@ -60,6 +61,7 @@ void towire_u8_array(u8 **pptr, const u8 *arr, size_t num);
|
||||
|
||||
void towire_bitcoin_tx(u8 **pptr, const struct bitcoin_tx *tx);
|
||||
void towire_wirestring(u8 **pptr, const char *str);
|
||||
void towire_siphash_seed(u8 **cursor, const struct siphash_seed *seed);
|
||||
|
||||
const u8 *fromwire(const u8 **cursor, size_t *max, void *copy, size_t n);
|
||||
u8 fromwire_u8(const u8 **cursor, size_t *max);
|
||||
@@ -93,7 +95,8 @@ void fromwire_pad(const u8 **cursor, size_t *max, size_t num);
|
||||
|
||||
void fromwire_u8_array(const u8 **cursor, size_t *max, u8 *arr, size_t num);
|
||||
char *fromwire_wirestring(const tal_t *ctx, const u8 **cursor, size_t *max);
|
||||
|
||||
struct bitcoin_tx *fromwire_bitcoin_tx(const tal_t *ctx,
|
||||
const u8 **cursor, size_t *max);
|
||||
void fromwire_siphash_seed(const u8 **cursor, size_t *max,
|
||||
struct siphash_seed *seed);
|
||||
#endif /* LIGHTNING_WIRE_WIRE_H */
|
||||
|
||||
Reference in New Issue
Block a user