From 56097f0b367d54d527799cf4f6254b2360862b00 Mon Sep 17 00:00:00 2001 From: yyforyongyu Date: Mon, 15 Jul 2024 23:58:00 +0800 Subject: [PATCH] rpcserver: fix `SignCompact` --- rpcserver.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rpcserver.go b/rpcserver.go index a3c4062bcc..363661d787 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -3595,14 +3595,7 @@ func handleSignMessageWithPrivKey(s *rpcServer, cmd interface{}, closeChan <-cha wire.WriteVarString(&buf, 0, c.Message) messageHash := chainhash.DoubleHashB(buf.Bytes()) - sig, err := ecdsa.SignCompact(wif.PrivKey, - messageHash, wif.CompressPubKey) - if err != nil { - return nil, &btcjson.RPCError{ - Code: btcjson.ErrRPCInvalidAddressOrKey, - Message: "Sign failed", - } - } + sig := ecdsa.SignCompact(wif.PrivKey, messageHash, wif.CompressPubKey) return base64.StdEncoding.EncodeToString(sig), nil }