aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain_storage.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-30 13:28:26 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-01-30 13:28:26 +0000
commitbf6d1474c097ee0affe827fe2e3dac489b290f40 (patch)
treec662b2241380a793c64c2f1254de14cdf34339c8 /src/cryptonote_core/blockchain_storage.cpp
parent6288295f8e4c7807dba73cbdddd375f105ea5af6 (diff)
downloadmonzero-core-bf6d1474c097ee0affe827fe2e3dac489b290f40.tar.gz
monzero-core-bf6d1474c097ee0affe827fe2e3dac489b290f40.tar.xz
monzero-core-bf6d1474c097ee0affe827fe2e3dac489b290f40.zip
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)
Diffstat (limited to 'src/cryptonote_core/blockchain_storage.cpp')
-rw-r--r--src/cryptonote_core/blockchain_storage.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain_storage.cpp b/src/cryptonote_core/blockchain_storage.cpp
index f656f938b..e1b89f887 100644
--- a/src/cryptonote_core/blockchain_storage.cpp
+++ b/src/cryptonote_core/blockchain_storage.cpp
@@ -1892,6 +1892,25 @@ void blockchain_storage::set_enforce_dns_checkpoints(bool enforce_checkpoints)
m_enforce_dns_checkpoints = enforce_checkpoints;
}
//------------------------------------------------------------------
+bool blockchain_storage::flush_txes_from_pool(const std::list<crypto::hash> &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;
+}
+//------------------------------------------------------------------
bool blockchain_storage::for_all_key_images(std::function<bool(const crypto::key_image&)> f) const
{
for (key_images_container::const_iterator i = m_spent_keys.begin(); i != m_spent_keys.end(); ++i) {