From bf6d1474c097ee0affe827fe2e3dac489b290f40 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Sat, 30 Jan 2016 13:28:26 +0000 Subject: new flush_txpool command, and associated RPC call It can flush a particular tx, or the whole pool (the RPC command can flush a list of transactions too) --- src/cryptonote_core/blockchain.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/cryptonote_core/blockchain.cpp') diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index b27927c0a..bf17544fc 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -2386,6 +2386,25 @@ void Blockchain::return_tx_to_pool(const std::vector &txs) } } //------------------------------------------------------------------ +bool Blockchain::flush_txes_from_pool(const std::list &txids) +{ + bool res = true; + for (const auto &txid: txids) + { + cryptonote::transaction tx; + size_t blob_size; + uint64_t fee; + bool relayed; + LOG_PRINT_L1("Removing txid " << txid << " from the pool"); + if(!m_tx_pool.take_tx(txid, tx, blob_size, fee, relayed)) + { + LOG_PRINT_L0("Failed to remove txid " << txid << " from the pool"); + res = false; + } + } + return res; +} +//------------------------------------------------------------------ // Needs to validate the block and acquire each transaction from the // transaction mem_pool, then pass the block and transactions to // m_db->add_block() -- cgit v1.2.3