mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-01 23:51:21 +00:00
rewrite indexer service in the attempt to fix failing test
https://github.com/tendermint/tendermint/pull/3227/#issuecomment-462316527
This commit is contained in:
parent
545b33ed29
commit
0d9107a098
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user