HUSH NSPV

This commit is contained in:
Duke Leto
2020-12-09 19:22:51 -05:00
parent 86bd499818
commit 31fc4099df
24 changed files with 121 additions and 121 deletions

View File

@@ -1001,13 +1001,13 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp, const CPubKey& m
return EncodeViewingKey(ivk);
}
extern int32_t KOMODO_NSPV;
#ifndef KOMODO_NSPV_FULLNODE
#define KOMODO_NSPV_FULLNODE (KOMODO_NSPV <= 0)
#endif // !KOMODO_NSPV_FULLNODE
#ifndef KOMODO_NSPV_SUPERLITE
#define KOMODO_NSPV_SUPERLITE (KOMODO_NSPV > 0)
#endif // !KOMODO_NSPV_SUPERLITE
extern int32_t HUSH_NSPV;
#ifndef HUSH_NSPV_FULLNODE
#define HUSH_NSPV_FULLNODE (HUSH_NSPV <= 0)
#endif // !HUSH_NSPV_FULLNODE
#ifndef HUSH_NSPV_SUPERLITE
#define HUSH_NSPV_SUPERLITE (HUSH_NSPV > 0)
#endif // !HUSH_NSPV_SUPERLITE
uint256 zeroid;
UniValue NSPV_getinfo_req(int32_t reqht);
UniValue NSPV_login(char *wifstr);
@@ -1031,7 +1031,7 @@ UniValue nspv_getinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
int32_t reqht = 0;
if ( fHelp || params.size() > 1 )
throw runtime_error("nspv_getinfo [hdrheight]\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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());
@@ -1042,7 +1042,7 @@ UniValue nspv_logout(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
if ( fHelp || params.size() != 0 )
throw runtime_error("nspv_logout\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
throw runtime_error("-nSPV=1 must be set to use nspv\n");
return(NSPV_logout());
}
@@ -1051,7 +1051,7 @@ UniValue nspv_login(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
if ( fHelp || params.size() != 1 )
throw runtime_error("nspv_login wif\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
throw runtime_error("-nSPV=1 must be set to use nspv\n");
return(NSPV_login((char *)params[0].get_str().c_str()));
}
@@ -1061,7 +1061,7 @@ UniValue nspv_listunspent(const UniValue& params, bool fHelp, const CPubKey& myp
int32_t skipcount = 0,CCflag = 0;
if ( fHelp || params.size() > 3 )
throw runtime_error("nspv_listunspent [address [isCC [skipcount]]]\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
throw runtime_error("-nSPV=1 must be set to use nspv\n");
if ( params.size() == 0 )
{
@@ -1086,7 +1086,7 @@ UniValue nspv_mempool(const UniValue& params, bool fHelp, const CPubKey& mypk)
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_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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();
@@ -1106,7 +1106,7 @@ UniValue nspv_listtransactions(const UniValue& params, bool fHelp, const CPubKey
int32_t skipcount = 0,CCflag = 0;
if ( fHelp || params.size() > 3 )
throw runtime_error("nspv_listtransactions [address [isCC [skipcount]]]\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
throw runtime_error("-nSPV=1 must be set to use nspv\n");
if ( params.size() == 0 )
{
@@ -1131,7 +1131,7 @@ UniValue nspv_spentinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
uint256 txid; int32_t vout;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_spentinfo txid vout\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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());
@@ -1143,7 +1143,7 @@ UniValue nspv_notarizations(const UniValue& params, bool fHelp, const CPubKey& m
int32_t height;
if ( fHelp || params.size() != 1 )
throw runtime_error("nspv_notarizations height\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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));
@@ -1154,7 +1154,7 @@ UniValue nspv_hdrsproof(const UniValue& params, bool fHelp, const CPubKey& mypk)
int32_t prevheight,nextheight;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_hdrsproof prevheight nextheight\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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());
@@ -1166,7 +1166,7 @@ UniValue nspv_txproof(const UniValue& params, bool fHelp, const CPubKey& mypk)
uint256 txid; int32_t height;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_txproof txid height\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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());
@@ -1178,7 +1178,7 @@ UniValue nspv_spend(const UniValue& params, bool fHelp, const CPubKey& mypk)
uint64_t satoshis;
if ( fHelp || params.size() != 2 )
throw runtime_error("nspv_spend address amount\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
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");
@@ -1193,7 +1193,7 @@ UniValue nspv_broadcast(const UniValue& params, bool fHelp, const CPubKey& mypk)
{
if ( fHelp || params.size() != 1 )
throw runtime_error("nspv_broadcast hex\n");
if ( KOMODO_NSPV_FULLNODE )
if ( HUSH_NSPV_FULLNODE )
throw runtime_error("-nSPV=1 must be set to use nspv\n");
return(NSPV_broadcast((char *)params[0].get_str().c_str()));
}
@@ -1207,7 +1207,7 @@ UniValue nspv_listccmoduleunspent(const UniValue& params, bool fHelp, const CPub
"if amount is 0 just returns no utxos and available total.\n"
"funcids is a string of funcid symbols. The first symbol is considered as the creation funcid, so the txid param will be compared to the creation tx id.\n"
"For the second+ funcids the txid param will be compared to txid in opreturn\n\n" );
if (KOMODO_NSPV_FULLNODE)
if (HUSH_NSPV_FULLNODE)
throw runtime_error("-nSPV=1 must be set to use nspv\n");
std::string address = params[0].get_str().c_str();