aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-02-10 06:35:02 +0800
committerobscuren <geffobscura@gmail.com>2014-02-10 06:35:02 +0800
commit8320fd998ee5d140b7bc99d071567f4c4c97901f (patch)
tree97509fdae79fb85e6a58ddf854eb904233ed2026
parent37a89e577c25afe0e0388f154eba1fb97a972971 (diff)
downloaddexon-8320fd998ee5d140b7bc99d071567f4c4c97901f.tar.gz
dexon-8320fd998ee5d140b7bc99d071567f4c4c97901f.tar.zst
dexon-8320fd998ee5d140b7bc99d071567f4c4c97901f.zip
Added pub key to keyring
-rw-r--r--ethereum.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/ethereum.go b/ethereum.go
index 4584ff85c..df9eb2387 100644
--- a/ethereum.go
+++ b/ethereum.go
@@ -35,10 +35,13 @@ func CreateKeyPair(force bool) {
log.Println("Generating new address and keypair")
pub, prv := secp256k1.GenerateKeyPair()
+ addr := ethutil.Sha3Bin(pub)[12:]
- log.Printf("Your new address is %x\n", ethutil.Sha3Bin(pub)[12:])
+ log.Printf("Your new address is %x\n", addr)
+ log.Printf("Your new pubkey is %x (%d)\n", pub, len(pub))
- ethutil.Config.Db.Put([]byte("KeyRing"), ethutil.Encode([]interface{}{prv, ethutil.Sha3Bin(pub)[12:]}))
+ keyRing := ethutil.NewValue([]interface{}{prv, addr, pub})
+ ethutil.Config.Db.Put([]byte("KeyRing"), keyRing.Encode())
}
}
@@ -103,7 +106,7 @@ func main() {
ethereum.Start()
if StartMining {
- log.Printf("Dev Test Mining started...\n")
+ log.Printf("Miner started\n")
// Fake block mining. It broadcasts a new block every 5 seconds
go func() {