X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Frpcdump.cpp;h=1499acec3c69649df307f570bbf2ea5f743f4a7e;hb=4a6759691d71bf2a7d2a0a9e4710f0887e66ab02;hp=6e72688e8d7dc124fd489758745dd579e159d2a6;hpb=fbd44e84d5841867d36d295d4f347fd5e55d293f;p=novacoin.git diff --git a/src/rpcdump.cpp b/src/rpcdump.cpp index 6e72688..1499ace 100644 --- a/src/rpcdump.cpp +++ b/src/rpcdump.cpp @@ -101,13 +101,14 @@ Value importaddress(const Array& params, bool fHelp) CScript script; CBitcoinAddress address(params[0].get_str()); if (address.IsValid()) { - script.SetDestination(address.Get()); + if (address.IsPair()) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "It's senseless to import pubkey pair address."); + script.SetAddress(address); } else if (IsHex(params[0].get_str())) { std::vector data(ParseHex(params[0].get_str())); script = CScript(data.begin(), data.end()); - } else { + } else throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Novacoin address or script"); - } string strLabel = ""; if (params.size() > 1) @@ -161,13 +162,14 @@ Value removeaddress(const Array& params, bool fHelp) CBitcoinAddress address(params[0].get_str()); if (address.IsValid()) { - script.SetDestination(address.Get()); + if (address.IsPair()) + throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Pubkey pair addresses aren't supported."); + script.SetAddress(address); } else if (IsHex(params[0].get_str())) { std::vector data(ParseHex(params[0].get_str())); script = CScript(data.begin(), data.end()); - } else { + } else throw JSONRPCError(RPC_INVALID_ADDRESS_OR_KEY, "Invalid Bitcoin address or script"); - } if (::IsMine(*pwalletMain, script) == MINE_SPENDABLE) throw JSONRPCError(RPC_WALLET_ERROR, "The wallet contains the private key for this address or script - can't remove it");