@@ -411,33 +411,6 @@ static RPCHelpMan gobject_submit()
411411}
412412
413413#ifdef ENABLE_WALLET
414- static bool SignVote (const CWallet& wallet, const CKeyID& keyID, CGovernanceVote& vote)
415- {
416- // Special implementation for testnet (Harden Spork6 that has not been deployed to other networks)
417- if (Params ().NetworkIDString () == CBaseChainParams::TESTNET) {
418- std::vector<unsigned char > signature;
419- if (!wallet.SignSpecialTxPayload (vote.GetSignatureHash (), keyID, signature)) {
420- LogPrintf (" SignVote -- SignHash() failed\n " );
421- return false ;
422- }
423- vote.SetSignature (signature);
424- return true ;
425- } // end of testnet implementation
426-
427- std::string strMessage{vote.GetSignatureString ()};
428- std::string signature;
429- SigningResult err = wallet.SignMessage (strMessage, PKHash{keyID}, signature);
430- if (err != SigningResult::OK) {
431- LogPrintf (" SignVote failed due to: %s\n " , SigningResultString (err));
432- return false ;
433- }
434- const auto opt_decoded = DecodeBase64 (signature);
435- CHECK_NONFATAL (opt_decoded.has_value ()); // DecodeBase64 should not fail
436-
437- vote.SetSignature (std::vector<unsigned char >(opt_decoded->data (), opt_decoded->data () + opt_decoded->size ()));
438- return true ;
439- }
440-
441414static UniValue VoteWithMasternodes (const JSONRPCRequest& request, const CWallet& wallet,
442415 const std::map<uint256, CKeyID>& votingKeys,
443416 const uint256& hash, vote_signal_enum_t eVoteSignal,
@@ -477,7 +450,7 @@ static UniValue VoteWithMasternodes(const JSONRPCRequest& request, const CWallet
477450
478451 CGovernanceVote vote (dmn->collateralOutpoint , hash, eVoteSignal, eVoteOutcome);
479452
480- if (!SignVote ( wallet, keyID, vote) || !vote.CheckSignature (keyID)) {
453+ if (!wallet. SignGovernanceVote ( keyID, vote) || !vote.CheckSignature (keyID)) {
481454 nFailed++;
482455 statusObj.pushKV (" result" , " failed" );
483456 statusObj.pushKV (" errorMessage" , " Failure to sign." );
0 commit comments