Browse Source

fix tests

pull/1550/head
Anton Kaliaev 7 years ago
parent
commit
6f7333fd5f
No known key found for this signature in database GPG Key ID: 7B6881D965918214
1 changed files with 8 additions and 2 deletions
  1. +8
    -2
      state/txindex/indexer_service.go

+ 8
- 2
state/txindex/indexer_service.go View File

@ -45,10 +45,16 @@ func (is *IndexerService) OnStart() error {
var batch *Batch
for {
select {
case e := <-blockHeadersCh:
case e, ok := <-blockHeadersCh:
if !ok {
return
}
numTxs = e.(types.EventDataNewBlockHeader).Header.NumTxs
batch = NewBatch(numTxs)
case e := <-txsCh:
case e, ok := <-txsCh:
if !ok {
return
}
if batch == nil {
panic("Expected pubsub to send block header first, but got tx event")
}


Loading…
Cancel
Save