bitcoin/tx: separate assertions.

This might help diagnose what's happening with #2759

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2019-06-21 09:41:00 +09:30
parent 47b5f2e837
commit 711762ec67

View File

@ -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);
}