|
19 | 19 | #include <timedata.h>
|
20 | 20 | #include <util.h>
|
21 | 21 | #include <utilstrencodings.h>
|
22 |
| -#ifdef ENABLE_WALLET |
23 |
| -#include <wallet/rpcwallet.h> |
24 |
| -#include <wallet/wallet.h> |
25 |
| -#include <wallet/walletdb.h> |
26 |
| -#endif |
27 | 22 | #include <warnings.h>
|
28 | 23 |
|
29 | 24 | #include <stdint.h>
|
@@ -67,29 +62,18 @@ static UniValue validateaddress(const JSONRPCRequest& request)
|
67 | 62 | ret.pushKV("isvalid", isValid);
|
68 | 63 | if (isValid)
|
69 | 64 | {
|
| 65 | + std::string currentAddress = EncodeDestination(dest); |
| 66 | + ret.pushKV("address", currentAddress); |
70 | 67 |
|
71 |
| -#ifdef ENABLE_WALLET |
72 |
| - if (HasWallets() && IsDeprecatedRPCEnabled("validateaddress")) { |
73 |
| - ret.pushKVs(getaddressinfo(request)); |
74 |
| - } |
75 |
| -#endif |
76 |
| - if (ret["address"].isNull()) { |
77 |
| - std::string currentAddress = EncodeDestination(dest); |
78 |
| - ret.pushKV("address", currentAddress); |
79 |
| - |
80 |
| - CScript scriptPubKey = GetScriptForDestination(dest); |
81 |
| - ret.pushKV("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
| 68 | + CScript scriptPubKey = GetScriptForDestination(dest); |
| 69 | + ret.pushKV("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end())); |
82 | 70 |
|
83 |
| - UniValue detail = DescribeAddress(dest); |
84 |
| - ret.pushKVs(detail); |
85 |
| - } |
| 71 | + UniValue detail = DescribeAddress(dest); |
| 72 | + ret.pushKVs(detail); |
86 | 73 | }
|
87 | 74 | return ret;
|
88 | 75 | }
|
89 | 76 |
|
90 |
| -// Needed even with !ENABLE_WALLET, to pass (ignored) pointers around |
91 |
| -class CWallet; |
92 |
| - |
93 | 77 | static UniValue createmultisig(const JSONRPCRequest& request)
|
94 | 78 | {
|
95 | 79 | if (request.fHelp || request.params.size() < 2 || request.params.size() > 3)
|
@@ -461,7 +445,7 @@ static const CRPCCommand commands[] =
|
461 | 445 | // --------------------- ------------------------ ----------------------- ----------
|
462 | 446 | { "control", "getmemoryinfo", &getmemoryinfo, {"mode"} },
|
463 | 447 | { "control", "logging", &logging, {"include", "exclude"}},
|
464 |
| - { "util", "validateaddress", &validateaddress, {"address"} }, /* uses wallet if enabled */ |
| 448 | + { "util", "validateaddress", &validateaddress, {"address"} }, |
465 | 449 | { "util", "createmultisig", &createmultisig, {"nrequired","keys"} },
|
466 | 450 | { "util", "verifymessage", &verifymessage, {"address","signature","message"} },
|
467 | 451 | { "util", "signmessagewithprivkey", &signmessagewithprivkey, {"privkey","message"} },
|
|
0 commit comments