1
0
Fork 0
forked from lthn/blockchain

coretests: wallet_test_core_proxy::update_blockchain() skips bad txs (it helps to calculate balance correctly in gen mode)

This commit is contained in:
sowle 2022-10-31 18:21:06 +01:00
parent 45d76ee28a
commit cdb58b727f
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -32,9 +32,16 @@ bool wallet_test_core_proxy::update_blockchain(const std::vector<test_event_entr
for (auto b : m_blocks)
std::for_each(b->b.tx_hashes.begin(), b->b.tx_hashes.end(), [&confirmed_txs](const crypto::hash& h) { confirmed_txs.insert(h); });
for (auto e : events)
size_t invalid_tx_index = UINT64_MAX;
for (size_t i = 0; i < events.size(); ++i)
{
if (e.type() != typeid(currency::transaction))
const test_event_entry& e = events[i];
if (test_chain_unit_enchanced::is_event_mark_invalid_tx(e))
{
invalid_tx_index = i + 1;
continue;
}
if (e.type() != typeid(currency::transaction) || i == invalid_tx_index)
continue;
const currency::transaction& tx = boost::get<currency::transaction>(e);