aboutsummaryrefslogtreecommitdiffstats
path: root/ethereum.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-09 06:25:48 +0800
committerobscuren <geffobscura@gmail.com>2014-02-09 06:25:48 +0800
commit7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d (patch)
treeb0bad7606a9997d7f52f82e61122332017f833e6 /ethereum.go
parentc2bb5e39e10e781404034b3018d753699247edd1 (diff)
downloaddexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar.gz
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar.bz2
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar.lz
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar.xz
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.tar.zst
dexon-7b7242b9ea85ccdcc29dc9b515eb2d2776e2b50d.zip
Proper keys
Diffstat (limited to 'ethereum.go')
-rw-r--r--ethereum.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/ethereum.go b/ethereum.go
index 716507d53..bf379184f 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -38,7 +38,7 @@ func CreateKeyPair(force bool) {
log.Printf("Your new address is %x\n", pub[12:])
- ethutil.Config.Db.Put([]byte("KeyRing"), prv)
+ ethutil.Config.Db.Put([]byte("KeyRing"), ethutil.Encode([]interface{}{prv, pub}))
}
}
@@ -108,7 +108,9 @@ func main() {
// Fake block mining. It broadcasts a new block every 5 seconds
go func() {
pow := &ethchain.EasyPow{}
- addr, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
+ data, _ := ethutil.Config.Db.Get([]byte("KeyRing"))
+ keyRing := ethutil.NewValueFromBytes(data)
+ addr := keyRing.Get(1).Bytes()
for {
txs := ethereum.TxPool.Flush()