This commit is contained in:
Owain G. Ainsworth 2014-02-13 18:42:22 +00:00
parent 5f52df997c
commit 70eb389029

View file

@ -1576,7 +1576,7 @@ func VerifyMessage(icmd btcjson.Cmd) (interface{}, *btcjson.Error) {
} }
// decode base64 signature // decode base64 signature
sig, err := base64.StdEncoding.DecodeString(cmd.Signature) sig, err := base64.StdEncoding.DecodeString(cmd.Signature)
if err != nil { if err != nil {
return nil, &btcjson.Error{ return nil, &btcjson.Error{
Code: btcjson.ErrWallet.Code, Code: btcjson.ErrWallet.Code,
@ -1587,8 +1587,8 @@ func VerifyMessage(icmd btcjson.Cmd) (interface{}, *btcjson.Error) {
// Validate the signature - this just shows that it was valid at all. // Validate the signature - this just shows that it was valid at all.
// we will compare it with the key next. // we will compare it with the key next.
pk, wasCompressed, err := btcec.RecoverCompact(btcec.S256(), sig, pk, wasCompressed, err := btcec.RecoverCompact(btcec.S256(), sig,
btcwire.DoubleSha256([]byte("Bitcoin Signed Message:\n" + btcwire.DoubleSha256([]byte("Bitcoin Signed Message:\n"+
cmd.Message))) cmd.Message)))
if err != nil { if err != nil {
return nil, &btcjson.Error{ return nil, &btcjson.Error{
Code: btcjson.ErrWallet.Code, Code: btcjson.ErrWallet.Code,