Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tx_pool: fix wrong timing of tx parsing #122

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/cryptonote_core/tx_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,21 @@ namespace cryptonote
cryptonote::blobdata txblob = m_blockchain.get_txpool_tx_blob(sorted_it->second);
cryptonote::transaction tx;

// Skip transactions that are not ready to be
// included into the blockchain or that are
// missing key images
const cryptonote::txpool_tx_meta_t original_meta = meta;
bool ready = false;
try
{
ready = is_transaction_ready_to_go(meta, sorted_it->second, txblob, tx);
}
catch (const std::exception &e)
{
MERROR("Failed to check transaction readiness: " << e.what());
// continue, not fatal
}

bool is_nofake_tx = false;
bool can_nofake_tx_be_simply_added = false;
bool can_nofake_tx_replace_existing_tx = false;
Expand Down Expand Up @@ -1359,20 +1374,6 @@ namespace cryptonote
}
}

// Skip transactions that are not ready to be
// included into the blockchain or that are
// missing key images
const cryptonote::txpool_tx_meta_t original_meta = meta;
bool ready = false;
try
{
ready = is_transaction_ready_to_go(meta, sorted_it->second, txblob, tx);
}
catch (const std::exception &e)
{
MERROR("Failed to check transaction readiness: " << e.what());
// continue, not fatal
}
if (memcmp(&original_meta, &meta, sizeof(meta)))
{
try
Expand Down