OSDN Git Service
(root)
/
bytom
/
vapor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
send standby node reward (#358)
[bytom/vapor.git]
/
node
/
node.go
diff --git
a/node/node.go
b/node/node.go
index
764edf4
..
531ff83
100644
(file)
--- a/
node/node.go
+++ b/
node/node.go
@@
-75,7
+75,9
@@
func NewNode(config *cfg.Config) *Node {
}).Info()
initLogFile(config)
}).Info()
initLogFile(config)
- initActiveNetParams(config)
+ if err := consensus.InitActiveNetParams(config.ChainID); err != nil {
+ log.Fatalf("Failed to init ActiveNetParams:[%s]", err.Error())
+ }
initCommonConfig(config)
// Get store
initCommonConfig(config)
// Get store
@@
-124,8
+126,8
@@
func NewNode(config *cfg.Config) *Node {
wallet.RescanBlocks()
}
}
wallet.RescanBlocks()
}
}
-
- syncManager, err := netsync.NewSyncManager(config, chain, txPool, dispatcher)
+ fastSyncDB := dbm.NewDB("fastsync", config.DBBackend, config.DBDir())
+ syncManager, err := netsync.NewSyncManager(config, chain, txPool, dispatcher
, fastSyncDB
)
if err != nil {
cmn.Exit(cmn.Fmt("Failed to create sync manager: %v", err))
}
if err != nil {
cmn.Exit(cmn.Fmt("Failed to create sync manager: %v", err))
}
@@
-135,7
+137,7
@@
func NewNode(config *cfg.Config) *Node {
// run the profile server
profileHost := config.ProfListenAddress
if profileHost != "" {
// run the profile server
profileHost := config.ProfListenAddress
if profileHost != "" {
- // Profiling
bytom
d programs.see (https://blog.golang.org/profiling-go-programs)
+ // Profiling
vapor
d programs.see (https://blog.golang.org/profiling-go-programs)
// go tool pprof http://profileHose/debug/pprof/heap
go func() {
if err = http.ListenAndServe(profileHost, nil); err != nil {
// go tool pprof http://profileHose/debug/pprof/heap
go func() {
if err = http.ListenAndServe(profileHost, nil); err != nil {
@@
-186,14
+188,6
@@
func lockDataDirectory(config *cfg.Config) error {
return nil
}
return nil
}
-func initActiveNetParams(config *cfg.Config) {
- var exist bool
- consensus.ActiveNetParams, exist = consensus.NetParams[config.ChainID]
- if !exist {
- cmn.Exit(cmn.Fmt("chain_id[%v] don't exist", config.ChainID))
- }
-}
-
func initLogFile(config *cfg.Config) {
if config.LogFile == "" {
return
func initLogFile(config *cfg.Config) {
if config.LogFile == "" {
return