From 91ca0b4065597b16b72a172f9f40993de588e026 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Mon, 29 Aug 2016 09:09:48 +0100 Subject: core: allow empty global indices for txes with empty vout --- src/cryptonote_core/blockchain.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index ef72dac59..07db59796 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2149,7 +2149,12 @@ bool Blockchain::get_tx_outputs_gindexs(const crypto::hash& tx_id, std::vectorget_tx_amount_output_indices(tx_index); - CHECK_AND_ASSERT_MES(indexs.size(), false, "internal error: global indexes for transaction " << tx_id << " is empty"); + if (indexs.empty()) + { + // empty indexs is only valid if the vout is empty, which is legal but rare + cryptonote::transaction tx = m_db->get_tx(tx_id); + CHECK_AND_ASSERT_MES(tx.vout.empty(), false, "internal error: global indexes for transaction " << tx_id << " is empty, and tx vout is not"); + } return true; } -- cgit v1.2.3