mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-21 05:54:20 +01:00
lightningd: Add method to find a peer given its unique_id
Needed later
This commit is contained in:
@@ -42,6 +42,16 @@ struct peer *find_peer(struct lightningd_state *dstate, const struct pubkey *id)
|
||||
FIXME_IMPLEMENT();
|
||||
}
|
||||
|
||||
struct peer *find_peer_by_unique_id(struct lightningd *ld, u64 unique_id)
|
||||
{
|
||||
struct peer *peer;
|
||||
list_for_each(&ld->peers, peer, list) {
|
||||
if (peer->unique_id == unique_id)
|
||||
return peer;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void peer_debug(struct peer *peer, const char *fmt, ...);
|
||||
void peer_debug(struct peer *peer, const char *fmt, ...)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ struct lightningd {
|
||||
|
||||
void derive_peer_seed(struct lightningd *ld, struct privkey *peer_seed,
|
||||
const struct pubkey *peer_id);
|
||||
|
||||
struct peer *find_peer_by_unique_id(struct lightningd *ld, u64 unique_id);
|
||||
/* FIXME */
|
||||
static inline struct lightningd *
|
||||
ld_from_dstate(const struct lightningd_state *dstate)
|
||||
|
||||
Reference in New Issue
Block a user