Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
move service check post help so we can still get help
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Griffith committed Apr 20, 2018
1 parent 9c9c733 commit 537ebcb
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions src/rpc/rpcans.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ bool getAddrFromPtx(std::string& addr, CTransactionRef ptx)

UniValue getansrecord(const UniValue& params, bool fHelp)
{
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}
if (fHelp || params.size() != 2)
{
throw std::runtime_error(
"getansrecord \"record name\" \"record type\" \n"
"\nReturn the full record with the record name.\n"
Expand All @@ -168,6 +165,11 @@ UniValue getansrecord(const UniValue& params, bool fHelp)
+ HelpExampleCli("getansrecord"," \"name\" \"A\"")
+ HelpExampleRpc("getansrecord"," \"EQT4WawJ6BN2JuaTfViuztHFeiqj2KCvTf\" \"PTR\"")
);
}
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}
std::string strRecordName = params[0].get_str();
AnsRecordTypes recordtype = AnsRecordTypes::UNKNOWN_RECORD;
CAnsRecord record = CAnsRecord();
Expand Down Expand Up @@ -222,11 +224,6 @@ UniValue getansrecord(const UniValue& params, bool fHelp)

UniValue registerans(const UniValue& params, bool fHelp)
{
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;

Expand All @@ -247,6 +244,11 @@ UniValue registerans(const UniValue& params, bool fHelp)
);
}

if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

LOCK2(cs_main, pwalletMain->cs_wallet);

std::string strAddress = params[0].get_str();
Expand Down Expand Up @@ -322,11 +324,6 @@ UniValue registerans(const UniValue& params, bool fHelp)

UniValue renewans(const UniValue& params, bool fHelp)
{
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;

Expand All @@ -347,6 +344,11 @@ UniValue renewans(const UniValue& params, bool fHelp)
+ HelpExampleRpc("sendtoaddress", "\"EQT4WawJ6BN2JuaTfViuztHFeiqj2KCvTf\" \"bob\"")
);
}
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

LOCK2(cs_main, pwalletMain->cs_wallet);

std::string strAddress = params[0].get_str();
Expand Down Expand Up @@ -412,11 +414,6 @@ UniValue renewans(const UniValue& params, bool fHelp)

UniValue sendtoans(const UniValue& params, bool fHelp)
{
if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;

Expand All @@ -436,6 +433,11 @@ UniValue sendtoans(const UniValue& params, bool fHelp)
+ HelpExampleRpc("sendtoaddress", "\"1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd\", 0.1, \"3CD0-12\"")
);

if(!AreServicesEnabled())
{
throw JSONRPCError(RPC_MISC_ERROR, "services are not active until May 5th at 00:00:00 UTC ");
}

LOCK2(cs_main, pwalletMain->cs_wallet);

std::string username = params[0].get_str();
Expand Down

0 comments on commit 537ebcb

Please sign in to comment.