From 711762ec67d5aa0482217f9c69d77a3ecf1a59e6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 21 Jun 2019 09:41:00 +0930 Subject: [PATCH] bitcoin/tx: separate assertions. This might help diagnose what's happening with #2759 Signed-off-by: Rusty Russell --- bitcoin/tx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bitcoin/tx.c b/bitcoin/tx.c index bface0c66..cb472554e 100644 --- a/bitcoin/tx.c +++ b/bitcoin/tx.c @@ -208,11 +208,13 @@ static void push_tx(const struct bitcoin_tx *tx, if (bip144 && uses_witness(tx)) flag |= WALLY_TX_FLAG_USE_WITNESS; - wally_tx_get_length(tx->wtx, flag, &len); + res = wally_tx_get_length(tx->wtx, flag, &len); + assert(res); serialized = tal_arr(tmpctx, u8, len); res = wally_tx_to_bytes(tx->wtx, flag, serialized, len, &written); - assert(res == WALLY_OK && len == written); + assert(res == WALLY_OK); + assert(len == written); push(serialized, len, pushp); tal_free(serialized); }