mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 07:34:24 +01:00
routing: Reading the channel_id from routes passed in from JSONRPC
This commit is contained in:
@@ -477,6 +477,25 @@ static bool get_slash_u32(const char **arg, u32 *v)
|
||||
return (endp == *arg);
|
||||
}
|
||||
|
||||
bool short_channel_id_from_str(const char *str, size_t strlen,
|
||||
struct short_channel_id *dst)
|
||||
{
|
||||
u32 blocknum, txnum;
|
||||
u16 outnum;
|
||||
int matches;
|
||||
|
||||
char buf[strlen + 1];
|
||||
memcpy(buf, str, strlen);
|
||||
buf[strlen] = 0;
|
||||
|
||||
matches = sscanf(buf, "%u:%u:%hu", &blocknum, &txnum, &outnum);
|
||||
dst->blocknum = blocknum;
|
||||
dst->txnum = txnum;
|
||||
dst->outnum = outnum;
|
||||
return matches == 3;
|
||||
}
|
||||
|
||||
|
||||
/* srcid/dstid/base/var/delay/minblocks */
|
||||
char *opt_add_route(const char *arg, struct lightningd_state *dstate)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user