diff options
author | Maran <maran.hidskes@gmail.com> | 2014-03-20 18:20:10 +0800 |
---|---|---|
committer | Maran <maran.hidskes@gmail.com> | 2014-03-20 18:20:10 +0800 |
commit | 3002570085c6823da4b8e12015eafa4bd87177fb (patch) | |
tree | efa5e702ae4db4b7ead3dde96613842c5c722b4b /ui/library.go | |
parent | 07734c1e1c5a28d1d44de696d83190bc59f239f7 (diff) | |
download | dexon-3002570085c6823da4b8e12015eafa4bd87177fb.tar.gz dexon-3002570085c6823da4b8e12015eafa4bd87177fb.tar.zst dexon-3002570085c6823da4b8e12015eafa4bd87177fb.zip |
Mining rework
Diffstat (limited to 'ui/library.go')
-rw-r--r-- | ui/library.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ui/library.go b/ui/library.go index 8412a8d6c..d6ce94b75 100644 --- a/ui/library.go +++ b/ui/library.go @@ -27,14 +27,15 @@ func (lib *EthLib) CreateTx(receiver, a, data string) string { } k, _ := ethutil.Config.Db.Get([]byte("KeyRing")) - keyRing := ethutil.NewValueFromBytes(k) + keyPair := ethutil.NewKeyFromBytes(k) amount := ethutil.Big(a) code := ethchain.Compile(strings.Split(data, "\n")) tx := ethchain.NewTransaction(hash, amount, code) - tx.Nonce = lib.stateManager.GetAddrState(keyRing.Get(1).Bytes()).Nonce + tx.Nonce = lib.stateManager.GetAddrState(keyPair.Address()).Nonce + + tx.Sign(keyPair.PrivateKey) - tx.Sign(keyRing.Get(0).Bytes()) ethutil.Config.Log.Infof("nonce: %x", tx.Nonce) lib.txPool.QueueTransaction(tx) |