mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
dev-forget-channel: accept passing in channel_id
This patch adds a channel_id parameter to allow for specifying channels that are lacking a short_channel_id. Useful in the case where a peer has 1) multiple channels (ONCHAIN etc) and 2) a channel where the funding transaction hasn't been broadcast/mined.
This commit is contained in:
committed by
Rusty Russell
parent
cbfa045f91
commit
af4ffe5fcd
@@ -1,5 +1,6 @@
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <bitcoin/short_channel_id.h>
|
||||
#include <ccan/ccan/str/hex/hex.h>
|
||||
#include <common/amount.h>
|
||||
#include <common/json_helpers.h>
|
||||
#include <common/node_id.h>
|
||||
@@ -84,6 +85,13 @@ bool json_to_txid(const char *buffer, const jsmntok_t *tok,
|
||||
tok->end - tok->start, txid);
|
||||
}
|
||||
|
||||
bool json_to_channel_id(const char *buffer, const jsmntok_t *tok,
|
||||
struct channel_id *cid)
|
||||
{
|
||||
return hex_decode(buffer + tok->start, tok->end - tok->start,
|
||||
cid, sizeof(*cid));
|
||||
}
|
||||
|
||||
bool split_tok(const char *buffer, const jsmntok_t *tok,
|
||||
char split,
|
||||
jsmntok_t *a,
|
||||
|
||||
Reference in New Issue
Block a user