aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-22 15:28:08 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-10-25 18:41:54 +0000
commita4dc575ccba8348886ed19594a16f5a7242f8fe6 (patch)
treee6afd9cd4b734b336e74af84931aa45a87f9e3eb /src/cryptonote_core
parentMerge pull request #5357 (diff)
downloadmonero-a4dc575ccba8348886ed19594a16f5a7242f8fe6.tar.xz
rpc: add a flush_cache RPC
This allows flushing internal caches (for now, the bad tx cache, which will allow debugging a stuck monerod after it has failed to verify a transaction in a block, since it would otherwise not try again, making subsequent log changes pointless)
Diffstat (limited to 'src/cryptonote_core')
-rw-r--r--src/cryptonote_core/cryptonote_core.cpp8
-rw-r--r--src/cryptonote_core/cryptonote_core.h5
2 files changed, 13 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp
index 5a303a67e..acb494a49 100644
--- a/src/cryptonote_core/cryptonote_core.cpp
+++ b/src/cryptonote_core/cryptonote_core.cpp
@@ -1911,6 +1911,14 @@ namespace cryptonote
return true;
}
//-----------------------------------------------------------------------------------------------
+ void core::flush_bad_txs_cache()
+ {
+ bad_semantics_txes_lock.lock();
+ for (int idx = 0; idx < 2; ++idx)
+ bad_semantics_txes[idx].clear();
+ bad_semantics_txes_lock.unlock();
+ }
+ //-----------------------------------------------------------------------------------------------
bool core::update_blockchain_pruning()
{
return m_blockchain_storage.update_blockchain_pruning();
diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h
index 0db6350be..f69ac3509 100644
--- a/src/cryptonote_core/cryptonote_core.h
+++ b/src/cryptonote_core/cryptonote_core.h
@@ -839,6 +839,11 @@ namespace cryptonote
*/
bool has_block_weights(uint64_t height, uint64_t nblocks) const;
+ /**
+ * @brief flushes the bad txs cache
+ */
+ void flush_bad_txs_cache();
+
private:
/**