mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
Misc minor cleanups.
From doing a code walkthrough with Christian Decker; unnecessary const in bitcoin/tx.c, an erroneous FIXME, a missing comment, and an unused struct. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -516,7 +516,7 @@ struct bitcoin_tx *pull_bitcoin_tx(const tal_t *ctx,
|
||||
struct bitcoin_tx *bitcoin_tx_from_hex(const tal_t *ctx, const char *hex,
|
||||
size_t hexlen)
|
||||
{
|
||||
char *end;
|
||||
const char *end;
|
||||
u8 *linear_tx;
|
||||
const u8 *p;
|
||||
struct bitcoin_tx *tx;
|
||||
@@ -524,7 +524,7 @@ struct bitcoin_tx *bitcoin_tx_from_hex(const tal_t *ctx, const char *hex,
|
||||
|
||||
end = memchr(hex, '\n', hexlen);
|
||||
if (!end)
|
||||
end = cast_const(char *, hex) + hexlen;
|
||||
end = hex + hexlen;
|
||||
|
||||
len = hex_data_size(end - hex);
|
||||
p = linear_tx = tal_arr(ctx, u8, len);
|
||||
@@ -538,9 +538,6 @@ struct bitcoin_tx *bitcoin_tx_from_hex(const tal_t *ctx, const char *hex,
|
||||
if (len)
|
||||
goto fail_free_tx;
|
||||
|
||||
if (end != hex + hexlen && *end != '\n')
|
||||
goto fail_free_tx;
|
||||
|
||||
tal_free(linear_tx);
|
||||
return tx;
|
||||
|
||||
|
||||
@@ -655,7 +655,6 @@ Pkt *accept_pkt_htlc_add(struct peer *peer, const Pkt *pkt)
|
||||
stage.add.htlc = htlc;
|
||||
add_unacked(&peer->local, &stage);
|
||||
|
||||
/* FIXME: Fees must be sufficient. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -642,6 +642,7 @@ static const struct bitcoin_tx *htlc_fulfill_tx(const struct peer *peer,
|
||||
/* FIXME: Reason! */
|
||||
static bool command_htlc_fail(struct peer *peer, struct htlc *htlc)
|
||||
{
|
||||
/* If onchain, nothing we can do. */
|
||||
if (!state_can_remove_htlc(peer->state))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -101,12 +101,6 @@ struct peer_visible_state {
|
||||
struct htlc_map htlcs;
|
||||
};
|
||||
|
||||
struct out_pkt {
|
||||
Pkt *pkt;
|
||||
void (*ack_cb)(struct peer *peer, void *arg);
|
||||
void *ack_arg;
|
||||
};
|
||||
|
||||
/* Off peer->outgoing_txs */
|
||||
struct outgoing_tx {
|
||||
struct list_node list;
|
||||
|
||||
Reference in New Issue
Block a user