diff options
author | Maran <maran.hidskes@gmail.com> | 2014-05-26 23:07:20 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-05-26 23:07:20 +0800 |
commit | 5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e (patch) | |
tree | 5da1f9e44916711eedb5388c62eaf9e40c31a78a /ethereal/ui | |
parent | 5374a95c581f45f840d1e8a993fb8e403e9d4aec (diff) | |
download | go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar.gz go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar.bz2 go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar.lz go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar.xz go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.tar.zst go-tangerine-5fc6ee6a4acd1db22a38abb4cff5e5196bf1538e.zip |
Implemented simple block/tx explorer
Diffstat (limited to 'ethereal/ui')
-rw-r--r-- | ethereal/ui/gui.go | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 8d6796ddb..794786d97 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -136,14 +136,20 @@ func (gui *Gui) createWindow(comp qml.Object) *qml.Window { return gui.win } - -func (gui *Gui) setInitialBlockChain() { - // Load previous 10 blocks - chain := gui.eth.BlockChain().GetChain(gui.eth.BlockChain().CurrentBlock.Hash(), 10) - for _, block := range chain { - gui.processBlock(block) +func (gui *Gui) recursiveAdd(sBlk []byte) { + blk := gui.eth.BlockChain().GetBlock(sBlk) + if blk != nil { + //ethutil.Config.Log.Infoln("Adding block", blk) + 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() { |