docs: Add missing changelog entry and comment (#2451)
Follow-up on https://github.com/tendermint/tendermint/pull/2411
This commit is contained in:
parent
0d6b75bd53
commit
bd951171db
|
@ -26,6 +26,7 @@ FEATURES:
|
||||||
* \#2310 Mempool is now aware of the MaxGas requirement
|
* \#2310 Mempool is now aware of the MaxGas requirement
|
||||||
|
|
||||||
IMPROVEMENTS:
|
IMPROVEMENTS:
|
||||||
|
- [libs/db] \#2371 Output error instead of panic when the given db_backend is not initialised (@bradyjoestar)
|
||||||
- [mempool] [\#2399](https://github.com/tendermint/tendermint/issues/2399) Make mempool cache a proper LRU (@bradyjoestar)
|
- [mempool] [\#2399](https://github.com/tendermint/tendermint/issues/2399) Make mempool cache a proper LRU (@bradyjoestar)
|
||||||
- [types] add Address to GenesisValidator [\#1714](https://github.com/tendermint/tendermint/issues/1714)
|
- [types] add Address to GenesisValidator [\#1714](https://github.com/tendermint/tendermint/issues/1714)
|
||||||
- [metrics] `consensus.block_interval_metrics` is now gauge, not histogram (you will be able to see spikes, if any)
|
- [metrics] `consensus.block_interval_metrics` is now gauge, not histogram (you will be able to see spikes, if any)
|
||||||
|
|
|
@ -30,19 +30,23 @@ func registerDBCreator(backend DBBackendType, creator dbCreator, force bool) {
|
||||||
backends[backend] = creator
|
backends[backend] = creator
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NewDB creates a new database of type backend with the given name.
|
||||||
|
// NOTE: function panics if:
|
||||||
|
// - backend is unknown (not registered)
|
||||||
|
// - creator function, provided during registration, returns error
|
||||||
func NewDB(name string, backend DBBackendType, dir string) DB {
|
func NewDB(name string, backend DBBackendType, dir string) DB {
|
||||||
dbCreator, ok := backends[backend]
|
dbCreator, ok := backends[backend]
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
var keys []string
|
keys := make([]string, len(backends))
|
||||||
for k, _ := range backends {
|
i := 0
|
||||||
keys = append(keys, string(k))
|
for k := range backends {
|
||||||
|
keys[i] = string(k)
|
||||||
|
i++
|
||||||
}
|
}
|
||||||
panic(fmt.Sprintf("Unknown db_backend %s, expected either %s", backend, strings.Join(keys, " or ")))
|
panic(fmt.Sprintf("Unknown db_backend %s, expected either %s", backend, strings.Join(keys, " or ")))
|
||||||
}
|
}
|
||||||
|
|
||||||
db, err := dbCreator(name, dir)
|
db, err := dbCreator(name, dir)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(fmt.Sprintf("Error initializing DB: %v", err))
|
panic(fmt.Sprintf("Error initializing DB: %v", err))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue