MCPcopy Create free account
hub / github.com/ElementsProject/lightning / parse_maxhops

Function parse_maxhops

plugins/askrene/askrene.c:101–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101static bool parse_maxhops(const char *s, u32 *v)
102{
103 if(!is_maxhops(s))
104 return false;
105
106 const char *num = s + strlen("maxhops=");
107 char *end;
108 unsigned long n;
109
110 if (*num < '0' || *num > '9')
111 return false;
112 errno = 0;
113 n = strtoul(num, &end, 10);
114 if (*end != '\0' || errno == ERANGE || n > UINT32_MAX)
115 return false;
116 *v = n;
117 return true;
118}
119
120static u32 extract_maxhops(const char ***layers, u32 default_maxhops)
121{

Callers 2

extract_maxhopsFunction · 0.85
param_layer_namesFunction · 0.85

Calls 1

is_maxhopsFunction · 0.85

Tested by

no test coverage detected