Commit 0a8e6898 authored by vicotor's avatar vicotor

fix bug

parent cd62f036
......@@ -9,6 +9,7 @@ import (
"fmt"
"github.com/ethereum/go-ethereum/crypto"
log "github.com/sirupsen/logrus"
"strings"
"sync"
"time"
......@@ -45,8 +46,10 @@ func New(_c *config.Config) (dao *Dao, err error) {
if len(_c.OTPKeyPath) > 0 && len(_c.AesKeyPath) > 0 {
pkstr, err := encpk.DecryptOTP(_c.AesKeyPath, _c.OTPKeyPath)
if err == nil {
if pk, err := crypto.HexToECDSA(string(pkstr)); err != nil {
log.WithError(err).Error("parse validator private key failed")
// trim pkstr space and \n.
originPk := strings.TrimSpace(string(pkstr))
if pk, err := crypto.HexToECDSA(string(originPk)); err != nil {
log.WithField("originpk", originPk).WithError(err).Error("parse validator private key failed")
} else {
dao.validatorPk = pk
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment