aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_core/blockchain.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-01-31 15:19:40 +0200
committerRiccardo Spagni <ric@spagni.net>2016-01-31 15:19:40 +0200
commitac961f66f69642563fe46c3be40efdad521c2c4e (patch)
treec662b2241380a793c64c2f1254de14cdf34339c8 /src/cryptonote_core/blockchain.cpp
parentMerge pull request #629 (diff)
parentnew flush_txpool command, and associated RPC call (diff)
downloadmonero-ac961f66f69642563fe46c3be40efdad521c2c4e.tar.xz
Merge pull request #630
bf6d147 new flush_txpool command, and associated RPC call (moneromooo-monero) 6288295 rpc: add missing return on error when getting a tx (moneromooo-monero) b7e37b7 simplewallet: show_transfers can now show just failed txes (moneromooo-monero) b11539f wallet: detect and handle failed outgoing transfers (moneromooo-monero) 4b23714 tx_pool: serialize missing kept_by_block flag (moneromooo-monero)
Diffstat (limited to 'src/cryptonote_core/blockchain.cpp')
-rw-r--r--src/cryptonote_core/blockchain.cpp19
1 files changed, 19 insertions, 0 deletions
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<transaction> &txs)
}
}
//------------------------------------------------------------------
+bool Blockchain::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;
+}
+//------------------------------------------------------------------
// 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()