mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-20 13:54:36 +01:00
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>
This commit is contained in:
parent
486d321094
commit
61852b4603
3 changed files with 3 additions and 18 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue