diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 13:50:36 +0800 |
---|---|---|
committer | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-12-10 16:53:25 +0800 |
commit | f12f8a6c14dbaf6e6531cea1b0cf169b851e1894 (patch) | |
tree | 41f0d7dd9f5fe21cbb8615a59cc08b9594f83770 /les/server.go | |
parent | c57c54ce96628aeb6345776310123a80593f0143 (diff) | |
download | go-tangerine-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.tar.gz go-tangerine-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.tar.zst go-tangerine-f12f8a6c14dbaf6e6531cea1b0cf169b851e1894.zip |
les, light: add block availability check for ODR requests
Diffstat (limited to 'les/server.go')
-rw-r--r-- | les/server.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/les/server.go b/les/server.go index 03cc2bb5e..e55616a44 100644 --- a/les/server.go +++ b/les/server.go @@ -349,9 +349,8 @@ func (pm *ProtocolManager) blockLoop() { } var ( - lastChtKey = []byte("LastChtNumber") // chtNum (uint64 big endian) - chtPrefix = []byte("cht") // chtPrefix + chtNum (uint64 big endian) -> trie root hash - chtConfirmations = light.ChtFrequency / 2 + lastChtKey = []byte("LastChtNumber") // chtNum (uint64 big endian) + chtPrefix = []byte("cht") // chtPrefix + chtNum (uint64 big endian) -> trie root hash ) func getChtRoot(db ethdb.Database, num uint64) common.Hash { @@ -372,8 +371,8 @@ func makeCht(db ethdb.Database) bool { headNum := core.GetBlockNumber(db, headHash) var newChtNum uint64 - if headNum > chtConfirmations { - newChtNum = (headNum - chtConfirmations) / light.ChtFrequency + if headNum > light.ChtConfirmations { + newChtNum = (headNum - light.ChtConfirmations) / light.ChtFrequency } var lastChtNum uint64 |