diff --git a/src/main/scala/com/wavesplatform/matcher/market/OrderHistoryActor.scala b/src/main/scala/com/wavesplatform/matcher/market/OrderHistoryActor.scala index fc6e53f7600..5f3eba951b4 100644 --- a/src/main/scala/com/wavesplatform/matcher/market/OrderHistoryActor.scala +++ b/src/main/scala/com/wavesplatform/matcher/market/OrderHistoryActor.scala @@ -21,9 +21,19 @@ import scorex.wallet.Wallet class OrderHistoryActor(val settings: MatcherSettings, val storedState: StoredState, val wallet: Wallet) extends Actor with OrderValidator { - val dbFile = new File(settings.orderHistoryFile) - dbFile.getParentFile.mkdirs().ensuring(dbFile.getParentFile.exists()) - val db: MVStore = new MVStore.Builder().fileName(settings.orderHistoryFile).compress().open() + def createMVStore(fileName: String): MVStore = { + Option(fileName).filter(_.trim.nonEmpty) match { + case Some(s) => + val file = new File(s) + file.getParentFile.mkdirs().ensuring(file.getParentFile.exists()) + + new MVStore.Builder().fileName(s).compress().open() + case None => + new MVStore.Builder().open() + } + } + + val db: MVStore = createMVStore(settings.orderHistoryFile) val storage = new OrderHistoryStorage(db) val orderHistory = OrderHistoryImpl(storage) @@ -61,10 +71,6 @@ class OrderHistoryActor(val settings: MatcherSettings, val storedState: StoredSt sender() ! GetOrderHistoryResponse(res) } - def validateOrder(): Unit = { - - } - def deleteFromOrderHistory(req: DeleteOrderFromHistory): Unit = { orderHistory.getOrderStatus(req.id) match { case Filled | LimitOrder.Cancelled(_) => diff --git a/src/test/scala/scorex/waves/TestingCommons.scala b/src/test/scala/scorex/waves/TestingCommons.scala index b2052aa0506..07f903a2071 100755 --- a/src/test/scala/scorex/waves/TestingCommons.scala +++ b/src/test/scala/scorex/waves/TestingCommons.scala @@ -132,7 +132,7 @@ trait TestingCommons extends Suite with BeforeAndAfterAll with Eventually { | port: 9093 | journal-directory: ${waves.directory}"/journal" | snapshots-directory: ${waves.directory}"/snapshots" - | order-history-file = ${waves.directory}"/matcher/orderhistory.dat" + | order-history-file = "" | max-timestamp-diff = 3h | is-migrate-to-new-order-history-storage = no | }