From bdad073203559f0e50b4c3c10141f3c345da6187 Mon Sep 17 00:00:00 2001 From: Bohdan Vanieiev Date: Fri, 24 Jan 2020 15:46:24 +0200 Subject: [PATCH] Use database for mock mode --- .gitignore | 1 + altchain-pop-miner/.gitignore | 4 ++++ .../src/main/kotlin/org/veriblock/miners/pop/MockMiner.kt | 5 +++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 13508f28c..2a0da315a 100644 --- a/.gitignore +++ b/.gitignore @@ -100,3 +100,4 @@ scripts/certs/ certs/ .scannerwork +.idea \ No newline at end of file diff --git a/altchain-pop-miner/.gitignore b/altchain-pop-miner/.gitignore index 9f90761ac..96a1d3545 100644 --- a/altchain-pop-miner/.gitignore +++ b/altchain-pop-miner/.gitignore @@ -1,6 +1,10 @@ generated +mock +mock.dat +mock-shm +mock-wal pop.dat *.spvchain *.wallet diff --git a/altchain-pop-miner/miner/src/main/kotlin/org/veriblock/miners/pop/MockMiner.kt b/altchain-pop-miner/miner/src/main/kotlin/org/veriblock/miners/pop/MockMiner.kt index 92192e3f9..dbc05e4b0 100644 --- a/altchain-pop-miner/miner/src/main/kotlin/org/veriblock/miners/pop/MockMiner.kt +++ b/altchain-pop-miner/miner/src/main/kotlin/org/veriblock/miners/pop/MockMiner.kt @@ -43,8 +43,9 @@ private val logger = createLogger {} class MockMiner( private val pluginFactory: PluginService ) : Miner { - private val veriBlockStore = VeriBlockStore(ConnectionSelector.setConnectionInMemory()) - private val bitcoinStore = BitcoinStore(ConnectionSelector.setConnectionInMemory()) + private val connection = ConnectionSelector.setConnection("mock") + private val veriBlockStore = VeriBlockStore(connection) + private val bitcoinStore = BitcoinStore(connection) private val veriBlockBlockchain = VeriBlockBlockchain(VeriBlockDefaults.networkParameters, veriBlockStore, bitcoinStore) private val bitcoinBlockchain = BitcoinBlockchain(BitcoinDefaults.networkParameters, bitcoinStore) private val vpm = VeriBlockPopMiner(veriBlockBlockchain, bitcoinBlockchain)