@@ -86,7 +86,7 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
86
86
* @param height - blockheight to get transations from
87
87
* @return transactions at height
88
88
*/
89
- private def getBlockTransactionsAt (height : Int ): Option [BlockTransactions ] =
89
+ private def getBlockTransactionsAt (height : Int ): Option [BlockTransactions ] = {
90
90
blockCache.remove(height).orElse(history.bestBlockTransactionsAt(height)).map { txs =>
91
91
if (height % 1000 == 0 ) blockCache.keySet.filter(_ < height).map(blockCache.remove)
92
92
if (readingUpTo - height < 300 && chainHeight - height > 1000 ) {
@@ -112,6 +112,7 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
112
112
}
113
113
txs
114
114
}
115
+ }
115
116
116
117
/**
117
118
* Spend an IndexedErgoBox from buffer or database. Also record tokens for later use in balance tracking logic.
@@ -239,7 +240,7 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
239
240
* Process a batch of BlockTransactions into memory and occasionally write them to database.
240
241
*
241
242
* @param state - current indexer state
242
- * @param headerOpt - header to index blocktransactions of (used after caught up with chain)
243
+ * @param headerOpt - header to index block transactions of (used after caught up with chain)
243
244
*/
244
245
protected def index (state : IndexerState , headerOpt : Option [Header ] = None ): IndexerState = {
245
246
val btOpt = headerOpt.flatMap { header =>
@@ -267,7 +268,7 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
267
268
inputTokens.clear()
268
269
269
270
// process transaction inputs
270
- if (height != 1 ) { // only after 1st block (skip genesis box)
271
+ if (height > 1 ) { // only after 1st block (skip genesis box)
271
272
cfor(0 )(_ < tx.inputs.size, _ + 1 ) { i =>
272
273
val boxId = bytesToId(tx.inputs(i).boxId)
273
274
if (findAndSpendBox(boxId, tx.id, height)) { // spend box and add tx
@@ -277,6 +278,8 @@ trait ExtraIndexerBase extends Actor with Stash with ScorexLogging {
277
278
findAndUpdateToken(iEb.box.additionalTokens(j)._1.toModifierId, Left (iEb))
278
279
}
279
280
inputs(i) = iEb.globalIndex
281
+ } else {
282
+ log.warn(s " Not found input box: $boxId" )
280
283
}
281
284
}
282
285
}
0 commit comments