Skip to content

Commit 61852b4

Browse files
cdeckerrustyrussell
authored andcommitted
cleanup: Use check_act* in handshake and remove unused static inline
This was tripping up `clang`. Signed-off-by: Christian Decker <[email protected]>
1 parent 486d321 commit 61852b4

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
lines changed

gossipd/handshake.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,7 @@ static struct io_plan *act_one_initiator(struct io_conn *conn,
687687
SECP256K1_EC_COMPRESSED);
688688
SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act1, ACT_ONE_SIZE));
689689

690+
check_act_one(&h->act1);
690691
return io_write(conn, &h->act1, ACT_ONE_SIZE, act_two_initiator, h);
691692
}
692693

@@ -764,6 +765,7 @@ static struct io_plan *act_three_responder2(struct io_conn *conn,
764765
h->act3.tag, sizeof(h->act3.tag), NULL, 0))
765766
return handshake_failed(conn, h);
766767

768+
check_act_three(&h->act3);
767769
return handshake_succeeded(conn, h);
768770
}
769771

@@ -859,6 +861,7 @@ static struct io_plan *act_two_responder(struct io_conn *conn,
859861
SECP256K1_EC_COMPRESSED);
860862
SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act2, ACT_TWO_SIZE));
861863

864+
check_act_two(&h->act2);
862865
return io_write(conn, &h->act2, ACT_TWO_SIZE, act_three_responder, h);
863866
}
864867

wallet/wallet.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,6 @@ bool wallet_shachain_add_hash(struct wallet *wallet,
180180
uint64_t index,
181181
const struct sha256 *hash);
182182

183-
/* Simply passes through to shachain_get_hash since it doesn't touch
184-
* the DB */
185-
inline bool wallet_shachain_get_hash(struct wallet *w,
186-
struct wallet_shachain *chain,
187-
u64 index, struct sha256 *hash)
188-
{
189-
return shachain_get_hash(&chain->chain, index, hash);
190-
}
191183
/**
192184
* wallet_shachain_load -- Load an existing shachain from the wallet.
193185
*

wire/test/run-peer-wire.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ static void set_pubkey(struct pubkey *key)
7070
#define eq_var(p1, p2, field) \
7171
(tal_count((p1)->field) == tal_count((p2)->field) && memcmp((p1)->field, (p2)->field, tal_count((p1)->field) * sizeof(*(p1)->field)) == 0)
7272

73-
static inline bool eq_skip_(const void *p1, const void *p2,
74-
size_t off, size_t skip, size_t total)
75-
{
76-
if (memcmp(p1, p2, off) != 0)
77-
return false;
78-
p1 = (char *)p1 + off + skip;
79-
p2 = (char *)p2 + off + skip;
80-
return memcmp(p1, p2, total - (off + skip)) == 0;
81-
}
82-
8373
/* Convenience structs for everyone! */
8474
struct msg_error {
8575
struct channel_id channel_id;

0 commit comments

Comments
 (0)