aboutsummaryrefslogtreecommitdiffstats
path: root/les/server.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2018-02-11 20:57:46 +0800
committerGitHub <noreply@github.com>2018-02-11 20:57:46 +0800
commit7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa (patch)
tree98bc8333d5672cd4faa6a13c9a59f902c277955f /les/server.go
parent5cf75a30c1ceb0ab35cd6b0532520d556996b21c (diff)
downloaddexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.gz
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.bz2
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.lz
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.xz
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.tar.zst
dexon-7a0019c63b1297cb5c9a6fdfc4cb00fdae9b05aa.zip
les, light: fix CHT trie retrievals (#16039)
* les, light: fix CHT trie retrievals * les, light: minor polishes, test remote CHT retrievals * les, light: deterministic nodeset rlp, bloombits test skeleton * les: add an event emission to the les bloombits test * les: drop dead tester code
Diffstat (limited to 'les/server.go')
-rw-r--r--les/server.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/les/server.go b/les/server.go
index 65b8c357d..28b87008a 100644
--- a/les/server.go
+++ b/les/server.go
@@ -20,7 +20,6 @@ package les
import (
"crypto/ecdsa"
"encoding/binary"
- "fmt"
"math"
"sync"
@@ -73,23 +72,22 @@ func NewLesServer(eth *eth.Ethereum, config *eth.Config) (*LesServer, error) {
logger := log.New()
chtV1SectionCount, _, _ := srv.chtIndexer.Sections() // indexer still uses LES/1 4k section size for backwards server compatibility
- chtV2SectionCount := chtV1SectionCount / (light.ChtFrequency / light.ChtV1Frequency)
+ chtV2SectionCount := chtV1SectionCount / (light.CHTFrequencyClient / light.CHTFrequencyServer)
if chtV2SectionCount != 0 {
// convert to LES/2 section
chtLastSection := chtV2SectionCount - 1
// convert last LES/2 section index back to LES/1 index for chtIndexer.SectionHead
- chtLastSectionV1 := (chtLastSection+1)*(light.ChtFrequency/light.ChtV1Frequency) - 1
+ chtLastSectionV1 := (chtLastSection+1)*(light.CHTFrequencyClient/light.CHTFrequencyServer) - 1
chtSectionHead := srv.chtIndexer.SectionHead(chtLastSectionV1)
chtRoot := light.GetChtV2Root(pm.chainDb, chtLastSection, chtSectionHead)
- logger.Info("CHT", "section", chtLastSection, "sectionHead", fmt.Sprintf("%064x", chtSectionHead), "root", fmt.Sprintf("%064x", chtRoot))
+ logger.Info("Loaded CHT", "section", chtLastSection, "head", chtSectionHead, "root", chtRoot)
}
-
bloomTrieSectionCount, _, _ := srv.bloomTrieIndexer.Sections()
if bloomTrieSectionCount != 0 {
bloomTrieLastSection := bloomTrieSectionCount - 1
bloomTrieSectionHead := srv.bloomTrieIndexer.SectionHead(bloomTrieLastSection)
bloomTrieRoot := light.GetBloomTrieRoot(pm.chainDb, bloomTrieLastSection, bloomTrieSectionHead)
- logger.Info("BloomTrie", "section", bloomTrieLastSection, "sectionHead", fmt.Sprintf("%064x", bloomTrieSectionHead), "root", fmt.Sprintf("%064x", bloomTrieRoot))
+ logger.Info("Loaded bloom trie", "section", bloomTrieLastSection, "head", bloomTrieSectionHead, "root", bloomTrieRoot)
}
srv.chtIndexer.Start(eth.BlockChain())