mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
419612c4bd
This is stolen from William's clightning-dumpkeys (https://github.com/jb55/clightning-dumpkeys),
itself adapted from 42b66a6b81/src/script/descriptor.cpp (L25)
Co-authored-by: William Casarin <jb55@jb55.com>
Signed-off-by: Antoine Poinsot <darosior@protonmail.com>
17 lines
493 B
C
17 lines
493 B
C
#ifndef LIGHTNING_COMMON_DESCRIPTOR_CHECKSUM_H
|
|
#define LIGHTNING_COMMON_DESCRIPTOR_CHECKSUM_H
|
|
#include "config.h"
|
|
#include <stdbool.h>
|
|
|
|
/* https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md#reference */
|
|
#define DESCRIPTOR_CHECKSUM_LENGTH 8
|
|
|
|
struct descriptor_checksum {
|
|
char csum[DESCRIPTOR_CHECKSUM_LENGTH + 1];
|
|
};
|
|
|
|
bool descriptor_checksum(const char *descriptor, int desc_size,
|
|
struct descriptor_checksum *checksum);
|
|
|
|
#endif /* LIGHTNING_COMMON_DESCRIPTOR_CHECKSUM_H */
|