Browse Source

chaintopology: fix crash if bcli doesn't include errmsg.

Interestingly, we required that "sendrawtx" include "errmsg" field even
on success, otherwise we crashed in broadcast_remainder.

We only actually insist on an "errmsg" if success is false.  And this
logic here is weird (the !success) was added by darosior in
947f5ddde1, which makes the msg checks redundant.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa
Rusty Russell 4 years ago
committed by Christian Decker
parent
commit
11a4d46c44
  1. 5
      lightningd/chaintopology.c

5
lightningd/chaintopology.c

@ -136,10 +136,7 @@ static void broadcast_remainder(struct bitcoind *bitcoind,
bool success, const char *msg,
struct txs_to_broadcast *txs)
{
/* These are expected. */
if (strstr(msg, "txn-mempool-conflict")
|| strstr(msg, "transaction already in block chain")
|| !success)
if (!success)
log_debug(bitcoind->log,
"Expected error broadcasting tx %s: %s",
txs->txs[txs->cursor], msg);

Loading…
Cancel
Save