aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorGregory Sanders <gsanders87@gmail.com>2019-02-19 17:00:45 -0500
committerGregory Sanders <gsanders87@gmail.com>2019-04-29 10:15:23 -0400
commit70946e7fee54323ce6a5ea8aeb377e2c7c790bc6 (patch)
tree8214716fc7275e3b32bc0c28bdfab5df44ad6a4f /src/rpc
parentcaceff55465e392dfd1b0ba9225653b64d8518f1 (diff)
Replace CScriptID and CKeyID in CTxDestination with dedicated types
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/misc.cpp6
-rw-r--r--src/rpc/rawtransaction.cpp4
-rw-r--r--src/rpc/util.cpp4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp
index bfb559f0db..7327d6a1b0 100644
--- a/src/rpc/misc.cpp
+++ b/src/rpc/misc.cpp
@@ -307,8 +307,8 @@ static UniValue verifymessage(const JSONRPCRequest& request)
throw JSONRPCError(RPC_TYPE_ERROR, "Invalid address");
}
- const CKeyID *keyID = boost::get<CKeyID>(&destination);
- if (!keyID) {
+ const PKHash *pkhash = boost::get<PKHash>(&destination);
+ if (!pkhash) {
throw JSONRPCError(RPC_TYPE_ERROR, "Address does not refer to key");
}
@@ -326,7 +326,7 @@ static UniValue verifymessage(const JSONRPCRequest& request)
if (!pubkey.RecoverCompact(ss.GetHash(), vchSig))
return false;
- return (pubkey.GetID() == *keyID);
+ return (pubkey.GetID() == *pkhash);
}
static UniValue signmessagewithprivkey(const JSONRPCRequest& request)
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 1a7216ceeb..0f784afcd3 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -571,7 +571,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
if (type.isStr() && type.get_str() != "scripthash") {
// P2SH cannot be wrapped in a P2SH. If this script is already a P2SH,
// don't return the address for a P2SH of the P2SH.
- r.pushKV("p2sh", EncodeDestination(CScriptID(script)));
+ r.pushKV("p2sh", EncodeDestination(ScriptHash(script)));
// P2SH and witness programs cannot be wrapped in P2WSH, if this script
// is a witness program, don't return addresses for a segwit programs.
if (type.get_str() == "pubkey" || type.get_str() == "pubkeyhash" || type.get_str() == "multisig" || type.get_str() == "nonstandard") {
@@ -598,7 +598,7 @@ static UniValue decodescript(const JSONRPCRequest& request)
segwitScr = GetScriptForDestination(WitnessV0ScriptHash(script));
}
ScriptPubKeyToUniv(segwitScr, sr, /* fIncludeHex */ true);
- sr.pushKV("p2sh-segwit", EncodeDestination(CScriptID(segwitScr)));
+ sr.pushKV("p2sh-segwit", EncodeDestination(ScriptHash(segwitScr)));
r.pushKV("segwit", sr);
}
}
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index 1a87c9f935..e329ff7e46 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -181,7 +181,7 @@ public:
return UniValue(UniValue::VOBJ);
}
- UniValue operator()(const CKeyID& keyID) const
+ UniValue operator()(const PKHash& keyID) const
{
UniValue obj(UniValue::VOBJ);
obj.pushKV("isscript", false);
@@ -189,7 +189,7 @@ public:
return obj;
}
- UniValue operator()(const CScriptID& scriptID) const
+ UniValue operator()(const ScriptHash& scriptID) const
{
UniValue obj(UniValue::VOBJ);
obj.pushKV("isscript", true);