Browse Source

Make fast_sync=true by default, with more relaxed conditions

pull/176/head
Jae Kwon 9 years ago
parent
commit
5a8a9bfd69
2 changed files with 3 additions and 4 deletions
  1. +1
    -2
      blockchain/pool.go
  2. +2
    -2
      config/tendermint/config.go

+ 1
- 2
blockchain/pool.go View File

@ -131,14 +131,13 @@ func (pool *BlockPool) IsCaughtUp() bool {
pool.mtx.Unlock() pool.mtx.Unlock()
pool.peersMtx.Lock() pool.peersMtx.Lock()
numPeers := len(pool.peers)
maxPeerHeight := 0 maxPeerHeight := 0
for _, peer := range pool.peers { for _, peer := range pool.peers {
maxPeerHeight = MaxInt(maxPeerHeight, peer.height) maxPeerHeight = MaxInt(maxPeerHeight, peer.height)
} }
pool.peersMtx.Unlock() pool.peersMtx.Unlock()
return numPeers >= 3 && (height > 0 || time.Now().Sub(pool.startTime) > 30*time.Second) && (maxPeerHeight == 0 || height == maxPeerHeight)
return (height > 0 || time.Now().Sub(pool.startTime) > 5*time.Second) && (maxPeerHeight == 0 || height == maxPeerHeight)
} }
// We need to see the second block's Validation to validate the first block. // We need to see the second block's Validation to validate the first block.


+ 2
- 2
config/tendermint/config.go View File

@ -56,7 +56,7 @@ func GetConfig(rootDir string) cfg.Config {
mapConfig.SetDefault("moniker", "anonymous") mapConfig.SetDefault("moniker", "anonymous")
mapConfig.SetDefault("node_laddr", "0.0.0.0:46656") mapConfig.SetDefault("node_laddr", "0.0.0.0:46656")
// mapConfig.SetDefault("seeds", "goldenalchemist.chaintest.net:46656") // mapConfig.SetDefault("seeds", "goldenalchemist.chaintest.net:46656")
mapConfig.SetDefault("fast_sync", false)
mapConfig.SetDefault("fast_sync", true)
mapConfig.SetDefault("skip_upnp", false) mapConfig.SetDefault("skip_upnp", false)
mapConfig.SetDefault("addrbook_file", rootDir+"/addrbook.json") mapConfig.SetDefault("addrbook_file", rootDir+"/addrbook.json")
mapConfig.SetDefault("priv_validator_file", rootDir+"/priv_validator.json") mapConfig.SetDefault("priv_validator_file", rootDir+"/priv_validator.json")
@ -77,7 +77,7 @@ proxy_app = "tcp://127.0.0.1:46658"
moniker = "__MONIKER__" moniker = "__MONIKER__"
node_laddr = "0.0.0.0:46656" node_laddr = "0.0.0.0:46656"
seeds = "" seeds = ""
fast_sync = false
fast_sync = true
db_backend = "leveldb" db_backend = "leveldb"
log_level = "notice" log_level = "notice"
rpc_laddr = "0.0.0.0:46657" rpc_laddr = "0.0.0.0:46657"


Loading…
Cancel
Save