diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-22 15:28:08 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-10-25 18:41:54 +0000 |
commit | a4dc575ccba8348886ed19594a16f5a7242f8fe6 (patch) | |
tree | e6afd9cd4b734b336e74af84931aa45a87f9e3eb /src/cryptonote_core | |
parent | Merge pull request #5357 (diff) | |
download | monero-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.cpp | 8 | ||||
-rw-r--r-- | src/cryptonote_core/cryptonote_core.h | 5 |
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: /** |