mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
varint: make helper public
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include <bitcoin/psbt.h>
|
#include <bitcoin/psbt.h>
|
||||||
#include <bitcoin/pubkey.h>
|
#include <bitcoin/pubkey.h>
|
||||||
#include <bitcoin/script.h>
|
#include <bitcoin/script.h>
|
||||||
|
#include <bitcoin/varint.h>
|
||||||
#include <ccan/ccan/array_size/array_size.h>
|
#include <ccan/ccan/array_size/array_size.h>
|
||||||
#include <ccan/ccan/mem/mem.h>
|
#include <ccan/ccan/mem/mem.h>
|
||||||
#include <ccan/tal/str/str.h>
|
#include <ccan/tal/str/str.h>
|
||||||
@@ -467,12 +468,12 @@ static void add_type(u8 **key, const u8 num)
|
|||||||
add(key, &num, 1);
|
add(key, &num, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void add_varint(u8 **key, size_t val)
|
void add_varint(u8 **arr, size_t val)
|
||||||
{
|
{
|
||||||
u8 vt[VARINT_MAX_LEN];
|
u8 vt[VARINT_MAX_LEN];
|
||||||
size_t vtlen;
|
size_t vtlen;
|
||||||
vtlen = varint_put(vt, val);
|
vtlen = varint_put(vt, val);
|
||||||
add(key, vt, vtlen);
|
tal_expand(arr, vt, vtlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define LIGHTNING_PROPRIETARY_PREFIX "lightning"
|
#define LIGHTNING_PROPRIETARY_PREFIX "lightning"
|
||||||
|
|||||||
@@ -17,6 +17,11 @@ struct bitcoin_signature;
|
|||||||
struct bitcoin_txid;
|
struct bitcoin_txid;
|
||||||
struct pubkey;
|
struct pubkey;
|
||||||
|
|
||||||
|
|
||||||
|
/* Utility we need for psbt stuffs;
|
||||||
|
* add the varint onto the given array */
|
||||||
|
void add_varint(u8 **arr, size_t val);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* create_psbt - Create a new psbt object
|
* create_psbt - Create a new psbt object
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user