aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/tx_pool.cpp
diff options
context:
space:
mode:
authormoneromooo <moneromoo@nowhere.nowhere.nowhere>2017-08-23 18:21:14 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-25 22:21:51 +0100
commit1914c999c7382a3407aa7c440cb0d6a0e5428df2 (patch)
tree5248f81913e03a85c73553df85be1860f11db9be /src/cryptonote_core/tx_pool.cpp
parenttxpool: add tx size median to the pool stats (diff)
downloadmonero-1914c999c7382a3407aa7c440cb0d6a0e5428df2.tar.xz
txpool: update db tx metadata when it changes
Diffstat (limited to 'src/cryptonote_core/tx_pool.cpp')
-rw-r--r--src/cryptonote_core/tx_pool.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp
index e7fc14a44..893066580 100644
--- a/src/cryptonote_core/tx_pool.cpp
+++ b/src/cryptonote_core/tx_pool.cpp
@@ -909,7 +909,21 @@ namespace cryptonote
// Skip transactions that are not ready to be
// included into the blockchain or that are
// missing key images
- if (!is_transaction_ready_to_go(meta, tx))
+ const cryptonote::txpool_tx_meta_t original_meta = meta;
+ bool ready = is_transaction_ready_to_go(meta, tx);
+ if (memcmp(&original_meta, &meta, sizeof(meta)))
+ {
+ try
+ {
+ m_blockchain.update_txpool_tx(sorted_it->second, meta);
+ }
+ catch (const std::exception &e)
+ {
+ MERROR("Failed to update tx meta: " << e.what());
+ // continue, not fatal
+ }
+ }
+ if (!ready)
{
LOG_PRINT_L2(" not ready to go");
sorted_it++;