Browse Source

cleanup: Use check_act* in handshake and remove unused static inline

This was tripping up `clang`.

Signed-off-by: Christian Decker <decker.christian@gmail.com>
ppa-0.6.1
Christian Decker 7 years ago
committed by Rusty Russell
parent
commit
61852b4603
  1. 3
      gossipd/handshake.c
  2. 8
      wallet/wallet.h
  3. 10
      wire/test/run-peer-wire.c

3
gossipd/handshake.c

@ -687,6 +687,7 @@ static struct io_plan *act_one_initiator(struct io_conn *conn,
SECP256K1_EC_COMPRESSED); SECP256K1_EC_COMPRESSED);
SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act1, ACT_ONE_SIZE)); 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); 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)) h->act3.tag, sizeof(h->act3.tag), NULL, 0))
return handshake_failed(conn, h); return handshake_failed(conn, h);
check_act_three(&h->act3);
return handshake_succeeded(conn, h); return handshake_succeeded(conn, h);
} }
@ -859,6 +861,7 @@ static struct io_plan *act_two_responder(struct io_conn *conn,
SECP256K1_EC_COMPRESSED); SECP256K1_EC_COMPRESSED);
SUPERVERBOSE("output: 0x%s", tal_hexstr(trc, &h->act2, ACT_TWO_SIZE)); 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); return io_write(conn, &h->act2, ACT_TWO_SIZE, act_three_responder, h);
} }

8
wallet/wallet.h

@ -180,14 +180,6 @@ bool wallet_shachain_add_hash(struct wallet *wallet,
uint64_t index, uint64_t index,
const struct sha256 *hash); 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. * wallet_shachain_load -- Load an existing shachain from the wallet.
* *

10
wire/test/run-peer-wire.c

@ -70,16 +70,6 @@ static void set_pubkey(struct pubkey *key)
#define eq_var(p1, p2, field) \ #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) (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! */ /* Convenience structs for everyone! */
struct msg_error { struct msg_error {
struct channel_id channel_id; struct channel_id channel_id;

Loading…
Cancel
Save