mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-12 21:01:21 +00:00
add config option for tx indexing and disable it by default
This commit is contained in:
@ -44,6 +44,7 @@ type State struct {
|
||||
TxIndexer tx.Indexer `json:"-"` // Transaction indexer.
|
||||
}
|
||||
|
||||
// Used in tests.
|
||||
func LoadState(db dbm.DB) *State {
|
||||
return loadState(db, stateKey)
|
||||
}
|
||||
@ -132,8 +133,13 @@ func GetState(config cfg.Config, stateDB dbm.DB) *State {
|
||||
}
|
||||
|
||||
// Transaction indexing
|
||||
store := dbm.NewDB("tx_indexer", config.GetString("db_backend"), config.GetString("db_dir"))
|
||||
state.TxIndexer = txindexer.NewKV(store)
|
||||
switch config.GetString("tx_indexer") {
|
||||
case "kv":
|
||||
store := dbm.NewDB("tx_indexer", config.GetString("db_backend"), config.GetString("db_dir"))
|
||||
state.TxIndexer = txindexer.NewKV(store)
|
||||
default:
|
||||
state.TxIndexer = &txindexer.Null{}
|
||||
}
|
||||
|
||||
return state
|
||||
}
|
||||
|
Reference in New Issue
Block a user