rpc: add bad-blocks to flush_cache RPC

Flushes m_invalid_blocks in Blockchain.
This commit is contained in:
moneromooo-monero
2019-12-02 18:51:28 +00:00
parent 411f1b0ee3
commit 5985c5afe8
10 changed files with 47 additions and 7 deletions
+2
View File
@@ -3004,6 +3004,8 @@ namespace cryptonote
RPC_TRACKER(flush_cache);
if (req.bad_txs)
m_core.flush_bad_txs_cache();
if (req.bad_blocks)
m_core.flush_invalid_blocks();
res.status = CORE_RPC_STATUS_OK;
return true;
}
+3 -1
View File
@@ -88,7 +88,7 @@ namespace cryptonote
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 3
#define CORE_RPC_VERSION_MINOR 0
#define CORE_RPC_VERSION_MINOR 1
#define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)
@@ -2559,9 +2559,11 @@ namespace cryptonote
struct request_t
{
bool bad_txs;
bool bad_blocks;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_OPT(bad_txs, false)
KV_SERIALIZE_OPT(bad_blocks, false)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<request_t> request;