Skip to content

Commit

Permalink
common/per_per_state: generalize lightningd/peer_comm Part 1
Browse files Browse the repository at this point in the history
Encapsulating the peer state was a win for lightningd; not surprisingly,
it's even more of a win for the other daemons, especially as we want
to add a little gossip information.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell committed Jun 4, 2019
1 parent f1b4b14 commit 38d2899
Show file tree
Hide file tree
Showing 45 changed files with 490 additions and 436 deletions.
1 change: 1 addition & 0 deletions channeld/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ CHANNELD_COMMON_OBJS := \
common/node_id.o \
common/peer_billboard.o \
common/peer_failed.o \
common/per_peer_state.o \
common/permute_tx.o \
common/ping.o \
common/pseudorand.o \
Expand Down
5 changes: 3 additions & 2 deletions channeld/channel_wire.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <common/cryptomsg.h>
#include <common/channel_config.h>
#include <common/derive_basepoints.h>
#include <common/per_peer_state.h>

# Begin! (passes gossipd-client fd)
channel_init,1000
Expand All @@ -16,7 +17,7 @@ channel_init,,feerate_per_kw,2*u32
channel_init,,feerate_min,u32
channel_init,,feerate_max,u32
channel_init,,first_commit_sig,struct bitcoin_signature
channel_init,,crypto_state,struct crypto_state
channel_init,,per_peer_state,struct per_peer_state
channel_init,,remote_fundingkey,struct pubkey
channel_init,,remote_basepoints,struct basepoints
channel_init,,remote_per_commit,struct pubkey
Expand Down Expand Up @@ -162,7 +163,7 @@ channel_got_shutdown,,scriptpubkey,scriptpubkey_len*u8

# Shutdown is complete, ready for closing negotiation. + peer_fd & gossip_fd.
channel_shutdown_complete,1025
channel_shutdown_complete,,crypto_state,struct crypto_state
channel_shutdown_complete,,per_peer_state,struct per_peer_state

# Re-enable commit timer.
channel_dev_reenable_commit,1026
Expand Down
Loading

0 comments on commit 38d2899

Please sign in to comment.