From 11a4d46c44cbf6de7612ac993ff40b681377745c Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 6 Jan 2021 16:32:04 +1030 Subject: [PATCH] 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 --- lightningd/chaintopology.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lightningd/chaintopology.c b/lightningd/chaintopology.c index 7c4bdc11c..072a9e698 100644 --- a/lightningd/chaintopology.c +++ b/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);