File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 "sync"
88 "time"
99
10+ "github.com/ethereum/go-ethereum/common"
1011 "github.com/ethereum/go-ethereum/core/types"
1112 "github.com/ethereum/go-ethereum/errs"
1213)
@@ -471,6 +472,7 @@ func (self *peer) getBlockHashes() {
471472 }
472473 }
473474 headKey := self .parentHash .Str ()
475+ height := self .bp .status .chain [headKey ] + 1
474476 self .bp .status .chain [self .currentBlockHash .Str ()] = height
475477 if height > self .bp .status .values .LongestChain {
476478 self .bp .status .values .LongestChain = height
Original file line number Diff line number Diff line change @@ -170,8 +170,8 @@ func TestPeerPromotionByOptionalTdOnBlock(t *testing.T) {
170170 hashes := blockPoolTester .hashPool .IndexesToHashes ([]int {2 , 3 })
171171 peer1 .waitBlocksRequests (3 )
172172 blockPool .AddBlock (& types.Block {
173- HeaderHash : common .Bytes (hashes [1 ]),
174- ParentHeaderHash : common .Bytes (hashes [0 ]),
173+ HeaderHash : common .Hash (hashes [1 ]),
174+ ParentHeaderHash : common .Hash (hashes [0 ]),
175175 Td : common .Big3 ,
176176 }, "peer1" )
177177
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ func (self *section) addSectionToBlockChain(p *peer) {
117117 break
118118 }
119119 self .poolRootIndex --
120- keys = append (keys , node .hash .Str ())
120+ keys = append (keys , n .hash .Str ())
121121 blocks = append (blocks , block )
122122 nodes = append (nodes , n )
123123 }
You can’t perform that action at this time.
0 commit comments