Tristate KOMODO_NSPV
This commit is contained in:
@@ -993,7 +993,7 @@ UniValue nspv_getinfo(const UniValue& params, bool fHelp)
|
||||
int32_t reqht = 0;
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("nspv_getinfo [hdrheight]\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 1 )
|
||||
reqht = atoi((char *)params[0].get_str().c_str());
|
||||
@@ -1004,7 +1004,7 @@ UniValue nspv_logout(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 0 )
|
||||
throw runtime_error("nspv_logout\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_logout());
|
||||
}
|
||||
@@ -1013,7 +1013,7 @@ UniValue nspv_login(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_login wif\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_login((char *)params[0].get_str().c_str()));
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ UniValue nspv_listunspent(const UniValue& params, bool fHelp)
|
||||
int32_t skipcount = 0,CCflag = 0;
|
||||
if ( fHelp || params.size() > 3 )
|
||||
throw runtime_error("nspv_listunspent [address [isCC [skipcount]]]\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 0 )
|
||||
{
|
||||
@@ -1048,7 +1048,7 @@ UniValue nspv_mempool(const UniValue& params, bool fHelp)
|
||||
memset(&txid,0,sizeof(txid));
|
||||
if ( fHelp || params.size() > 5 )
|
||||
throw runtime_error("nspv_mempool func(0 all, 1 address recv, 2 txid/vout spent, 3 txid inmempool) address isCC [txid vout]]]\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
funcid = atoi((char *)params[0].get_str().c_str());
|
||||
coinaddr = (char *)params[1].get_str().c_str();
|
||||
@@ -1068,7 +1068,7 @@ UniValue nspv_listtransactions(const UniValue& params, bool fHelp)
|
||||
int32_t skipcount = 0,CCflag = 0;
|
||||
if ( fHelp || params.size() > 3 )
|
||||
throw runtime_error("nspv_listtransactions [address [isCC [skipcount]]]\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 0 )
|
||||
{
|
||||
@@ -1093,7 +1093,7 @@ UniValue nspv_spentinfo(const UniValue& params, bool fHelp)
|
||||
uint256 txid; int32_t vout;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_spentinfo txid vout\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
txid = Parseuint256((char *)params[0].get_str().c_str());
|
||||
vout = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1105,7 +1105,7 @@ UniValue nspv_notarizations(const UniValue& params, bool fHelp)
|
||||
int32_t height;
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_notarizations height\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
height = atoi((char *)params[0].get_str().c_str());
|
||||
return(NSPV_notarizations(height));
|
||||
@@ -1116,7 +1116,7 @@ UniValue nspv_hdrsproof(const UniValue& params, bool fHelp)
|
||||
int32_t prevheight,nextheight;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_hdrsproof prevheight nextheight\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
prevheight = atoi((char *)params[0].get_str().c_str());
|
||||
nextheight = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1128,7 +1128,7 @@ UniValue nspv_txproof(const UniValue& params, bool fHelp)
|
||||
uint256 txid; int32_t height;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_txproof txid height\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
txid = Parseuint256((char *)params[0].get_str().c_str());
|
||||
height = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1140,7 +1140,7 @@ UniValue nspv_spend(const UniValue& params, bool fHelp)
|
||||
uint64_t satoshis;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_spend address amount\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( NSPV_address.size() == 0 )
|
||||
throw runtime_error("to nspv_send you need an active nspv_login\n");
|
||||
@@ -1155,7 +1155,7 @@ UniValue nspv_broadcast(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_broadcast hex\n");
|
||||
if ( KOMODO_NSPV == 0 )
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_broadcast((char *)params[0].get_str().c_str()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user