|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
LIGHTNINGD_SRC := \
|
|
|
|
lightningd/bitcoind.c \
|
|
|
|
lightningd/chaintopology.c \
|
|
|
|
lightningd/channel.c \
|
|
|
|
lightningd/channel_control.c \
|
|
|
|
lightningd/closing_control.c \
|
|
|
|
lightningd/coin_mvts.c \
|
|
|
|
lightningd/connect_control.c \
|
|
|
|
lightningd/onion_message.c \
|
|
|
|
lightningd/gossip_control.c \
|
|
|
|
lightningd/gossip_msg.c \
|
|
|
|
lightningd/hsm_control.c \
|
|
|
|
lightningd/htlc_end.c \
|
|
|
|
lightningd/htlc_set.c \
|
|
|
|
lightningd/invoice.c \
|
|
|
|
lightningd/io_loop_with_timers.c \
|
|
|
|
lightningd/json.c \
|
|
|
|
lightningd/jsonrpc.c \
|
|
|
|
lightningd/lightningd.c \
|
|
|
|
lightningd/log.c \
|
|
|
|
lightningd/log_status.c \
|
|
|
|
lightningd/memdump.c \
|
|
|
|
lightningd/notification.c \
|
|
|
|
lightningd/onchain_control.c \
|
|
|
|
lightningd/opening_common.c \
|
|
|
|
lightningd/opening_control.c \
|
|
|
|
lightningd/options.c \
|
|
|
|
lightningd/pay.c \
|
|
|
|
lightningd/peer_control.c \
|
|
|
|
lightningd/peer_htlcs.c \
|
|
|
|
lightningd/ping.c \
|
|
|
|
lightningd/plugin.c \
|
|
|
|
lightningd/plugin_control.c \
|
|
|
|
lightningd/plugin_hook.c \
|
|
|
|
lightningd/routehint.c \
|
|
|
|
lightningd/subd.c \
|
|
|
|
lightningd/watch.c
|
|
|
|
|
|
|
|
|
|
|
|
# Only build dualopend if experimental features is on
|
|
|
|
ifeq ($(EXPERIMENTAL_FEATURES),1)
|
|
|
|
LIGHTNINGD_SRC += lightningd/dual_open_control.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
LIGHTNINGD_SRC_NOHDR := \
|
|
|
|
lightningd/signmessage.c
|
|
|
|
|
|
|
|
LIGHTNINGD_HEADERS := \
|
|
|
|
$(LIGHTNINGD_SRC:.c=.h) \
|
|
|
|
lightningd/channel_state.h \
|
|
|
|
lightningd/gen_channel_state_names.h
|
|
|
|
|
|
|
|
LIGHTNINGD_OBJS := $(LIGHTNINGD_SRC:.c=.o) $(LIGHTNINGD_SRC_NOHDR:.c=.o)
|
|
|
|
$(LIGHTNINGD_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_CONTROL_HEADERS)
|
|
|
|
|
|
|
|
# Make sure these depend on everything.
|
|
|
|
ALL_C_SOURCES += $(LIGHTNINGD_SRC)
|
|
|
|
ALL_C_HEADERS += $(LIGHTNINGD_HEADERS)
|
|
|
|
ALL_PROGRAMS += lightningd/lightningd
|
|
|
|
|
|
|
|
# Common source we use.
|
|
|
|
LIGHTNINGD_COMMON_OBJS := \
|
|
|
|
common/addr.o \
|
|
|
|
common/amount.o \
|
|
|
|
common/base32.o \
|
|
|
|
common/base64.o \
|
|
|
|
common/bech32.o \
|
|
|
|
common/bech32_util.o \
|
|
|
|
common/bigsize.o \
|
|
|
|
common/bip32.o \
|
|
|
|
common/blinding.o \
|
|
|
|
common/bolt11.o \
|
|
|
|
common/channel_id.o \
|
|
|
|
common/channel_config.o \
|
|
|
|
common/coin_mvt.o \
|
|
|
|
common/configdir.o \
|
|
|
|
common/crypto_state.o \
|
|
|
|
common/daemon.o \
|
|
|
|
common/derive_basepoints.o \
|
|
|
|
common/ecdh_hsmd.o \
|
|
|
|
common/features.o \
|
|
|
|
common/fee_states.o \
|
|
|
|
common/peer_status_wiregen.o \
|
|
|
|
common/status_wiregen.o \
|
|
|
|
common/gossip_rcvd_filter.o \
|
|
|
|
common/hash_u5.o \
|
|
|
|
common/hmac.o \
|
|
|
|
common/htlc_state.o \
|
|
|
|
common/htlc_trim.o \
|
|
|
|
common/htlc_wire.o \
|
|
|
|
common/key_derive.o \
|
|
|
|
common/keyset.o \
|
|
|
|
common/io_lock.o \
|
|
|
|
common/json.o \
|
|
|
|
common/json_helpers.o \
|
|
|
|
common/json_stream.o \
|
|
|
|
common/json_tok.o \
|
|
|
|
common/memleak.o \
|
|
|
|
common/msg_queue.o \
|
common/node_id: new type.
Node ids are pubkeys, but we only use them as pubkeys for routing and checking
gossip messages. So we're packing and unpacking them constantly, and wasting
some space and time.
This introduces a new type, explicitly the SEC1 compressed encoding
(33 bytes). We ensure its validity when we load from the db, or get it
from JSON. We still use 'struct pubkey' for peer messages, which checks
validity.
Results from 5 runs, min-max(mean +/- stddev):
store_load_msec,vsz_kb,store_rewrite_sec,listnodes_sec,listchannels_sec,routing_sec,peer_write_all_sec
39475-39572(39518+/-36),2880732,41.150000-41.390000(41.298+/-0.085),2.260000-2.550000(2.336+/-0.11),44.390000-65.150000(58.648+/-7.5),32.740000-33.020000(32.89+/-0.093),44.130000-45.090000(44.566+/-0.32)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
6 years ago
|
|
|
common/node_id.o \
|
|
|
|
common/onion.o \
|
|
|
|
common/onionreply.o \
|
|
|
|
common/param.o \
|
|
|
|
common/penalty_base.o \
|
|
|
|
common/per_peer_state.o \
|
|
|
|
common/permute_tx.o \
|
|
|
|
common/pseudorand.o \
|
|
|
|
common/random_select.o \
|
|
|
|
common/setup.o \
|
|
|
|
common/sphinx.o \
|
|
|
|
common/status_wire.o \
|
|
|
|
common/timeout.o \
|
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o \
|
|
|
|
common/utxo.o \
|
|
|
|
common/version.o \
|
|
|
|
common/wallet.o \
|
gossipd: rewrite to do the handshake internally.
Now the flow is much simpler from a lightningd POV:
1. If we want to connect to a peer, just send gossipd `gossipctl_reach_peer`.
2. Every new peer, gossipd hands up to lightningd, with global/local features
and the peer fd and a gossip fd using `gossip_peer_connected`
3. If lightningd doesn't want it, it just hands the peerfd and global/local
features back to gossipd using `gossipctl_handle_peer`
4. If a peer sends a non-gossip msg (eg `open_channel`) the gossipd sends
it up using `gossip_peer_nongossip`.
5. If lightningd wants to fund a channel, it simply calls `release_channel`.
Notes:
* There's no more "unique_id": we use the peer id.
* For the moment, we don't ask gossipd when we're told to list peers, so
connected peers without a channel don't appear in the JSON getpeers API.
* We add a `gossipctl_peer_addrhint` for the moment, so you can connect to
a specific ip/port, but using other sources is a TODO.
* We now (correctly) only give up on reaching a peer after we exchange init
messages, which changes the test_disconnect case.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
7 years ago
|
|
|
common/wire_error.o \
|
|
|
|
common/wireaddr.o \
|
|
|
|
|
|
|
|
ifeq ($(EXPERIMENTAL_FEATURES),1)
|
|
|
|
LIGHTNINGD_COMMON_OBJS += common/psbt_open.o
|
|
|
|
endif
|
|
|
|
|
|
|
|
include wallet/Makefile
|
|
|
|
|
|
|
|
# All together in one convenient var
|
|
|
|
LIGHTNINGD_HEADERS = $(LIGHTNINGD_HEADERS_NOGEN) $(LIGHTNINGD_HEADERS_GEN) $(WALLET_LIB_HEADERS)
|
|
|
|
|
|
|
|
$(LIGHTNINGD_OBJS): $(LIGHTNINGD_HEADERS) $(WALLET_HDRS)
|
|
|
|
|
|
|
|
# Only the plugin component needs to depend on this header.
|
|
|
|
lightningd/plugin.o: plugins/gen_list_of_builtin_plugins.h
|
|
|
|
|
|
|
|
lightningd/gen_channel_state_names.h: lightningd/channel_state.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr lightningd/channel_state.h > $@
|
|
|
|
|
|
|
|
lightningd/lightningd: $(LIGHTNINGD_OBJS) $(WALLET_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(LIGHTNINGD_CONTROL_OBJS) $(HSMD_CLIENT_OBJS)
|
|
|
|
|
|
|
|
include lightningd/test/Makefile
|