diff options
author | Maran <maran.hidskes@gmail.com> | 2014-06-03 17:48:44 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-06-03 17:48:44 +0800 |
commit | cc1d043423293eff97d01c8f4897b354112c8210 (patch) | |
tree | 0f986966d5dd94b946e6dea0ddae03314978b950 | |
parent | 9e411d785bc4e104183dda537488f8aa2906ec13 (diff) | |
download | go-tangerine-cc1d043423293eff97d01c8f4897b354112c8210.tar.gz go-tangerine-cc1d043423293eff97d01c8f4897b354112c8210.tar.zst go-tangerine-cc1d043423293eff97d01c8f4897b354112c8210.zip |
Implemented transaction catching up. Implements #73
-rw-r--r-- | ethereal/ui/gui.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index db06add8e..701bacf00 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -163,6 +163,17 @@ func (gui *Gui) setInitialBlockChain() { blk := gui.eth.BlockChain().GetBlock(sBlk) for ; blk != nil; blk = gui.eth.BlockChain().GetBlock(sBlk) { sBlk = blk.PrevHash + + // Loop through all transactions to see if we missed any while being offline + for _, tx := range blk.Transactions() { + if bytes.Compare(tx.Sender(), gui.addr) == 0 || bytes.Compare(tx.Recipient, gui.addr) == 0 { + if ok, _ := gui.txDb.Get(tx.Hash()); ok == nil { + gui.txDb.Put(tx.Hash(), tx.RlpEncode()) + } + + } + } + gui.processBlock(blk, true) } } |