diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2016-12-13 03:46:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-13 03:46:15 +0800 |
commit | a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b (patch) | |
tree | faccd87d6e1634b51f788fa170bc1f03a829ca42 /light/odr.go | |
parent | ee445a2ba4013f8b32e4e5386322babf022e5b81 (diff) | |
parent | f12f8a6c14dbaf6e6531cea1b0cf169b851e1894 (diff) | |
download | go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar.gz go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar.bz2 go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar.lz go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar.xz go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.tar.zst go-tangerine-a98e8c0889d7c4c1bded452c577bd4b9c7fa0f6b.zip |
Merge pull request #3413 from zsfelfoldi/light-topic4
les, p2p/discv5: implement server pool, improve peer selection, light fetcher and topic searching
Diffstat (limited to 'light/odr.go')
-rw-r--r-- | light/odr.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/light/odr.go b/light/odr.go index 679569bf9..4f6ef6b9e 100644 --- a/light/odr.go +++ b/light/odr.go @@ -48,6 +48,7 @@ type OdrRequest interface { // TrieID identifies a state or account storage trie type TrieID struct { BlockHash, Root common.Hash + BlockNumber uint64 AccKey []byte } @@ -55,9 +56,10 @@ type TrieID struct { // header. func StateTrieID(header *types.Header) *TrieID { return &TrieID{ - BlockHash: header.Hash(), - AccKey: nil, - Root: header.Root, + BlockHash: header.Hash(), + BlockNumber: header.Number.Uint64(), + AccKey: nil, + Root: header.Root, } } @@ -66,9 +68,10 @@ func StateTrieID(header *types.Header) *TrieID { // checking Merkle proofs. func StorageTrieID(state *TrieID, addr common.Address, root common.Hash) *TrieID { return &TrieID{ - BlockHash: state.BlockHash, - AccKey: crypto.Keccak256(addr[:]), - Root: root, + BlockHash: state.BlockHash, + BlockNumber: state.BlockNumber, + AccKey: crypto.Keccak256(addr[:]), + Root: root, } } |