Browse Source

state: cleanup block indexing logs and null (#6263)

pull/6273/head
Aleksandr Bezobchuk 4 years ago
committed by GitHub
parent
commit
d43a79ddf6
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions
  1. +3
    -2
      state/indexer/block/null/null.go
  2. +1
    -1
      state/txindex/indexer_service.go

+ 3
- 2
state/indexer/block/null/null.go View File

@ -2,6 +2,7 @@ package null
import (
"context"
"errors"
"github.com/tendermint/tendermint/libs/pubsub/query"
"github.com/tendermint/tendermint/state/indexer"
@ -14,7 +15,7 @@ var _ indexer.BlockIndexer = (*BlockerIndexer)(nil)
type BlockerIndexer struct{}
func (idx *BlockerIndexer) Has(height int64) (bool, error) {
return false, nil
return false, errors.New(`indexing is disabled (set 'tx_index = "kv"' in config)`)
}
func (idx *BlockerIndexer) Index(types.EventDataNewBlockHeader) error {
@ -22,5 +23,5 @@ func (idx *BlockerIndexer) Index(types.EventDataNewBlockHeader) error {
}
func (idx *BlockerIndexer) Search(ctx context.Context, q *query.Query) ([]int64, error) {
return nil, nil
return []int64{}, nil
}

+ 1
- 1
state/txindex/indexer_service.go View File

@ -79,7 +79,7 @@ func (is *IndexerService) OnStart() error {
if err := is.blockIdxr.Index(eventDataHeader); err != nil {
is.Logger.Error("failed to index block", "height", height, "err", err)
} else {
is.Logger.Error("indexed block", "height", height, "err", err)
is.Logger.Error("indexed block", "height", height)
}
if err = is.txIdxr.AddBatch(batch); err != nil {


Loading…
Cancel
Save