From 61852b46031fb8fad3b99a2b4c35fc69388c2a72 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Mon, 11 Dec 2017 11:33:36 +0100 Subject: [PATCH] cleanup: Use check_act* in handshake and remove unused static inline This was tripping up `clang`. Signed-off-by: Christian Decker --- gossipd/handshake.c | 3 +++ wallet/wallet.h | 8 -------- wire/test/run-peer-wire.c | 10 ---------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/gossipd/handshake.c b/gossipd/handshake.c index f60d3cd3a..0fa8738ad 100644 --- a/gossipd/handshake.c +++ b/gossipd/handshake.c @@ -687,6 +687,7 @@ static struct io_plan *act_one_initiator(struct io_conn *conn, SECP256K1_EC_COMPRESSED); SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act1, ACT_ONE_SIZE)); + check_act_one(&h->act1); return io_write(conn, &h->act1, ACT_ONE_SIZE, act_two_initiator, h); } @@ -764,6 +765,7 @@ static struct io_plan *act_three_responder2(struct io_conn *conn, h->act3.tag, sizeof(h->act3.tag), NULL, 0)) return handshake_failed(conn, h); + check_act_three(&h->act3); return handshake_succeeded(conn, h); } @@ -859,6 +861,7 @@ static struct io_plan *act_two_responder(struct io_conn *conn, SECP256K1_EC_COMPRESSED); SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act2, ACT_TWO_SIZE)); + check_act_two(&h->act2); return io_write(conn, &h->act2, ACT_TWO_SIZE, act_three_responder, h); } diff --git a/wallet/wallet.h b/wallet/wallet.h index b89a33cb1..1013ee432 100644 --- a/wallet/wallet.h +++ b/wallet/wallet.h @@ -180,14 +180,6 @@ bool wallet_shachain_add_hash(struct wallet *wallet, uint64_t index, const struct sha256 *hash); -/* Simply passes through to shachain_get_hash since it doesn't touch - * the DB */ -inline bool wallet_shachain_get_hash(struct wallet *w, - struct wallet_shachain *chain, - u64 index, struct sha256 *hash) -{ - return shachain_get_hash(&chain->chain, index, hash); -} /** * wallet_shachain_load -- Load an existing shachain from the wallet. * diff --git a/wire/test/run-peer-wire.c b/wire/test/run-peer-wire.c index 87af7bcc2..a0bdc0015 100644 --- a/wire/test/run-peer-wire.c +++ b/wire/test/run-peer-wire.c @@ -70,16 +70,6 @@ static void set_pubkey(struct pubkey *key) #define eq_var(p1, p2, field) \ (tal_count((p1)->field) == tal_count((p2)->field) && memcmp((p1)->field, (p2)->field, tal_count((p1)->field) * sizeof(*(p1)->field)) == 0) -static inline bool eq_skip_(const void *p1, const void *p2, - size_t off, size_t skip, size_t total) -{ - if (memcmp(p1, p2, off) != 0) - return false; - p1 = (char *)p1 + off + skip; - p2 = (char *)p2 + off + skip; - return memcmp(p1, p2, total - (off + skip)) == 0; -} - /* Convenience structs for everyone! */ struct msg_error { struct channel_id channel_id;