Skip to content

Commit

Permalink
Implemented transaction catching up. Implements #73
Browse files Browse the repository at this point in the history
  • Loading branch information
Maran committed Jun 3, 2014
1 parent 9e411d7 commit cc1d043
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ethereal/ui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit cc1d043

Please sign in to comment.