diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-27 16:29:39 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-27 16:29:39 +0800 |
commit | 47a58b40cd4ba764c9823448687307bb4a80c697 (patch) | |
tree | 8fb22006e8e447f7bfda3173ea219c8a699295fa /ethereal/ui/gui.go | |
parent | 474c85bc9d4b8ef88c933cf0fb9d58bf913f6cbe (diff) | |
download | go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar.gz go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar.bz2 go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar.lz go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar.xz go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.tar.zst go-tangerine-47a58b40cd4ba764c9823448687307bb4a80c697.zip |
Removed recursive function for loop
Diffstat (limited to 'ethereal/ui/gui.go')
-rw-r--r-- | ethereal/ui/gui.go | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 64c739c15..7577de1fa 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -136,20 +136,13 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window { return gui.win } -func (gui *Gui) recursiveAdd(sBlk []byte) { +func (gui *Gui) setInitialBlockChain() { + sBlk := gui.eth.BlockChain().LastBlockHash blk := gui.eth.BlockChain().GetBlock(sBlk) - if blk != nil { - //ethutil.Config.Log.Infoln("Adding block", blk) + for ; blk != nil; blk = gui.eth.BlockChain().GetBlock(sBlk) { + sBlk = blk.PrevHash gui.processBlock(blk) - gui.recursiveAdd(blk.PrevHash) - return - } else { - //ethutil.Config.Log.Debugln("At Genesis, added all blocks to GUI") } - return -} -func (gui *Gui) setInitialBlockChain() { - gui.recursiveAdd(gui.eth.BlockChain().LastBlockHash) } func (gui *Gui) readPreviousTransactions() { |