mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
wire: understand struct preimage, don't treat it as sha256.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "utils.h"
|
||||
#include "wire.h"
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <bitcoin/shadouble.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
@@ -150,6 +151,11 @@ void fromwire_sha256_double(const u8 **cursor, size_t *max,
|
||||
fromwire_sha256(cursor, max, &sha256d->sha);
|
||||
}
|
||||
|
||||
void fromwire_preimage(const u8 **cursor, size_t *max, struct preimage *preimage)
|
||||
{
|
||||
fromwire(cursor, max, preimage, sizeof(*preimage));
|
||||
}
|
||||
|
||||
void fromwire_ipv6(const u8 **cursor, size_t *max, struct ipv6 *ipv6)
|
||||
{
|
||||
fromwire(cursor, max, ipv6, sizeof(*ipv6));
|
||||
|
||||
Reference in New Issue
Block a user