Remove redundant code

This commit is contained in:
practicalswift 2017-12-10 14:18:44 +01:00 committed by Rusty Russell
parent 0353ec0983
commit 4452e3f3f1
4 changed files with 4 additions and 12 deletions

View File

@ -2396,7 +2396,7 @@ static bool peer_write_pending(struct peer *peer)
dev_sabotage_fd(PEER_FD);
break;
case DEV_DISCONNECT_DROPPKT:
msg = tal_free(msg);
tal_free(msg);
peer->post_sabotage = true;
peer->peer_outmsg = NULL;
peer->peer_outoff = 0;

View File

@ -189,15 +189,11 @@ static void tx_must_be_eq(const struct bitcoin_tx *a,
{
tal_t *tmpctx = tal_tmpctx(NULL);
u8 *lina, *linb;
size_t i, len;
size_t i;
lina = linearize_tx(tmpctx, a);
linb = linearize_tx(tmpctx, b);
len = tal_len(lina);
if (tal_len(linb) < len)
len = tal_len(linb);
for (i = 0; i < tal_len(lina); i++) {
if (i >= tal_len(linb))
errx(1, "Second tx is truncated:\n"

View File

@ -581,7 +581,7 @@ void peer_connected(struct lightningd *ld, const u8 *msg,
/* Reconnect: discard old one. */
case OPENINGD:
peer = tal_free(peer);
tal_free(peer);
goto return_to_gossipd;
case ONCHAIND_CHEATED:

View File

@ -75,15 +75,11 @@ static void tx_must_be_eq(const struct bitcoin_tx *a,
{
tal_t *tmpctx = tal_tmpctx(NULL);
u8 *lina, *linb;
size_t i, len;
size_t i;
lina = linearize_tx(tmpctx, a);
linb = linearize_tx(tmpctx, b);
len = tal_len(lina);
if (tal_len(linb) < len)
len = tal_len(linb);
for (i = 0; i < tal_len(lina); i++) {
if (i >= tal_len(linb))
errx(1, "Second tx is truncated:\n"