wireaddr: moves wireaddr_arr_contains to wireaddr.h
...So it can be reused somewhere else Changelog-None
This commit is contained in:
parent
de9bc172de
commit
55cf413fc3
|
@ -899,3 +899,12 @@ int wireaddr_cmp_type(const struct wireaddr *a,
|
||||||
return tal_bytelen(a_wire) - tal_bytelen(b_wire);
|
return tal_bytelen(a_wire) - tal_bytelen(b_wire);
|
||||||
return cmp;
|
return cmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool wireaddr_arr_contains(const struct wireaddr *was,
|
||||||
|
const struct wireaddr *wa)
|
||||||
|
{
|
||||||
|
for (size_t i = 0; i < tal_count(was); i++)
|
||||||
|
if (wireaddr_eq(&was[i], wa))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
|
@ -197,4 +197,7 @@ struct wireaddr *fromwire_wireaddr_array(const tal_t *ctx, const u8 *ser);
|
||||||
int wireaddr_cmp_type(const struct wireaddr *a,
|
int wireaddr_cmp_type(const struct wireaddr *a,
|
||||||
const struct wireaddr *b, void *unused);
|
const struct wireaddr *b, void *unused);
|
||||||
|
|
||||||
|
bool wireaddr_arr_contains(const struct wireaddr *was,
|
||||||
|
const struct wireaddr *wa);
|
||||||
|
|
||||||
#endif /* LIGHTNING_COMMON_WIREADDR_H */
|
#endif /* LIGHTNING_COMMON_WIREADDR_H */
|
||||||
|
|
|
@ -20,15 +20,6 @@
|
||||||
#include <hsmd/hsmd_wiregen.h>
|
#include <hsmd/hsmd_wiregen.h>
|
||||||
#include <wire/wire_sync.h>
|
#include <wire/wire_sync.h>
|
||||||
|
|
||||||
static bool wireaddr_arr_contains(const struct wireaddr *was,
|
|
||||||
const struct wireaddr *wa)
|
|
||||||
{
|
|
||||||
for (size_t i = 0; i < tal_count(was); i++)
|
|
||||||
if (wireaddr_eq(&was[i], wa))
|
|
||||||
return true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create a node_announcement with the given signature. It may be NULL in the
|
/* Create a node_announcement with the given signature. It may be NULL in the
|
||||||
* case we need to create a provisional announcement for the HSM to sign.
|
* case we need to create a provisional announcement for the HSM to sign.
|
||||||
* This is called twice: once with the dummy signature to get it signed and a
|
* This is called twice: once with the dummy signature to get it signed and a
|
||||||
|
|
Loading…
Reference in New Issue