Skip to content

Commit 34018ab

Browse files
author
Łukasz Gąsior
committed
Fix
1 parent 3448160 commit 34018ab

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/scala/io/iohk/ethereum/jsonrpc/TestService.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import org.spongycastle.util.encoders.Hex
1717
import scala.concurrent.ExecutionContext.Implicits.global
1818
import scala.concurrent.Future
1919
import scala.concurrent.duration._
20+
import scala.util.Try
2021

2122
object TestService {
2223
case class GenesisParams(author: ByteString, extraData: ByteString, gasLimit: BigInt, parentHash: ByteString, timestamp: ByteString)
@@ -95,8 +96,8 @@ class TestService(
9596
timestamp = Hex.toHexString(request.chainParams.genesis.timestamp.toArray[Byte]),
9697
alloc = request.chainParams.accounts.map { case (addr, acc) => Hex.toHexString(addr.toArray[Byte]) -> AllocAccount(acc.wei.toString) })
9798

98-
// remove current genesis
99-
blockchain.removeBlock(blockchain.genesisHeader.hash, saveParentAsBestBlock = false)
99+
// remove current genesis (Try because it may not exist)
100+
Try(blockchain.removeBlock(blockchain.genesisHeader.hash, saveParentAsBestBlock = false))
100101

101102
// load the new genesis
102103
val genesisDataLoader = new GenesisDataLoader(blockchain, newBlockchainConfig)

src/universal/conf/testmode.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ mantis {
44

55
datadir = ${user.home}"/.mantis-testmode"
66

7+
sync.do-fast-sync = false
8+
79
network.discovery {
810
discovery-enabled = false
911
bootstrap-nodes = []

0 commit comments

Comments
 (0)