Fixed unconfirmed balance string

This commit is contained in:
obscuren 2014-05-21 13:37:46 +02:00
parent 16bd88c10a
commit 68f4a12a8b

View File

@ -164,7 +164,7 @@ func (gui *Gui) setWalletValue(amount, unconfirmedFunds *big.Int) {
var str string var str string
if unconfirmedFunds != nil { if unconfirmedFunds != nil {
pos := "+" pos := "+"
if unconfirmedFunds.Cmp(big.NewInt(0)) >= 0 { if unconfirmedFunds.Cmp(big.NewInt(0)) < 0 {
pos = "-" pos = "-"
} }
val := ethutil.CurrencyToString(new(big.Int).Abs(ethutil.BigCopy(unconfirmedFunds))) val := ethutil.CurrencyToString(new(big.Int).Abs(ethutil.BigCopy(unconfirmedFunds)))
@ -206,15 +206,10 @@ func (gui *Gui) update() {
if txMsg.Event == "newTx:pre" { if txMsg.Event == "newTx:pre" {
object := state.GetAccount(gui.addr) object := state.GetAccount(gui.addr)
if bytes.Compare(tx.Sender(), gui.addr) == 0 && object.Nonce <= tx.Nonce { if bytes.Compare(tx.Sender(), gui.addr) == 0 {
gui.win.Root().Call("addTx", ethpub.NewPTx(tx)) gui.win.Root().Call("addTx", ethpub.NewPTx(tx))
gui.txDb.Put(tx.Hash(), tx.RlpEncode()) gui.txDb.Put(tx.Hash(), tx.RlpEncode())
/*
object.Nonce += 1
state.SetStateObject(object)
*/
unconfirmedFunds.Sub(unconfirmedFunds, tx.Value) unconfirmedFunds.Sub(unconfirmedFunds, tx.Value)
} else if bytes.Compare(tx.Recipient, gui.addr) == 0 { } 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))