You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
509 B

7 years ago
7 years ago
  1. package null
  2. import (
  3. "errors"
  4. "github.com/tendermint/tendermint/state/txindex"
  5. "github.com/tendermint/tendermint/types"
  6. )
  7. // TxIndex acts as a /dev/null.
  8. type TxIndex struct{}
  9. // Get on a TxIndex is disabled and panics when invoked.
  10. func (txi *TxIndex) Get(hash []byte) (*types.TxResult, error) {
  11. return nil, errors.New(`Indexing is disabled (set 'tx_index = "kv"' in config)`)
  12. }
  13. // AddBatch is a noop and always returns nil.
  14. func (txi *TxIndex) AddBatch(batch *txindex.Batch) error {
  15. return nil
  16. }