"log_mode" : true
},
"check_frequency_seconds" : 60,
- "bootstrap_nodes" : [
+ "seeds" : [
{
"alias" : "seed1",
"xpub" : "f2767279cd01ed8793808e0542a18958e1a2f3a6b6fe5328ec79596a022bc6f085951a98a631917563f86bb91db9159dd2969ff9d690fc12b250baff2b6f6a1d",
MySQLConfig common.MySQLConfig `json:"mysql"`
CheckFreqSeconds uint64 `json:"check_frequency_seconds"`
Policy Policy `json:"policy"`
- Nodes []Node `json:"bootstrap_nodes"`
+ Nodes []Node `json:"seeds"`
API API `json:"api"`
}
)
type monitor struct {
- cfg *config.Config
- db *gorm.DB
- nodeCfg *vaporCfg.Config
- sw *p2p.Switch
- discvCh chan *dht.Node
- privKey chainkd.XPrv
- chain *mock.Chain
- txPool *mock.Mempool
+ cfg *config.Config
+ db *gorm.DB
+ nodeCfg *vaporCfg.Config
+ sw *p2p.Switch
+ discvCh chan *dht.Node
+ privKey chainkd.XPrv
+ chain *mock.Chain
+ txPool *mock.Mempool
+ tryConnectStartCh chan struct{}
+ tryConnectEndCh chan struct{}
}
// TODO: set myself as SPV?
}
return &monitor{
- cfg: cfg,
- db: db,
- nodeCfg: nodeCfg,
- discvCh: discvCh,
- privKey: privKey.(chainkd.XPrv),
- chain: chain,
- txPool: txPool,
+ cfg: cfg,
+ db: db,
+ nodeCfg: nodeCfg,
+ discvCh: discvCh,
+ privKey: privKey.(chainkd.XPrv),
+ chain: chain,
+ txPool: txPool,
+ tryConnectStartCh: make(chan struct{}, 1),
+ tryConnectEndCh: make(chan struct{}, 1),
}
}