diff --git a/bitcoin/tx.c b/bitcoin/tx.c index dffc5e039..d6c6714d4 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -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; diff --git a/daemon/packets.c b/daemon/packets.c index 60578e0b6..6d4691ec9 100644 --- a/daemon/packets.c +++ b/daemon/packets.c @@ -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; } diff --git a/daemon/peer.c b/daemon/peer.c index 45520c60e..3af06eb8b 100644 --- a/daemon/peer.c +++ b/daemon/peer.c @@ -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; diff --git a/daemon/peer.h b/daemon/peer.h index 4c332651c..dd37a7534 100644 --- a/daemon/peer.h +++ b/daemon/peer.h @@ -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;