|
|
@ -46,8 +46,13 @@ func (is *IndexerService) OnStart() error { |
|
|
|
select { |
|
|
|
case msg := <-blockHeadersSub.Out(): |
|
|
|
header := msg.Data().(types.EventDataNewBlockHeader).Header |
|
|
|
if header.NumTxs == 0 { |
|
|
|
continue |
|
|
|
} |
|
|
|
batch := NewBatch(header.NumTxs) |
|
|
|
for i := int64(0); i < header.NumTxs; i++ { |
|
|
|
i := int64(0) |
|
|
|
TXS_LOOP: |
|
|
|
for { |
|
|
|
select { |
|
|
|
case msg2 := <-txsSub.Out(): |
|
|
|
txResult := msg2.Data().(types.EventDataTx).TxResult |
|
|
@ -57,6 +62,10 @@ func (is *IndexerService) OnStart() error { |
|
|
|
"index", txResult.Index, |
|
|
|
"err", err) |
|
|
|
} |
|
|
|
i++ |
|
|
|
if i == header.NumTxs { |
|
|
|
break TXS_LOOP |
|
|
|
} |
|
|
|
case <-txsSub.Cancelled(): |
|
|
|
is.Logger.Error("Failed to index block. txsSub was cancelled. Did the Tendermint stop?", |
|
|
|
"height", header.Height, |
|
|
|