diff options
author | obscuren <geffobscura@gmail.com> | 2014-05-26 06:10:38 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-05-26 06:10:38 +0800 |
commit | b42c70be9c669ba372ed99d820a5a9e807191619 (patch) | |
tree | 5961ae05d0a89c7a807171c768d092a2396dcd7f /ethereal/ui/gui.go | |
parent | d35380c19e5ce92b57158e7780f7105dc4136916 (diff) | |
download | go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar.gz go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar.bz2 go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar.lz go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar.xz go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.tar.zst go-tangerine-b42c70be9c669ba372ed99d820a5a9e807191619.zip |
Recv send for txs
Diffstat (limited to 'ethereal/ui/gui.go')
-rw-r--r-- | ethereal/ui/gui.go | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ethereal/ui/gui.go b/ethereal/ui/gui.go index 022f192bf..a8bfb2b58 100644 --- a/ethereal/ui/gui.go +++ b/ethereal/ui/gui.go @@ -151,7 +151,15 @@ func (gui *Gui) readPreviousTransactions() { for it.Next() { tx := ethchain.NewTransactionFromBytes(it.Value()) - gui.win.Root().Call("addTx", ethpub.NewPTx(tx)) + var inout string + if bytes.Compare(tx.Sender(), gui.addr) == 0 { + inout = "send" + } else { + inout = "recv" + } + + gui.win.Root().Call("addTx", ethpub.NewPTx(tx), inout) + } it.Release() } @@ -207,12 +215,12 @@ func (gui *Gui) update() { object := state.GetAccount(gui.addr) if bytes.Compare(tx.Sender(), gui.addr) == 0 { - gui.win.Root().Call("addTx", ethpub.NewPTx(tx)) + gui.win.Root().Call("addTx", ethpub.NewPTx(tx), "send") gui.txDb.Put(tx.Hash(), tx.RlpEncode()) unconfirmedFunds.Sub(unconfirmedFunds, tx.Value) } else if bytes.Compare(tx.Recipient, gui.addr) == 0 { - gui.win.Root().Call("addTx", ethpub.NewPTx(tx)) + gui.win.Root().Call("addTx", ethpub.NewPTx(tx), "recv") gui.txDb.Put(tx.Hash(), tx.RlpEncode()) unconfirmedFunds.Add(unconfirmedFunds, tx.Value) @@ -261,7 +269,5 @@ func (gui *Gui) Transact(recipient, value, gas, gasPrice, data string) (*ethpub. func (gui *Gui) Create(recipient, value, gas, gasPrice, data string) (*ethpub.PReceipt, error) { keyPair := ethutil.GetKeyRing().Get(0) - //mainInput, initInput := mutan.PreParse(data) - return gui.pub.Create(ethutil.Hex(keyPair.PrivateKey), value, gas, gasPrice, data) } |