Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixing time lag on starting node #923

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ func NewNode(genDoc *genesis.Genesis, conf *config.Config,
"version", version.Version(),
"network", genDoc.ChainType())

net, err := network.NewNetwork(conf.Network)
if err != nil {
return nil, err
}
messageCh := make(chan message.Message, 500)
eventCh := make(chan event.Event, 500)
if !conf.Nanomsg.Enable {
Expand All @@ -60,7 +56,6 @@ func NewNode(genDoc *genesis.Genesis, conf *config.Config,

txPool := txpool.NewTxPool(conf.TxPool, messageCh)

// TODO implement dequeue for recent transaction
str, err := store.NewStore(conf.Store)
if err != nil {
return nil, err
Expand All @@ -71,6 +66,11 @@ func NewNode(genDoc *genesis.Genesis, conf *config.Config,
return nil, err
}

net, err := network.NewNetwork(conf.Network)
if err != nil {
return nil, err
}

consMgr := consensus.NewManager(conf.Consensus, st, valKeys, rewardAddrs, messageCh)

syn, err := sync.NewSynchronizer(conf.Sync, valKeys, st, consMgr, net, messageCh)
Expand Down
Loading