From 7232ecb1175314e0c026bbd0bb1cde5c320c931c Mon Sep 17 00:00:00 2001 From: ivoras Date: Sun, 10 Feb 2019 23:51:16 +0100 Subject: [PATCH] Fixed recording genesis public key --- cliactions.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cliactions.go b/cliactions.go index 93fd484..bc2f216 100644 --- a/cliactions.go +++ b/cliactions.go @@ -337,14 +337,14 @@ func actionNewChain(jsonFilename string) { // Write the public key into the genesis block pubKey, err := dbGetPublicKey(pubKeyHash) if err != nil { - log.Fatalln(err) + log.Fatalln("Error getting public key from db", err) } - selfSig, err := cryptoSignHex(pKey, pubKeyHash) + selfSig, err := cryptoSignPublicKeyHash(pKey, pubKeyHash) if err != nil { - log.Fatalln(err) + log.Fatalln("Error signing publicKey", err) } _, err = db.Exec("INSERT INTO _keys (op, pubkey_hash, pubkey, sigkey_hash, signature) VALUES (?, ?, ?, ?, ?)", - "A", pubKeyHash, hex.EncodeToString(pubKey.publicKeyBytes), pubKeyHash, selfSig) + "A", pubKeyHash, hex.EncodeToString(pubKey.publicKeyBytes), pubKeyHash, hex.EncodeToString(selfSig)) if err != nil { log.Fatalln("Error recording the genesis block public key") }