Browse Source

config: disable_data_hash (for testing)

pull/205/head
Ethan Buchman 9 years ago
parent
commit
898f44ddda
3 changed files with 6 additions and 0 deletions
  1. +1
    -0
      config/tendermint/config.go
  2. +1
    -0
      config/tendermint_test/config.go
  3. +4
    -0
      types/block.go

+ 1
- 0
config/tendermint/config.go View File

@ -70,6 +70,7 @@ func GetConfig(rootDir string) cfg.Config {
mapConfig.SetDefault("cswal_light", false) mapConfig.SetDefault("cswal_light", false)
mapConfig.SetDefault("block_size", 10000) mapConfig.SetDefault("block_size", 10000)
mapConfig.SetDefault("disable_data_hash", false)
mapConfig.SetDefault("timeout_propose", 3000) mapConfig.SetDefault("timeout_propose", 3000)
mapConfig.SetDefault("timeout_propose_delta", 500) mapConfig.SetDefault("timeout_propose_delta", 500)
mapConfig.SetDefault("timeout_prevote", 1000) mapConfig.SetDefault("timeout_prevote", 1000)


+ 1
- 0
config/tendermint_test/config.go View File

@ -88,6 +88,7 @@ func GetConfig(rootDir string) cfg.Config {
mapConfig.SetDefault("cswal_light", false) mapConfig.SetDefault("cswal_light", false)
mapConfig.SetDefault("block_size", 10000) mapConfig.SetDefault("block_size", 10000)
mapConfig.SetDefault("disable_data_hash", false)
mapConfig.SetDefault("timeout_propose", 100) mapConfig.SetDefault("timeout_propose", 100)
mapConfig.SetDefault("timeout_propose_delta", 1) mapConfig.SetDefault("timeout_propose_delta", 1)
mapConfig.SetDefault("timeout_prevote", 1) mapConfig.SetDefault("timeout_prevote", 1)


+ 4
- 0
types/block.go View File

@ -336,6 +336,10 @@ type Data struct {
} }
func (data *Data) Hash() []byte { func (data *Data) Hash() []byte {
if config.GetBool("disable_data_hash") {
data.hash = []byte{}
return data.hash
}
if data.hash == nil { if data.hash == nil {
txs := make([]interface{}, len(data.Txs)) txs := make([]interface{}, len(data.Txs))
for i, tx := range data.Txs { for i, tx := range data.Txs {


Loading…
Cancel
Save