File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -578,12 +578,12 @@ UniValue dumpprivkey(const JSONRPCRequest& request)
578
578
if (!IsValidDestination (dest)) {
579
579
throw JSONRPCError (RPC_INVALID_ADDRESS_OR_KEY, " Invalid Bitcoin address" );
580
580
}
581
- const CKeyID *keyID = boost::get<CKeyID>(& dest);
582
- if (!keyID ) {
581
+ auto keyid = GetKeyForDestination (*pwallet, dest);
582
+ if (keyid. IsNull () ) {
583
583
throw JSONRPCError (RPC_TYPE_ERROR, " Address does not refer to a key" );
584
584
}
585
585
CKey vchSecret;
586
- if (!pwallet->GetKey (*keyID , vchSecret)) {
586
+ if (!pwallet->GetKey (keyid , vchSecret)) {
587
587
throw JSONRPCError (RPC_WALLET_ERROR, " Private key for address " + strAddress + " is not known" );
588
588
}
589
589
return CBitcoinSecret (vchSecret).ToString ();
You can’t perform that action at this time.
0 commit comments