aboutsummaryrefslogtreecommitdiffstats
path: root/ui/library.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-23 06:19:38 +0800
committerobscuren <geffobscura@gmail.com>2014-02-23 06:19:38 +0800
commitaa33a4b2fb9dc07468498decceb6fdb56d38f54d (patch)
tree995fdccb8b9c28aaf52e7f3889fc494aae19a878 /ui/library.go
parent2b967558cebcef9d3ef9719cbb28a5e596982a5d (diff)
downloadgo-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar.gz
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar.bz2
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar.lz
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar.xz
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.tar.zst
go-tangerine-aa33a4b2fb9dc07468498decceb6fdb56d38f54d.zip
Added some ui elements to make it easier to connect to nodes
Diffstat (limited to 'ui/library.go')
-rw-r--r--ui/library.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/library.go b/ui/library.go
index 36952e198..0dfb10ac7 100644
--- a/ui/library.go
+++ b/ui/library.go
@@ -5,7 +5,6 @@ import (
"fmt"
"github.com/ethereum/eth-go/ethchain"
"github.com/ethereum/eth-go/ethutil"
- "math/big"
)
type EthLib struct {
@@ -14,15 +13,18 @@ type EthLib struct {
txPool *ethchain.TxPool
}
-func (lib *EthLib) CreateTx(receiver string, amount uint64) string {
+func (lib *EthLib) CreateTx(receiver, a string) string {
hash, err := hex.DecodeString(receiver)
if err != nil {
return err.Error()
}
-
- tx := ethchain.NewTransaction(hash, big.NewInt(int64(amount)), []string{""})
data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
keyRing := ethutil.NewValueFromBytes(data)
+
+ amount := ethutil.Big(a)
+ tx := ethchain.NewTransaction(hash, amount, []string{""})
+ tx.Nonce = lib.blockManager.GetAddrState(keyRing.Get(1).Bytes()).Nonce
+
tx.Sign(keyRing.Get(0).Bytes())
lib.txPool.QueueTransaction(tx)