Skip to content

Commit

Permalink
Fixed recording genesis public key
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoras committed Feb 10, 2019
1 parent f5fb66d commit 7232ecb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cliactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down

0 comments on commit 7232ecb

Please sign in to comment.