mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-10 08:34:19 +01:00
common: move some files out of lightningd/
Basically all files shared by different daemons. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
8375857116
commit
a37c165cb9
2
Makefile
2
Makefile
@@ -279,7 +279,7 @@ libsecp256k1.% libwallycore.%: libwally-core/src/secp256k1/libsecp256k1.la libwa
|
||||
libwally-core/src/libwallycore.% libwally-core/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS)
|
||||
cd libwally-core && ./tools/autogen.sh && ./configure CC="$(CC)" --enable-static=yes --enable-shared=no --libdir=`pwd`/.. && $(MAKE)
|
||||
|
||||
$(TEST_PROGRAMS): % : %.o $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) lightningd/sphinx.o common/utils.o libwallycore.a libsecp256k1.a libsodium.a
|
||||
$(TEST_PROGRAMS): % : %.o $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) common/sphinx.o common/utils.o libwallycore.a libsecp256k1.a libsodium.a
|
||||
|
||||
ccan/config.h: ccan/tools/configurator/configurator
|
||||
if $< > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include "bitcoin/pullpush.c"
|
||||
#include "bitcoin/tx.c"
|
||||
#include "bitcoin/shadouble.c"
|
||||
#include "bitcoin/varint.c"
|
||||
#include "utils.c"
|
||||
#include <assert.h>
|
||||
#include <bitcoin/pullpush.c>
|
||||
#include <bitcoin/shadouble.c>
|
||||
#include <bitcoin/tx.c>
|
||||
#include <bitcoin/varint.c>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <common/utils.c>
|
||||
|
||||
const char extended_tx[] = "02000000000101b5bef485c41d0d1f58d1e8a561924ece5c476d86cff063ea10c8df06136eb31d00000000171600144aa38e396e1394fb45cbf83f48d1464fbc9f498fffffffff0140330f000000000017a9140580ba016669d3efaf09a0b2ec3954469ea2bf038702483045022100f2abf9e9cf238c66533af93f23937eae8ac01fb6f105a00ab71dbefb9637dc9502205c1ac745829b3f6889607961f5d817dfa0c8f52bdda12e837c4f7b162f6db8a701210204096eb817f7efb414ef4d3d8be39dd04374256d3b054a322d4a6ee22736d03b00000000";
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ $(LIGHTNING_CLI_OBJS) $(JSMN_OBJS): $(JSMN_HEADERS) $(COMMON_HEADERS) $(CCAN_HEA
|
||||
|
||||
cli/lightning-cli: $(LIGHTNING_CLI_OBJS) $(LIGHTNING_CLI_COMMON_OBJS) $(JSMN_OBJS) $(CCAN_OBJS)
|
||||
|
||||
check-source: $(LIGHTNING_CLI_SRC:%=check-src-include-order/%)
|
||||
|
||||
clean: lightning-cli-clean
|
||||
|
||||
lightning-cli-clean:
|
||||
|
||||
@@ -1,18 +1,34 @@
|
||||
COMMON_SRC := \
|
||||
common/bip32.c \
|
||||
common/channel_config.c \
|
||||
common/close_tx.c \
|
||||
common/configdir.c \
|
||||
common/crypto_sync.c \
|
||||
common/cryptomsg.c \
|
||||
common/daemon_conn.c \
|
||||
common/debug.c \
|
||||
common/derive_basepoints.c \
|
||||
common/dev_disconnect.c \
|
||||
common/funding_tx.c \
|
||||
common/htlc_tx.c \
|
||||
common/htlc_state.c \
|
||||
common/htlc_tx.c \
|
||||
common/htlc_wire.c \
|
||||
common/initial_channel.c \
|
||||
common/initial_commit_tx.c \
|
||||
common/json.c \
|
||||
common/key_derive.c \
|
||||
common/keyset.c \
|
||||
common/msg_queue.c \
|
||||
common/peer_failed.c \
|
||||
common/permute_tx.c \
|
||||
common/ping.c \
|
||||
common/pseudorand.c \
|
||||
common/sphinx.c \
|
||||
common/status.c \
|
||||
common/timeout.c \
|
||||
common/type_to_string.c \
|
||||
common/utils.c \
|
||||
common/utxo.c \
|
||||
common/version.c \
|
||||
common/withdraw_tx.c
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lightningd/bip32.h>
|
||||
#include <common/bip32.h>
|
||||
#include <wally_bip32.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <common/channel_config.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
void towire_channel_config(u8 **pptr, const struct channel_config *config)
|
||||
@@ -1,11 +1,11 @@
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <wire/wire.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <sodium/crypto_aead_chacha20poly1305.h>
|
||||
#include <wire/peer_wire.h>
|
||||
#include <wire/wire.h>
|
||||
@@ -61,11 +61,13 @@ static void maybe_rotate_key(u64 *n, struct secret *k, struct secret *ck)
|
||||
* * `ck = ck'`
|
||||
*/
|
||||
hkdf_two_keys(&new_ck, &new_k, ck, k);
|
||||
#ifdef SUPERVERBOSE
|
||||
status_trace("# 0x%s, 0x%s = HKDF(0x%s, 0x%s)",
|
||||
tal_hexstr(trc, &new_ck, sizeof(new_ck)),
|
||||
tal_hexstr(trc, &new_k, sizeof(new_k)),
|
||||
tal_hexstr(trc, ck, sizeof(*ck)),
|
||||
tal_hexstr(trc, k, sizeof(*k)));
|
||||
#endif
|
||||
*ck = new_ck;
|
||||
*k = new_k;
|
||||
*n = 0;
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <ccan/fdpass/fdpass.h>
|
||||
#include <ccan/io/fdpass/fdpass.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <lightningd/daemon_conn.h>
|
||||
#include <common/daemon_conn.h>
|
||||
#include <wire/wire_io.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "config.h"
|
||||
#include <ccan/io/io.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <lightningd/msg_queue.h>
|
||||
#include <common/msg_queue.h>
|
||||
|
||||
struct daemon_conn {
|
||||
/* Context to tallocate all things from, possibly the
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <ccan/str/str.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <assert.h>
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/str/str.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <common/status.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
@@ -4,9 +4,9 @@
|
||||
#include <bitcoin/script.h>
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/ptrint/ptrint.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/permute_tx.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/utxo.h>
|
||||
|
||||
#ifndef SUPERVERBOSE
|
||||
#define SUPERVERBOSE(...)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <bitcoin/script.h>
|
||||
#include <bitcoin/tx.h>
|
||||
#include <common/htlc_tx.h>
|
||||
#include <lightningd/keyset.h>
|
||||
#include <common/keyset.h>
|
||||
|
||||
static struct bitcoin_tx *htlc_tx(const tal_t *ctx,
|
||||
const struct sha256_double *commit_txid,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/crypto/shachain/shachain.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/htlc_wire.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
/* FIXME: We could adapt tools/generate-wire.py to generate structures
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/htlc.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <wire/gen_onion_wire.h>
|
||||
|
||||
struct bitcoin_tx;
|
||||
@@ -3,9 +3,9 @@
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/initial_channel.h>
|
||||
#include <common/initial_commit_tx.h>
|
||||
#include <common/keyset.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/keyset.h>
|
||||
|
||||
struct channel *new_initial_channel(const tal_t *ctx,
|
||||
const struct sha256_double *funding_txid,
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include <bitcoin/shadouble.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <common/channel_config.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/htlc.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
struct signature;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
#include <common/initial_commit_tx.h>
|
||||
#include <common/keyset.h>
|
||||
#include <common/permute_tx.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/keyset.h>
|
||||
|
||||
/* BOLT #3:
|
||||
*
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <ccan/crypto/sha256/sha256.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <wally_bip32.h>
|
||||
|
||||
/* BOLT #3:
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/keyset.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/keyset.h>
|
||||
|
||||
bool derive_keyset(const struct pubkey *per_commitment_point,
|
||||
const struct pubkey *self_payment_basepoint,
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <assert.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <lightningd/msg_queue.h>
|
||||
#include <common/msg_queue.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
void msg_queue_init(struct msg_queue *q, const tal_t *ctx)
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <ccan/io/io.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/peer_failed.h>
|
||||
#include <common/status.h>
|
||||
#include <fcntl.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/peer_failed.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <stdarg.h>
|
||||
#include <unistd.h>
|
||||
#include <wire/gen_peer_wire.h>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lightningd/ping.h>
|
||||
#include <common/ping.h>
|
||||
#include <wire/gen_peer_wire.h>
|
||||
|
||||
bool check_ping_make_pong(const tal_t *ctx, const u8 *ping, u8 **pong)
|
||||
@@ -1,9 +1,9 @@
|
||||
#include "lightningd/sphinx.h"
|
||||
#include <assert.h>
|
||||
|
||||
#include <ccan/crypto/ripemd160/ripemd160.h>
|
||||
#include <ccan/crypto/sha256/sha256.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <common/utils.h>
|
||||
|
||||
#include <err.h>
|
||||
@@ -6,9 +6,9 @@
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/daemon_conn.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/daemon_conn.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <stdarg.h>
|
||||
#include <wire/wire.h>
|
||||
#include <wire/wire_sync.h>
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/utxo.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
void towire_utxo(u8 **pptr, const struct utxo *utxo)
|
||||
@@ -2,9 +2,9 @@
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <bitcoin/script.h>
|
||||
#include <ccan/ptrint/ptrint.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/permute_tx.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/utxo.h>
|
||||
#include <wally_bip32.h>
|
||||
|
||||
struct bitcoin_tx *withdraw_tx(const tal_t *ctx,
|
||||
|
||||
@@ -12,48 +12,34 @@ default: lightningd-all
|
||||
|
||||
# Common source we use.
|
||||
LIGHTNINGD_COMMON_OBJS := \
|
||||
common/bip32.o \
|
||||
common/channel_config.o \
|
||||
common/configdir.o \
|
||||
common/cryptomsg.o \
|
||||
common/derive_basepoints.o \
|
||||
common/funding_tx.o \
|
||||
common/htlc_state.o \
|
||||
common/htlc_wire.o \
|
||||
common/key_derive.o \
|
||||
common/json.o \
|
||||
common/msg_queue.o \
|
||||
common/permute_tx.o \
|
||||
common/pseudorand.o \
|
||||
common/sphinx.o \
|
||||
common/timeout.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/utxo.o \
|
||||
common/version.o \
|
||||
common/withdraw_tx.o
|
||||
|
||||
# FIXME: put in a library so we don't link all of them.
|
||||
LIGHTNINGD_LIB_SRC := \
|
||||
lightningd/bip32.c \
|
||||
lightningd/channel_config.c \
|
||||
lightningd/cryptomsg.c \
|
||||
lightningd/crypto_sync.c \
|
||||
lightningd/debug.c \
|
||||
lightningd/daemon_conn.c \
|
||||
lightningd/dev_disconnect.c \
|
||||
lightningd/gossip_msg.c \
|
||||
lightningd/htlc_wire.c \
|
||||
lightningd/key_derive.c \
|
||||
lightningd/keyset.c \
|
||||
lightningd/msg_queue.c \
|
||||
lightningd/peer_failed.c \
|
||||
lightningd/ping.c \
|
||||
lightningd/sphinx.c \
|
||||
lightningd/status.c \
|
||||
lightningd/utxo.c
|
||||
|
||||
LIGHTNINGD_LIB_OBJS := $(LIGHTNINGD_LIB_SRC:.c=.o)
|
||||
LIGHTNINGD_LIB_HEADERS := $(LIGHTNINGD_LIB_SRC:.c=.h)
|
||||
|
||||
LIGHTNINGD_SRC := \
|
||||
lightningd/bitcoind.c \
|
||||
lightningd/build_utxos.c \
|
||||
lightningd/chaintopology.c \
|
||||
lightningd/dns.c \
|
||||
lightningd/gossip_control.c \
|
||||
lightningd/gossip_msg.c \
|
||||
lightningd/hsm_control.c \
|
||||
lightningd/htlc_end.c \
|
||||
lightningd/invoice.c \
|
||||
@@ -83,7 +69,6 @@ LIGHTNINGD_JSMN_HEADERS := daemon/jsmn/jsmn.h
|
||||
LIGHTNINGD_HEADERS_NOGEN = \
|
||||
$(LIGHTNINGD_SRC:.c=.h) \
|
||||
lightningd/peer_state.h \
|
||||
$(LIGHTNINGD_LIB_HEADERS) \
|
||||
$(WIRE_HEADERS) \
|
||||
$(BITCOIN_HEADERS) \
|
||||
$(COMMON_HEADERS_NOGEN) \
|
||||
@@ -117,28 +102,26 @@ include lightningd/channel/Makefile
|
||||
include lightningd/closing/Makefile
|
||||
include lightningd/onchain/Makefile
|
||||
|
||||
$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
$(LIGHTNINGD_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
|
||||
lightningd/gen_peer_state_names.h: lightningd/peer_state.h ccan/ccan/cdump/tools/cdump-enumstr
|
||||
ccan/ccan/cdump/tools/cdump-enumstr lightningd/peer_state.h > $@
|
||||
|
||||
check-source: $(LIGHTNINGD_SRC:%=check-src-include-order/%) $(LIGHTNINGD_SRC_NOHDR:%=check-src-include-order/%)
|
||||
check-source: $(LIGHTNINGD_LIB_SRC:%=check-src-include-order/%)
|
||||
check-source: $(LIGHTNINGD_CLI_SRC:%=check-src-include-order/%)
|
||||
check-source: $(LIGHTNINGD_HEADERS_NOGEN:%=check-hdr-include-order/%)
|
||||
check-source-bolt: $(LIGHTNINGD_SRC:%=bolt-check/%) $(LIGHTNINGD_LIB_SRC:%=bolt-check/%) $(LIGHTNINGD_HEADERS_NOGEN:%=bolt-check/%)
|
||||
check-source-bolt: $(LIGHTNINGD_SRC:%=bolt-check/%) $(LIGHTNINGD_HEADERS_NOGEN:%=bolt-check/%)
|
||||
|
||||
check-whitespace: $(LIGHTNINGD_SRC:%=check-whitespace/%) $(LIGHTNINGD_HEADERS_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_LIB_SRC:%=check-whitespace/%) $(LIGHTNINGD_LIB_HEADERS:%=check-whitespace/%)
|
||||
check-whitespace: $(LIGHTNINGD_SRC:%=check-whitespace/%) $(LIGHTNINGD_HEADERS_NOGEN:%=check-whitespace/%)
|
||||
|
||||
check-makefile: check-lightningd-makefile
|
||||
check-lightningd-makefile:
|
||||
@for f in lightningd/*.h lightningd/*/*.h; do if ! echo $(LIGHTNINGD_HEADERS_NOGEN) $(LIGHTNINGD_HEADERS_GEN) "" | grep -q "$$f "; then echo $$f not mentioned in LIGHTNINGD_HEADERS_NOGEN or LIGHTNINGD_HEADERS_GEN >&2; exit 1; fi; done
|
||||
|
||||
lightningd/lightningd: $(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CONTROL_OBJS) $(LIGHTNINGD_HANDSHAKE_CONTROL_OBJS) $(LIGHTNINGD_GOSSIP_CONTROL_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_OPENING_CONTROL_OBJS) $(LIGHTNINGD_CHANNEL_CONTROL_OBJS) $(LIGHTNINGD_CLOSING_CONTROL_OBJS) $(LIGHTNINGD_ONCHAIN_CONTROL_OBJS) $(WALLET_LIB_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd: $(LIGHTNINGD_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CONTROL_OBJS) $(LIGHTNINGD_HANDSHAKE_CONTROL_OBJS) $(LIGHTNINGD_GOSSIP_CONTROL_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_OPENING_CONTROL_OBJS) $(LIGHTNINGD_CHANNEL_CONTROL_OBJS) $(LIGHTNINGD_CLOSING_CONTROL_OBJS) $(LIGHTNINGD_ONCHAIN_CONTROL_OBJS) $(WALLET_LIB_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
|
||||
clean: lightningd-clean
|
||||
|
||||
lightningd-clean:
|
||||
$(RM) $(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(LIGHTNINGD_BINS)
|
||||
$(RM) $(LIGHTNINGD_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(LIGHTNINGD_BINS)
|
||||
|
||||
include lightningd/test/Makefile
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H
|
||||
#define LIGHTNING_LIGHTNINGD_BUILD_UTXOS_H
|
||||
#include "config.h"
|
||||
#include <common/utxo.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/utxo.h>
|
||||
|
||||
/* Reserves UTXOs to build tx which pays this amount; returns NULL if
|
||||
* impossible. *change_satoshis 0 if no change needed. */
|
||||
|
||||
@@ -27,13 +27,27 @@ LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o)
|
||||
|
||||
# Common source we use.
|
||||
CHANNELD_COMMON_OBJS := \
|
||||
common/channel_config.o \
|
||||
common/crypto_sync.o \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/derive_basepoints.o \
|
||||
common/dev_disconnect.o \
|
||||
common/htlc_state.o \
|
||||
common/htlc_tx.o \
|
||||
common/htlc_wire.o \
|
||||
common/initial_channel.o \
|
||||
common/initial_commit_tx.o \
|
||||
common/keyset.o \
|
||||
common/key_derive.o \
|
||||
common/msg_queue.o \
|
||||
common/ping.o \
|
||||
common/peer_failed.o \
|
||||
common/permute_tx.o \
|
||||
common/pseudorand.o \
|
||||
common/sphinx.o \
|
||||
common/status.o \
|
||||
common/timeout.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
@@ -62,7 +76,7 @@ lightningd/channel/gen_channel_wire.c: $(WIRE_GEN) lightningd/channel/channel_wi
|
||||
|
||||
LIGHTNINGD_CHANNEL_OBJS := $(LIGHTNINGD_CHANNEL_SRC:.c=.o) $(LIGHTNINGD_CHANNEL_GEN_SRC:.c=.o)
|
||||
|
||||
lightningd/lightningd_channel: $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_CHANNEL_OBJS) $(WIRE_ONION_OBJS) $(CHANNELD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_channel: $(LIGHTNINGD_CHANNEL_OBJS) $(WIRE_ONION_OBJS) $(CHANNELD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
check-source: $(LIGHTNINGD_CHANNEL_SRC_NOGEN:%=check-src-include-order/%)
|
||||
|
||||
@@ -11,8 +11,18 @@
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <ccan/time/time.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/daemon_conn.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/htlc_tx.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/msg_queue.h>
|
||||
#include <common/peer_failed.h>
|
||||
#include <common/ping.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <common/status.h>
|
||||
#include <common/timeout.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/version.h>
|
||||
@@ -21,18 +31,8 @@
|
||||
#include <lightningd/channel/commit_tx.h>
|
||||
#include <lightningd/channel/full_channel.h>
|
||||
#include <lightningd/channel/gen_channel_wire.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/daemon_conn.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/gossip/routing.h>
|
||||
#include <lightningd/hsm/gen_hsm_client_wire.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/msg_queue.h>
|
||||
#include <lightningd/peer_failed.h>
|
||||
#include <lightningd/ping.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <secp256k1.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -17,8 +17,8 @@ channel_peer_bad_message,,msg,len*u8
|
||||
# Received and sent funding_locked
|
||||
channel_normal_operation,1001
|
||||
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/channel_config.h>
|
||||
|
||||
# Begin! (passes gossipd-client fd)
|
||||
channel_init,1
|
||||
@@ -161,7 +161,7 @@ channel_got_commitsig,,tx,struct bitcoin_tx
|
||||
# Wait for reply, to make sure it's on disk before we send revocation.
|
||||
channel_got_commitsig_reply,121
|
||||
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/htlc_wire.h>
|
||||
|
||||
channel_got_revoke,22
|
||||
channel_got_revoke,,revokenum,u64
|
||||
|
||||
|
@@ -2,10 +2,10 @@
|
||||
#include <bitcoin/tx.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
#include <common/htlc_tx.h>
|
||||
#include <common/keyset.h>
|
||||
#include <common/permute_tx.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/channel/commit_tx.h>
|
||||
#include <lightningd/keyset.h>
|
||||
|
||||
#ifndef SUPERVERBOSE
|
||||
#define SUPERVERBOSE(...)
|
||||
|
||||
@@ -6,17 +6,17 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/channel_config.h>
|
||||
#include <common/htlc.h>
|
||||
#include <common/htlc_tx.h>
|
||||
#include <common/htlc_wire.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/keyset.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/channel/commit_tx.h>
|
||||
#include <lightningd/channel/full_channel.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/keyset.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <string.h>
|
||||
|
||||
struct channel *new_channel(const tal_t *ctx,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#define LIGHTNING_LIGHTNINGD_CHANNEL_H
|
||||
#include "config.h"
|
||||
#include <common/initial_channel.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <lightningd/channel/channeld_htlc.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
|
||||
/**
|
||||
* new_channel: Given initial fees and funding, what is initial state?
|
||||
|
||||
@@ -38,8 +38,16 @@ $(LIGHTNINGD_CLOSING_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
# Common source we use.
|
||||
CLOSINGD_COMMON_OBJS := \
|
||||
common/close_tx.o \
|
||||
common/crypto_sync.o \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/dev_disconnect.o \
|
||||
common/derive_basepoints.o \
|
||||
common/htlc_wire.o \
|
||||
common/msg_queue.o \
|
||||
common/permute_tx.o \
|
||||
common/status.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/version.o
|
||||
@@ -52,7 +60,7 @@ lightningd/closing/gen_closing_wire.c: $(WIRE_GEN) lightningd/closing/closing_wi
|
||||
|
||||
LIGHTNINGD_CLOSING_OBJS := $(LIGHTNINGD_CLOSING_SRC:.c=.o) $(LIGHTNINGD_CLOSING_GEN_SRC:.c=.o)
|
||||
|
||||
lightningd/lightningd_closing: $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_CLOSING_OBJS) $(WIRE_ONION_OBJS) $(CLOSINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_closing: $(LIGHTNINGD_CLOSING_OBJS) $(WIRE_ONION_OBJS) $(CLOSINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
check-source: $(LIGHTNINGD_CLOSING_SRC_NOGEN:%=check-src-include-order/%)
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
#include <bitcoin/script.h>
|
||||
#include <common/close_tx.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/htlc.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/version.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/closing/gen_closing_wire.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <wire/peer_wire.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
|
||||
@@ -14,8 +14,8 @@ closing_negotiation_error,0x8013
|
||||
closing_negotiation_error,,len,u16
|
||||
closing_negotiation_error,,msg,len*u8
|
||||
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/htlc_wire.h>
|
||||
# Begin! (passes peer fd, gossipd-client fd)
|
||||
closing_init,1
|
||||
closing_init,,crypto_state,struct crypto_state
|
||||
|
||||
|
@@ -1,3 +1,4 @@
|
||||
#include <common/sphinx.h>
|
||||
#include <common/utils.h>
|
||||
#include <lightningd/channel/gen_channel_wire.h>
|
||||
#include <lightningd/gossip/gen_gossip_wire.h>
|
||||
@@ -6,7 +7,6 @@
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/peer_control.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <lightningd/subd.h>
|
||||
|
||||
static bool ping_reply(struct subd *subd, const u8 *msg, const int *fds,
|
||||
|
||||
@@ -28,11 +28,20 @@ LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_GOSSIP_HEADERS)
|
||||
|
||||
# Common source we use.
|
||||
GOSSIPD_COMMON_OBJS := \
|
||||
common/crypto_sync.o \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/dev_disconnect.o \
|
||||
common/msg_queue.o \
|
||||
common/ping.o \
|
||||
common/pseudorand.o \
|
||||
common/status.o \
|
||||
common/timeout.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/version.o
|
||||
common/version.o \
|
||||
lightningd/gossip_msg.o
|
||||
|
||||
$(LIGHTNINGD_GOSSIP_OBJS) $(LIGHTNINGD_GOSSIP_CLIENT_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
|
||||
@@ -40,7 +49,7 @@ $(LIGHTNINGD_GOSSIP_CONTROL_OBJS) : $(LIGHTNINGD_GOSSIP_CONTROL_HEADERS)
|
||||
|
||||
lightningd/gossip-all: lightningd/lightningd_gossip $(LIGHTNINGD_GOSSIP_CLIENT_OBJS)
|
||||
|
||||
lightningd/lightningd_gossip: $(LIGHTNINGD_GOSSIP_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_gossip: $(LIGHTNINGD_GOSSIP_OBJS) $(GOSSIPD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
lightningd/gossip/gen_gossip_wire.h: $(WIRE_GEN) lightningd/gossip/gossip_wire.csv
|
||||
|
||||
@@ -10,6 +10,11 @@
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <ccan/timer/timer.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/daemon_conn.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/ping.h>
|
||||
#include <common/status.h>
|
||||
#include <common/timeout.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
@@ -17,15 +22,10 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/daemon_conn.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/gossip/broadcast.h>
|
||||
#include <lightningd/gossip/gen_gossip_wire.h>
|
||||
#include <lightningd/gossip/routing.h>
|
||||
#include <lightningd/gossip_msg.h>
|
||||
#include <lightningd/ping.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <secp256k1_ecdh.h>
|
||||
#include <sodium/randombytes.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
@@ -18,7 +18,7 @@ gossipstatus_peer_failed,,unique_id,8
|
||||
gossipstatus_peer_failed,,len,2
|
||||
gossipstatus_peer_failed,,err,len*u8
|
||||
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <common/cryptomsg.h>
|
||||
|
||||
# Initialize the gossip daemon
|
||||
gossipctl_init,0
|
||||
|
||||
|
@@ -8,10 +8,9 @@
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/overflows.h>
|
||||
#include <common/pseudorand.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <wire/gen_peer_wire.h>
|
||||
|
||||
/* 365.25 * 24 * 60 / 10 */
|
||||
@@ -463,48 +462,6 @@ find_route(const tal_t *ctx, struct routing_state *rstate,
|
||||
return first_conn;
|
||||
}
|
||||
|
||||
static bool get_slash_u32(const char **arg, u32 *v)
|
||||
{
|
||||
size_t len;
|
||||
char *endp;
|
||||
|
||||
if (**arg != '/')
|
||||
return false;
|
||||
(*arg)++;
|
||||
len = strcspn(*arg, "/");
|
||||
*v = strtoul(*arg, &endp, 10);
|
||||
(*arg) += len;
|
||||
return (endp == *arg);
|
||||
}
|
||||
|
||||
/* srcid/dstid/base/var/delay/minblocks */
|
||||
char *opt_add_route(const char *arg, struct lightningd_state *dstate)
|
||||
{
|
||||
size_t len;
|
||||
struct pubkey src, dst;
|
||||
u32 base, var, delay, minblocks;
|
||||
|
||||
len = strcspn(arg, "/");
|
||||
if (!pubkey_from_hexstr(arg, len, &src))
|
||||
return "Bad src pubkey";
|
||||
arg += len + 1;
|
||||
len = strcspn(arg, "/");
|
||||
if (!pubkey_from_hexstr(arg, len, &dst))
|
||||
return "Bad dst pubkey";
|
||||
arg += len;
|
||||
|
||||
if (!get_slash_u32(&arg, &base)
|
||||
|| !get_slash_u32(&arg, &var)
|
||||
|| !get_slash_u32(&arg, &delay)
|
||||
|| !get_slash_u32(&arg, &minblocks))
|
||||
return "Bad base/var/delay/minblocks";
|
||||
if (*arg)
|
||||
return "Data after minblocks";
|
||||
|
||||
add_connection(dstate->rstate, &src, &dst, base, var, delay, minblocks);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool add_channel_direction(struct routing_state *rstate,
|
||||
const struct pubkey *from,
|
||||
const struct pubkey *to,
|
||||
|
||||
@@ -151,8 +151,6 @@ find_route(const tal_t *ctx, struct routing_state *rstate,
|
||||
|
||||
struct node_map *empty_node_map(const tal_t *ctx);
|
||||
|
||||
char *opt_add_route(const char *arg, struct lightningd_state *dstate);
|
||||
|
||||
bool add_channel_direction(struct routing_state *rstate,
|
||||
const struct pubkey *from,
|
||||
const struct pubkey *to,
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/gossip/gen_gossip_wire.h>
|
||||
#include <lightningd/gossip_msg.h>
|
||||
#include <lightningd/jsonrpc.h>
|
||||
|
||||
@@ -31,6 +31,13 @@ $(LIGHTNINGD_HANDSHAKE_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
|
||||
# Common source we use.
|
||||
HANDSHAKED_COMMON_OBJS := \
|
||||
common/crypto_sync.o \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/dev_disconnect.o \
|
||||
common/msg_queue.o \
|
||||
common/status.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/version.o
|
||||
|
||||
@@ -7,14 +7,14 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/version.h>
|
||||
#include <errno.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/handshake/gen_handshake_wire.h>
|
||||
#include <lightningd/hsm/client.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <secp256k1.h>
|
||||
#include <secp256k1_ecdh.h>
|
||||
#include <sodium/crypto_aead_chacha20poly1305.h>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <common/cryptomsg.h>
|
||||
handshake_bad_command,0x8000
|
||||
initr_act1_bad_ecdh_for_ss,0x8011
|
||||
initr_act1_write_failed,0x8012
|
||||
|
||||
|
@@ -6,11 +6,22 @@ LIGHTNINGD_HANDSHAKE_TEST_SRC := $(wildcard lightningd/handshake/test/run-*.c)
|
||||
LIGHTNINGD_HANDSHAKE_TEST_OBJS := $(LIGHTNINGD_HANDSHAKE_TEST_SRC:.c=.o)
|
||||
LIGHTNINGD_HANDSHAKE_TEST_PROGRAMS := $(LIGHTNINGD_HANDSHAKE_TEST_OBJS:.o=)
|
||||
|
||||
LIGHTNINGD_HANDSHAKE_TEST_COMMON_OBJS := \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/dev_disconnect.o \
|
||||
common/htlc_state.o \
|
||||
common/msg_queue.o \
|
||||
common/pseudorand.o \
|
||||
common/status.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o
|
||||
|
||||
update-mocks: $(LIGHTNINGD_HANDSHAKE_TEST_SRC:%=update-mocks/%)
|
||||
|
||||
$(LIGHTNINGD_HANDSHAKE_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(BITCOIN_OBJS) $(CORE_TX_OBJS) $(CORE_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_OLD_LIB_OBJS) libsecp256k1.a libsodium.a utils.o $(LIGHTNINGD_HANDSHAKE_GEN_SRC:.c=.o) libwallycore.a
|
||||
$(LIGHTNINGD_HANDSHAKE_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a $(LIGHTNINGD_HANDSHAKE_TEST_COMMON_OBJS) $(LIGHTNINGD_HANDSHAKE_GEN_SRC:.c=.o) libwallycore.a
|
||||
|
||||
$(LIGHTNINGD_HANDSHAKE_TEST_OBJS): $(LIGHTNINGD_HANDSHAKE_HEADERS) $(LIGHTNINGD_LIB_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(WIRE_HEADERS) $(CCAN_HEADERS) $(LIBBASE58_HEADERS) $(LIBSODIUM_HEADERS)
|
||||
$(LIGHTNINGD_HANDSHAKE_TEST_OBJS): $(LIGHTNINGD_HANDSHAKE_HEADERS) $(BITCOIN_HEADERS) $(GEN_HEADERS) $(WIRE_HEADERS) $(CCAN_HEADERS) $(LIBBASE58_HEADERS) $(LIBSODIUM_HEADERS)
|
||||
|
||||
lightningd/handshake-tests: $(LIGHTNINGD_HANDSHAKE_TEST_PROGRAMS:%=unittest/%)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <common/status.h>
|
||||
|
||||
/* Since we use pipes, we need different fds for read and write. */
|
||||
static int read_fd, write_fd;
|
||||
@@ -50,7 +50,7 @@ static unsigned char e_priv[32];
|
||||
|
||||
#define TESTING
|
||||
#include "../handshake.c"
|
||||
#include "utils.h"
|
||||
#include <common/utils.h>
|
||||
#include <ccan/err/err.h>
|
||||
|
||||
secp256k1_context *secp256k1_ctx;
|
||||
|
||||
@@ -25,9 +25,15 @@ LIGHTNINGD_HSM_OBJS := $(LIGHTNINGD_HSM_SRC:.c=.o)
|
||||
|
||||
# Common source we use.
|
||||
HSMD_COMMON_OBJS := \
|
||||
common/bip32.o \
|
||||
common/daemon_conn.o \
|
||||
common/funding_tx.o \
|
||||
common/key_derive.o \
|
||||
common/msg_queue.o \
|
||||
common/permute_tx.o \
|
||||
common/status.o \
|
||||
common/utils.o \
|
||||
common/utxo.o \
|
||||
common/version.o \
|
||||
common/withdraw_tx.o
|
||||
|
||||
@@ -46,7 +52,7 @@ $(LIGHTNINGD_HSM_OBJS): $(COMMON_HEADERS)
|
||||
|
||||
lightningd/hsm-all: lightningd/lightningd_hsm $(LIGHTNINGD_HSM_CLIENT_OBJS)
|
||||
|
||||
lightningd/lightningd_hsm: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIBBASE58_OBJS) lightningd/utxo.o libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_hsm: $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(HSMD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
lightningd/hsm/gen_hsm_client_wire.h: $(WIRE_GEN) lightningd/hsm/hsm_client_wire_csv
|
||||
|
||||
@@ -14,19 +14,18 @@
|
||||
#include <ccan/ptrint/ptrint.h>
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <common/daemon_conn.h>
|
||||
#include <common/funding_tx.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/version.h>
|
||||
#include <common/withdraw_tx.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/build_utxos.h>
|
||||
#include <lightningd/daemon_conn.h>
|
||||
#include <lightningd/hsm/client.h>
|
||||
#include <lightningd/hsm/gen_hsm_client_wire.h>
|
||||
#include <lightningd/hsm/gen_hsm_wire.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <secp256k1_ecdh.h>
|
||||
#include <sodium/randombytes.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
@@ -15,7 +15,7 @@ hsmstatus_client_bad_request,,msg,len*u8
|
||||
hsmctl_init,1
|
||||
hsmctl_init,,new,bool
|
||||
|
||||
#include <lightningd/bip32.h>
|
||||
#include <common/bip32.h>
|
||||
hsmctl_init_reply,101
|
||||
hsmctl_init_reply,,node_id,33
|
||||
hsmctl_init_reply,,peer_seed,struct secret
|
||||
@@ -29,7 +29,7 @@ hsmctl_hsmfd_ecdh,,unique_id,8
|
||||
hsmctl_hsmfd_ecdh_fd_reply,103
|
||||
|
||||
# Return signature for a funding tx.
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/utxo.h>
|
||||
# FIXME: This should also take their commit sig & details, to verify.
|
||||
hsmctl_sign_funding,4
|
||||
hsmctl_sign_funding,,satoshi_out,8
|
||||
|
||||
|
@@ -1,16 +1,15 @@
|
||||
#include "hsm_control.h"
|
||||
#include "lightningd.h"
|
||||
#include "peer_control.h"
|
||||
#include "subd.h"
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/io/io.h>
|
||||
#include <ccan/take/take.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utils.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/hsm/gen_hsm_wire.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <string.h>
|
||||
#include <wally_bip32.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <ccan/htable/htable_type.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/htlc_state.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <wire/gen_onion_wire.h>
|
||||
|
||||
/* We look up HTLCs by peer & id */
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/fdpass/fdpass.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/handshake/gen_handshake_wire.h>
|
||||
#include <lightningd/hsm/gen_hsm_wire.h>
|
||||
#include <lightningd/hsm_control.h>
|
||||
@@ -12,7 +12,6 @@
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/new_connection.h>
|
||||
#include <lightningd/peer_control.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <unistd.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
@@ -47,10 +47,18 @@ $(LIGHTNINGD_ONCHAIN_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
|
||||
# Common source we use.
|
||||
ONCHAIND_COMMON_OBJS := \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/derive_basepoints.o \
|
||||
common/initial_commit_tx.o \
|
||||
common/dev_disconnect.o \
|
||||
common/htlc_tx.o \
|
||||
common/htlc_wire.o \
|
||||
common/initial_commit_tx.o \
|
||||
common/keyset.o \
|
||||
common/key_derive.o \
|
||||
common/msg_queue.o \
|
||||
common/permute_tx.o \
|
||||
common/status.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/version.o
|
||||
@@ -63,7 +71,7 @@ lightningd/onchain/gen_onchain_wire.c: $(WIRE_GEN) lightningd/onchain/onchain_wi
|
||||
|
||||
LIGHTNINGD_ONCHAIN_OBJS := $(LIGHTNINGD_ONCHAIN_SRC:.c=.o) $(LIGHTNINGD_ONCHAIN_GEN_SRC:.c=.o)
|
||||
|
||||
lightningd/lightningd_onchain: $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_ONCHAIN_OBJS) $(WIRE_ONION_OBJS) $(ONCHAIND_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_onchain: $(LIGHTNINGD_ONCHAIN_OBJS) $(WIRE_ONION_OBJS) $(ONCHAIND_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
check-source: $(LIGHTNINGD_ONCHAIN_SRC_NOGEN:%=check-src-include-order/%)
|
||||
|
||||
@@ -3,24 +3,24 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/htlc_tx.h>
|
||||
#include <common/initial_commit_tx.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/keyset.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <common/version.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/keyset.h>
|
||||
#include <lightningd/onchain/gen_onchain_wire.h>
|
||||
#include <lightningd/onchain/onchain_types.h>
|
||||
#include <lightningd/peer_state.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <wire/wire_sync.h>
|
||||
#include "gen_onchain_types_names.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/htlc_wire.h>
|
||||
#include <lightningd/onchain/onchain_wire.h>
|
||||
#include <wire/wire.h>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ onchain_bad_command,0x8000
|
||||
onchain_internal_error,0x8003
|
||||
onchain_crypto_failed,0x8004
|
||||
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/htlc_wire.h>
|
||||
# Begin! Here's the onchain tx which spends funding tx, followed by all HTLCs.
|
||||
onchain_init,1
|
||||
onchain_init,,seed,struct privkey
|
||||
|
||||
|
@@ -35,14 +35,29 @@ LIGHTNINGD_HEADERS_NOGEN += $(LIGHTNINGD_OPENING_HEADERS_NOGEN)
|
||||
|
||||
# Common source we use.
|
||||
OPENINGD_COMMON_OBJS := \
|
||||
common/bip32.o \
|
||||
common/channel_config.o \
|
||||
common/crypto_sync.o \
|
||||
common/cryptomsg.o \
|
||||
common/daemon_conn.o \
|
||||
common/debug.o \
|
||||
common/derive_basepoints.o \
|
||||
common/dev_disconnect.o \
|
||||
common/funding_tx.o \
|
||||
common/htlc_wire.o \
|
||||
common/initial_channel.o \
|
||||
common/initial_commit_tx.o \
|
||||
common/key_derive.o \
|
||||
common/keyset.o \
|
||||
common/msg_queue.o \
|
||||
common/ping.o \
|
||||
common/peer_failed.o \
|
||||
common/permute_tx.o \
|
||||
common/pseudorand.o \
|
||||
common/status.o \
|
||||
common/type_to_string.o \
|
||||
common/utils.o \
|
||||
common/utxo.o \
|
||||
common/version.o
|
||||
|
||||
$(LIGHTNINGD_OPENING_OBJS): $(LIGHTNINGD_HEADERS)
|
||||
@@ -55,7 +70,7 @@ lightningd/opening/gen_opening_wire.c: $(WIRE_GEN) lightningd/opening/opening_wi
|
||||
|
||||
LIGHTNINGD_OPENING_OBJS := $(LIGHTNINGD_OPENING_SRC:.c=.o) $(LIGHTNINGD_OPENING_GEN_SRC:.c=.o)
|
||||
|
||||
lightningd/lightningd_opening: $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_LIB_OBJS) $(LIGHTNINGD_OPENING_OBJS) $(OPENINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
lightningd/lightningd_opening: $(LIGHTNINGD_OPENING_OBJS) $(OPENINGD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(LIGHTNINGD_HSM_CLIENT_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS)
|
||||
|
||||
check-source: $(LIGHTNINGD_OPENING_SRC_NOGEN:%=check-src-include-order/%)
|
||||
|
||||
@@ -5,21 +5,21 @@
|
||||
#include <ccan/breakpoint/breakpoint.h>
|
||||
#include <ccan/fdpass/fdpass.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <common/crypto_sync.h>
|
||||
#include <common/debug.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/funding_tx.h>
|
||||
#include <common/initial_channel.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/peer_failed.h>
|
||||
#include <common/ping.h>
|
||||
#include <common/pseudorand.h>
|
||||
#include <common/status.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/version.h>
|
||||
#include <errno.h>
|
||||
#include <inttypes.h>
|
||||
#include <lightningd/crypto_sync.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/opening/gen_opening_wire.h>
|
||||
#include <lightningd/peer_failed.h>
|
||||
#include <lightningd/ping.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <secp256k1.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -11,8 +11,8 @@ opening_peer_bad_funding,0x8012
|
||||
opening_peer_bad_config,0x8013
|
||||
opening_peer_bad_initial_message,0x8014
|
||||
|
||||
#include <lightningd/cryptomsg.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <common/cryptomsg.h>
|
||||
#include <common/channel_config.h>
|
||||
opening_init,0
|
||||
# Which network are we configured for (as index into the chainparams)?
|
||||
opening_init,,network_index,4
|
||||
@@ -25,8 +25,8 @@ opening_init,,crypto_state,struct crypto_state
|
||||
# Seed to generate all the keys from
|
||||
opening_init,,seed,struct privkey
|
||||
|
||||
#include <lightningd/bip32.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/bip32.h>
|
||||
#include <common/htlc_wire.h>
|
||||
# This means we offer the open.
|
||||
opening_funder,1
|
||||
opening_funder,,funding_satoshis,8
|
||||
@@ -36,7 +36,7 @@ opening_funder,,max_minimum_depth,4
|
||||
opening_funder,,change_satoshis,u64
|
||||
opening_funder,,change_keyindex,u32
|
||||
opening_funder,,channel_flags,u8
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/utxo.h>
|
||||
opening_funder,,num_inputs,u16
|
||||
opening_funder,,inputs,num_inputs*struct utxo
|
||||
opening_funder,,bip32,struct ext_key
|
||||
|
||||
|
@@ -10,7 +10,6 @@
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/peer_control.h>
|
||||
#include <lightningd/peer_htlcs.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <sodium/randombytes.h>
|
||||
|
||||
|
||||
@@ -9,8 +9,11 @@
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/close_tx.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <common/funding_tx.h>
|
||||
#include <common/initial_commit_tx.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/status.h>
|
||||
#include <common/timeout.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -19,21 +22,18 @@
|
||||
#include <lightningd/chaintopology.h>
|
||||
#include <lightningd/channel/gen_channel_wire.h>
|
||||
#include <lightningd/closing/gen_closing_wire.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <lightningd/dns.h>
|
||||
#include <lightningd/gen_peer_state_names.h>
|
||||
#include <lightningd/gossip/gen_gossip_wire.h>
|
||||
#include <lightningd/hsm/gen_hsm_wire.h>
|
||||
#include <lightningd/hsm_control.h>
|
||||
#include <lightningd/jsonrpc.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/new_connection.h>
|
||||
#include <lightningd/onchain/gen_onchain_wire.h>
|
||||
#include <lightningd/onchain/onchain_wire.h>
|
||||
#include <lightningd/opening/gen_opening_wire.h>
|
||||
#include <lightningd/peer_htlcs.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <netinet/in.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
@@ -252,11 +252,26 @@ static void peer_start_closingd(struct peer *peer,
|
||||
int peer_fd, int gossip_fd,
|
||||
bool reconnected);
|
||||
|
||||
/* FIXME: Fake NOP dev_disconnect/dev_sabotage_fd for below. */
|
||||
char dev_disconnect(int pkt_type)
|
||||
{
|
||||
return DEV_DISCONNECT_NORMAL;
|
||||
}
|
||||
|
||||
void dev_sabotage_fd(int fd)
|
||||
{
|
||||
abort();
|
||||
}
|
||||
|
||||
/* Send (encrypted) error message, then close. */
|
||||
static struct io_plan *send_error(struct io_conn *conn,
|
||||
struct peer_crypto_state *pcs)
|
||||
{
|
||||
log_debug(pcs->peer->log, "Sending canned error");
|
||||
/* FIXME: This is the only place where master talks directly to peer;
|
||||
* and pulls in quite a lot of code to do so. If we got a subdaemon
|
||||
* to do this work, we'd avoid pulling in cryptomsg.o and the fake
|
||||
* dev_disconnect. */
|
||||
return peer_write_message(conn, pcs, pcs->peer->error, (void *)io_close_cb);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
#include <ccan/compiler/compiler.h>
|
||||
#include <ccan/crypto/shachain/shachain.h>
|
||||
#include <ccan/list/list.h>
|
||||
#include <common/channel_config.h>
|
||||
#include <common/htlc.h>
|
||||
#include <common/json.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <lightningd/netaddr.h>
|
||||
#include <lightningd/peer_state.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <common/htlc_wire.h>
|
||||
#include <common/overflows.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <lightningd/chaintopology.h>
|
||||
#include <lightningd/channel/gen_channel_wire.h>
|
||||
#include <lightningd/gossip/gen_gossip_wire.h>
|
||||
#include <lightningd/htlc_end.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <lightningd/invoice.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
@@ -17,7 +18,6 @@
|
||||
#include <lightningd/pay.h>
|
||||
#include <lightningd/peer_control.h>
|
||||
#include <lightningd/peer_htlcs.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <wire/gen_onion_wire.h>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include "config.h"
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <common/derive_basepoints.h>
|
||||
#include <lightningd/htlc_wire.h>
|
||||
#include <common/htlc_wire.h>
|
||||
|
||||
/* FIXME: Define serialization primitive for this? */
|
||||
struct channel_info {
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#include <ccan/take/take.h>
|
||||
#include <ccan/tal/path/path.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/status.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <stdarg.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <ccan/list/list.h>
|
||||
#include <ccan/short_types/short_types.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <lightningd/msg_queue.h>
|
||||
#include <common/msg_queue.h>
|
||||
|
||||
struct io_conn;
|
||||
|
||||
|
||||
@@ -6,11 +6,20 @@ LIGHTNINGD_TEST_SRC := $(wildcard lightningd/test/run-*.c)
|
||||
LIGHTNINGD_TEST_OBJS := $(LIGHTNINGD_TEST_SRC:.c=.o)
|
||||
LIGHTNINGD_TEST_PROGRAMS := $(LIGHTNINGD_TEST_OBJS:.o=)
|
||||
|
||||
LIGHTNINGD_TEST_COMMON_OBJS := \
|
||||
common/daemon_conn.o \
|
||||
common/htlc_state.o \
|
||||
common/pseudorand.o \
|
||||
common/msg_queue.o \
|
||||
common/utils.o \
|
||||
common/type_to_string.o \
|
||||
common/permute_tx.o
|
||||
|
||||
update-mocks: $(LIGHTNINGD_TEST_SRC:%=update-mocks/%)
|
||||
|
||||
$(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(CORE_OBJS) $(CORE_TX_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_OLD_LIB_OBJS) utils.o libsecp256k1.a libsodium.a libwallycore.a
|
||||
$(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_OLD_LIB_OBJS) $(LIGHTNINGD_TEST_COMMON_OBJS) libsecp256k1.a libsodium.a libwallycore.a
|
||||
|
||||
$(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_SRC) $(LIGHTNINGD_LIB_SRC)
|
||||
$(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_SRC)
|
||||
|
||||
lightningd/tests: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%)
|
||||
|
||||
|
||||
@@ -1,20 +1,22 @@
|
||||
#include <lightningd/status.h>
|
||||
#include <common/status.h>
|
||||
#include <stdio.h>
|
||||
#define status_trace(fmt , ...) \
|
||||
printf(fmt "\n" , ## __VA_ARGS__)
|
||||
|
||||
#include "../key_derive.c"
|
||||
#include "../keyset.c"
|
||||
#include "../channel.c"
|
||||
#include "../commit_tx.c"
|
||||
#include "../htlc_tx.c"
|
||||
#include "../../common/key_derive.c"
|
||||
#include "../../common/keyset.c"
|
||||
#include "../../common/initial_channel.c"
|
||||
#include "../channel/full_channel.c"
|
||||
#include "../../common/initial_commit_tx.c"
|
||||
#include "../channel/commit_tx.c"
|
||||
#include "../../common/htlc_tx.c"
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <type_to_string.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <common/type_to_string.h>
|
||||
|
||||
const void *trc;
|
||||
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
#include "../key_derive.c"
|
||||
#include "../../common/key_derive.c"
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <type_to_string.h>
|
||||
#include <common/type_to_string.h>
|
||||
static bool print_superverbose;
|
||||
#define SUPERVERBOSE(...) \
|
||||
do { if (print_superverbose) printf(__VA_ARGS__); } while(0)
|
||||
#define PRINT_ACTUAL_FEE
|
||||
#include "../commit_tx.c"
|
||||
#include "../htlc_tx.c"
|
||||
#include "../channel/commit_tx.c"
|
||||
#include "../../common/initial_commit_tx.c"
|
||||
#include "../../common/htlc_tx.c"
|
||||
#include <bitcoin/preimage.h>
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <ccan/array_size/array_size.h>
|
||||
#include <ccan/err/err.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <type_to_string.h>
|
||||
#include <common/type_to_string.h>
|
||||
|
||||
/* Turn this on to brute-force fee values */
|
||||
/*#define DEBUG */
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#include <assert.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <common/dev_disconnect.h>
|
||||
#include <common/status.h>
|
||||
#include <stdio.h>
|
||||
#include <wire/peer_wire.h>
|
||||
#include <wire/wire_io.h>
|
||||
@@ -52,7 +52,7 @@ char dev_disconnect(int pkt_type)
|
||||
/* We test what look like unknown messages. */
|
||||
#define is_unknown_msg_discardable(x) 0
|
||||
|
||||
#include "../cryptomsg.c"
|
||||
#include "../../common/cryptomsg.c"
|
||||
|
||||
const void *trc;
|
||||
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
#include <bitcoin/privkey.h>
|
||||
#include <bitcoin/pubkey.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <type_to_string.h>
|
||||
#include <utils.h>
|
||||
#define SUPERVERBOSE printf
|
||||
#include "../funding_tx.c"
|
||||
#include "../../common/funding_tx.c"
|
||||
#undef SUPERVERBOSE
|
||||
#include "../key_derive.c"
|
||||
#include "../../common/key_derive.c"
|
||||
|
||||
#if 0
|
||||
static struct sha256 sha256_from_hex(const char *hex)
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
#define SUPERVERBOSE
|
||||
static void *tmpctx;
|
||||
|
||||
#include <stdio.h>
|
||||
#include <utils.h>
|
||||
#include <type_to_string.h>
|
||||
#include "../key_derive.c"
|
||||
#include <assert.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <common/type_to_string.h>
|
||||
#include <common/utils.h>
|
||||
#include <stdio.h>
|
||||
#include <type_to_string.h>
|
||||
#include "../../common/key_derive.c"
|
||||
|
||||
static struct secret secret_from_hex(const char *hex)
|
||||
{
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include <string.h>
|
||||
#include <ccan/str/hex/hex.h>
|
||||
#include <ccan/read_write_all/read_write_all.h>
|
||||
#include <common/sphinx.h>
|
||||
#include <common/utils.h>
|
||||
#include <err.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "lightningd/sphinx.h"
|
||||
|
||||
secp256k1_context *secp256k1_ctx;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ WALLET_TEST_PROGRAMS := $(WALLET_TEST_OBJS:.o=)
|
||||
|
||||
$(WALLET_TEST_OBJS): $(WALLET_LIB_OBJS)
|
||||
|
||||
$(WALLET_TEST_PROGRAMS): $(BITCOIN_OBJS) $(CCAN_OBJS) $(LIBBASE58_OBJS) daemon/log.o type_to_string.o daemon/pseudorand.o ccan-crypto-shachain-48.o utils.o libwallycore.a libsecp256k1.a libsodium.a
|
||||
$(WALLET_TEST_PROGRAMS): $(BITCOIN_OBJS) $(CCAN_OBJS) $(LIBBASE58_OBJS) lightningd/log.o common/type_to_string.o common/pseudorand.o ccan-crypto-shachain-48.o common/utils.o libwallycore.a libsecp256k1.a libsodium.a
|
||||
|
||||
$(WALLET_TEST_OBJS): $(CCAN_HEADERS)
|
||||
wallet/tests: $(WALLET_TEST_PROGRAMS:%=unittest/%)
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
#include <ccan/crypto/shachain/shachain.h>
|
||||
#include <ccan/list/list.h>
|
||||
#include <ccan/tal/tal.h>
|
||||
#include <lightningd/channel_config.h>
|
||||
#include <lightningd/utxo.h>
|
||||
#include <common/channel_config.h>
|
||||
#include <common/utxo.h>
|
||||
#include <wally_bip32.h>
|
||||
|
||||
struct lightningd;
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#include <bitcoin/base58.h>
|
||||
#include <bitcoin/script.h>
|
||||
#include <ccan/tal/str/str.h>
|
||||
#include <common/key_derive.h>
|
||||
#include <common/status.h>
|
||||
#include <common/utxo.h>
|
||||
#include <common/withdraw_tx.h>
|
||||
#include <errno.h>
|
||||
#include <lightningd/bitcoind.h>
|
||||
@@ -9,12 +12,9 @@
|
||||
#include <lightningd/hsm/gen_hsm_wire.h>
|
||||
#include <lightningd/hsm_control.h>
|
||||
#include <lightningd/jsonrpc.h>
|
||||
#include <lightningd/key_derive.h>
|
||||
#include <lightningd/lightningd.h>
|
||||
#include <lightningd/log.h>
|
||||
#include <lightningd/status.h>
|
||||
#include <lightningd/subd.h>
|
||||
#include <lightningd/utxo.h>
|
||||
#include <wally_bip32.h>
|
||||
#include <wire/wire_sync.h>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ WIRE_TEST_PROGRAMS := $(WIRE_TEST_OBJS:.o=)
|
||||
|
||||
update-mocks: $(WIRE_TEST_SRC:%=update-mocks/%)
|
||||
|
||||
$(WIRE_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a utils.o libsodium.a
|
||||
$(WIRE_TEST_PROGRAMS): $(CCAN_OBJS) $(CCAN_SHACHAIN48_OBJ) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) libsecp256k1.a common/utils.o libsodium.a
|
||||
|
||||
$(WIRE_TEST_OBJS): $(WIRE_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(WIRE_GEN_HEADERS) $(WIRE_GEN_SRC) $(CCAN_HEADERS) $(LIBSODIUM_HEADERS)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ void fromwire_pad_orig(const u8 **cursor, size_t *max, size_t num);
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <lightningd/sphinx.h>
|
||||
#include <common/sphinx.h>
|
||||
|
||||
secp256k1_context *secp256k1_ctx;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user