Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/main/scala/encry/local/miner/Miner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ class Miner(dataHolder: ActorRef, influx: Option[ActorRef], settings: EncryAppSe

def receiveSemanticallySuccessfulModifier: Receive = {
case SemanticallySuccessfulModifier(mod: Block) if needNewCandidate(mod) =>
transactionsPool = transactionsPool ++ mod.payload.txs.dropRight(1)
.diff(candidateOpt.map(_.transactions.dropRight(1)).getOrElse(IndexedSeq.empty))
logger.info(s"Got new block. Starting to produce candidate at height: ${mod.header.height + 1} " +
s"at ${dateFormat.format(new Date(System.currentTimeMillis()))}")
produceCandidate()
Expand Down Expand Up @@ -179,7 +181,7 @@ class Miner(dataHolder: ActorRef, influx: Option[ActorRef], settings: EncryAppSe

val difficulty: Difficulty = bestHeaderOpt.map(parent => view.history.requiredDifficultyAfter(parent) match {
case Right(value) => value
case Left(value) => EncryApp.forceStopApplication(999, value.toString)
case Left(value) => EncryApp.forceStopApplication(999, value.toString)
})
.getOrElse(TestNetConstants.InitialDifficulty)

Expand Down