From 1bffb6708af7137c0def20d1c4f1fe1b5c48f8b6 Mon Sep 17 00:00:00 2001 From: paladz <453256728@qq.com> Date: Fri, 13 Apr 2018 13:30:49 +0800 Subject: [PATCH] rename the variable --- protocol/block.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/protocol/block.go b/protocol/block.go index 3edd556c..e9d1af35 100644 --- a/protocol/block.go +++ b/protocol/block.go @@ -41,16 +41,16 @@ func (c *Chain) calcReorganizeNodes(node *state.BlockNode) ([]*state.BlockNode, var attachNodes []*state.BlockNode var detachNodes []*state.BlockNode - attachIter := node - for c.index.NodeByHeight(attachIter.Height) != attachIter { - attachNodes = append([]*state.BlockNode{attachIter}, attachNodes...) - attachIter = attachIter.Parent + attachNode := node + for c.index.NodeByHeight(attachNode.Height) != attachNode { + attachNodes = append([]*state.BlockNode{attachNode}, attachNodes...) + attachNode = attachNode.Parent } - detachIter := c.bestNode - for detachIter != attachIter { - detachNodes = append(detachNodes, detachIter) - detachIter = detachIter.Parent + detachNode := c.bestNode + for detachNode != attachNode { + detachNodes = append(detachNodes, detachNode) + detachNode = detachNode.Parent } return attachNodes, detachNodes } -- 2.11.0