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