2016-01-21 20:11:48 +00:00
|
|
|
#ifndef LIGHTNING_DAEMON_PEER_H
|
|
|
|
#define LIGHTNING_DAEMON_PEER_H
|
|
|
|
#include "config.h"
|
2016-01-21 20:11:49 +00:00
|
|
|
#include "bitcoin/pubkey.h"
|
2016-01-21 20:11:48 +00:00
|
|
|
#include "lightning.pb-c.h"
|
2016-01-21 20:11:48 +00:00
|
|
|
#include "netaddr.h"
|
2016-01-21 20:11:48 +00:00
|
|
|
#include <ccan/list/list.h>
|
|
|
|
|
|
|
|
struct peer {
|
|
|
|
/* state->peers list */
|
|
|
|
struct list_node list;
|
|
|
|
|
|
|
|
/* Global state. */
|
|
|
|
struct lightningd_state *state;
|
|
|
|
|
|
|
|
/* The other end's address. */
|
|
|
|
struct netaddr addr;
|
|
|
|
|
2016-01-21 20:11:48 +00:00
|
|
|
/* Their ID. */
|
|
|
|
struct pubkey id;
|
|
|
|
|
2016-01-21 20:11:48 +00:00
|
|
|
/* Current received packet. */
|
|
|
|
Pkt *inpkt;
|
|
|
|
|
|
|
|
/* Current ongoing packetflow */
|
|
|
|
struct io_data *io_data;
|
|
|
|
|
2016-01-21 20:11:48 +00:00
|
|
|
/* What happened. */
|
|
|
|
struct log *log;
|
2016-01-21 20:11:49 +00:00
|
|
|
|
|
|
|
/* Things we're watching for (see watches.c) */
|
|
|
|
struct list_head watches;
|
2016-01-21 20:11:48 +00:00
|
|
|
|
|
|
|
/* Keys for transactions with this peer. */
|
2016-01-21 20:11:49 +00:00
|
|
|
struct pubkey their_commitkey, their_finalkey;
|
|
|
|
struct pubkey our_commitkey, our_finalkey;
|
2016-01-21 20:11:48 +00:00
|
|
|
struct peer_secrets *secrets;
|
2016-01-21 20:11:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void setup_listeners(struct lightningd_state *state, unsigned int portnum);
|
|
|
|
|
|
|
|
#endif /* LIGHTNING_DAEMON_PEER_H */
|