aboutsummaryrefslogtreecommitdiffstats
path: root/les/commons.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-09-20 19:11:14 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-20 19:14:48 +0800
commitaf89093116d2a4657c79d55f61b4293753b52588 (patch)
tree73a0b04eb9e3965be98219649f12595d9a26379c /les/commons.go
parentf89dce0126f92eb5f3245f6b8e8b1e3ac13641b3 (diff)
downloadgo-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar.gz
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar.bz2
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar.lz
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar.xz
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.tar.zst
go-tangerine-af89093116d2a4657c79d55f61b4293753b52588.zip
les, light, params: update light client CHTs
Diffstat (limited to 'les/commons.go')
-rw-r--r--les/commons.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/les/commons.go b/les/commons.go
index a97687993..0b6cf3711 100644
--- a/les/commons.go
+++ b/les/commons.go
@@ -42,12 +42,12 @@ type lesCommons struct {
// NodeInfo represents a short summary of the Ethereum sub-protocol metadata
// known about the host peer.
type NodeInfo struct {
- Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
- Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
- Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
- Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
- Head common.Hash `json:"head"` // SHA3 hash of the host's best owned block
- CHT light.TrustedCheckpoint `json:"cht"` // Trused CHT checkpoint for fast catchup
+ Network uint64 `json:"network"` // Ethereum network ID (1=Frontier, 2=Morden, Ropsten=3, Rinkeby=4)
+ Difficulty *big.Int `json:"difficulty"` // Total difficulty of the host's blockchain
+ Genesis common.Hash `json:"genesis"` // SHA3 hash of the host's genesis block
+ Config *params.ChainConfig `json:"config"` // Chain configuration for the fork rules
+ Head common.Hash `json:"head"` // SHA3 hash of the host's best owned block
+ CHT params.TrustedCheckpoint `json:"cht"` // Trused CHT checkpoint for fast catchup
}
// makeProtocols creates protocol descriptors for the given LES versions.
@@ -76,7 +76,7 @@ func (c *lesCommons) makeProtocols(versions []uint) []p2p.Protocol {
// nodeInfo retrieves some protocol metadata about the running host node.
func (c *lesCommons) nodeInfo() interface{} {
- var cht light.TrustedCheckpoint
+ var cht params.TrustedCheckpoint
sections, _, _ := c.chtIndexer.Sections()
sections2, _, _ := c.bloomTrieIndexer.Sections()
@@ -98,11 +98,11 @@ func (c *lesCommons) nodeInfo() interface{} {
idxV2 := (sectionIndex+1)*c.iConfig.PairChtSize/c.iConfig.ChtSize - 1
chtRoot = light.GetChtRoot(c.chainDb, idxV2, sectionHead)
}
- cht = light.TrustedCheckpoint{
- SectionIdx: sectionIndex,
- SectionHead: sectionHead,
- CHTRoot: chtRoot,
- BloomRoot: light.GetBloomTrieRoot(c.chainDb, sectionIndex, sectionHead),
+ cht = params.TrustedCheckpoint{
+ SectionIndex: sectionIndex,
+ SectionHead: sectionHead,
+ CHTRoot: chtRoot,
+ BloomRoot: light.GetBloomTrieRoot(c.chainDb, sectionIndex, sectionHead),
}
}