1
1
package io .iohk .ethereum .domain
2
2
3
3
import akka .util .ByteString
4
+
4
5
import scala .annotation .tailrec
5
6
6
7
import io .iohk .ethereum .db .dataSource .DataSourceBatchUpdate
@@ -183,8 +184,8 @@ class BlockchainImpl(
183
184
removeBlockNumberMapping(block.number)
184
185
else blockNumberMappingStorage.emptyBatchUpdate
185
186
186
- val potientialNewBestBlockNumber : BigInt = (block.number - 1 ).max(0 )
187
- val potientialNewBestBlockHash : ByteString = block.header.parentHash
187
+ val potentialNewBestBlockNumber : BigInt = (block.number - 1 ).max(0 )
188
+ val potentialNewBestBlockHash : ByteString = block.header.parentHash
188
189
val newLatestCheckpointNumber : BigInt =
189
190
if (block.hasCheckpoint && block.number == latestCheckpointNumber) {
190
191
findPreviousCheckpointBlockNumber(block.number, block.number)
@@ -200,8 +201,8 @@ class BlockchainImpl(
200
201
into the case of having an incomplete best block and so an inconsistent db
201
202
*/
202
203
val bestBlockNumberUpdates =
203
- if (appStateStorage.getBestBlockNumber() > potientialNewBestBlockNumber )
204
- appStateStorage.putBestBlockData(BestBlockInfo (potientialNewBestBlockHash, potientialNewBestBlockNumber ))
204
+ if (appStateStorage.getBestBlockNumber() > potentialNewBestBlockNumber )
205
+ appStateStorage.putBestBlockData(BestBlockInfo (potentialNewBestBlockHash, potentialNewBestBlockNumber ))
205
206
else appStateStorage.emptyBatchUpdate
206
207
val latestCheckpointNumberUpdates =
207
208
if (appStateStorage.getLatestCheckpointBlockNumber() > newLatestCheckpointNumber)
@@ -210,7 +211,7 @@ class BlockchainImpl(
210
211
211
212
log.debug(
212
213
" Persisting app info data into database. Persisted block number is {}. Persisted checkpoint number is {}" ,
213
- potientialNewBestBlockNumber ,
214
+ potentialNewBestBlockNumber ,
214
215
newLatestCheckpointNumber
215
216
)
216
217
@@ -228,7 +229,7 @@ class BlockchainImpl(
228
229
log.debug(
229
230
" Removed block with hash {}. New best block number - {}, new best checkpoint block number - {}" ,
230
231
ByteStringUtils .hash2string(blockHash),
231
- potientialNewBestBlockNumber ,
232
+ potentialNewBestBlockNumber ,
232
233
newLatestCheckpointNumber
233
234
)
234
235
}
0 commit comments