aboutsummaryrefslogtreecommitdiff
path: root/tests/core_tests/chaingen.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-05-14 14:06:55 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-05-25 22:23:37 +0100
commitb52abd1370cc21484d64f45504adbab47240debf (patch)
tree42c9327b4b928d008fcc61e4b7ca09c85ec9ccd9 /tests/core_tests/chaingen.h
parentMerge pull request #1956 (diff)
downloadmonero-b52abd1370cc21484d64f45504adbab47240debf.tar.xz
Move txpool to the database
Integration could go further (ie, return_tx_to_pool calls should not be needed anymore, possibly other things). poolstate.bin is now obsolete.
Diffstat (limited to 'tests/core_tests/chaingen.h')
-rw-r--r--tests/core_tests/chaingen.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/core_tests/chaingen.h b/tests/core_tests/chaingen.h
index eef10312d..add48eebe 100644
--- a/tests/core_tests/chaingen.h
+++ b/tests/core_tests/chaingen.h
@@ -472,6 +472,16 @@ inline bool do_replay_events(std::vector<test_event_entry>& events)
MERROR("Failed to init core");
return false;
}
+
+ // start with a clean pool
+ std::vector<crypto::hash> pool_txs;
+ if (!c.get_pool_transaction_hashes(pool_txs))
+ {
+ MERROR("Failed to flush txpool");
+ return false;
+ }
+ c.get_blockchain_storage().flush_txes_from_pool(std::list<crypto::hash>(pool_txs.begin(), pool_txs.end()));
+
t_test_class validator;
bool ret = replay_events_through_core<t_test_class>(c, events, validator);
c.deinit();