mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
check-bolt: allow references to BOLT #0.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
1ecd687eec
commit
46bdd4badb
@@ -237,14 +237,15 @@ static struct bolt_file *find_bolt(const char *bolt_prefix,
|
|||||||
{
|
{
|
||||||
size_t i, n = tal_count(bolts);
|
size_t i, n = tal_count(bolts);
|
||||||
int boltnum;
|
int boltnum;
|
||||||
|
char *endp;
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (streq(bolts[i].prefix, bolt_prefix))
|
if (streq(bolts[i].prefix, bolt_prefix))
|
||||||
return bolts+i;
|
return bolts+i;
|
||||||
|
|
||||||
/* Now search for numerical match. */
|
/* Now search for numerical match. */
|
||||||
boltnum = atoi(bolt_prefix);
|
boltnum = strtol(bolt_prefix, &endp, 10);
|
||||||
if (boltnum) {
|
if (endp != bolt_prefix && *endp == 0) {
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
if (atoi(bolts[i].prefix) == boltnum)
|
if (atoi(bolts[i].prefix) == boltnum)
|
||||||
return bolts+i;
|
return bolts+i;
|
||||||
|
|||||||
Reference in New Issue
Block a user