nspv_send -> spend
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
#ifndef KOMODO_NSPVWALLET_H
|
#ifndef KOMODO_NSPVWALLET_H
|
||||||
#define KOMODO_NSPVWALLET_H
|
#define KOMODO_NSPVWALLET_H
|
||||||
|
|
||||||
// nSPV wallet uses superlite functions (and some komodod built in functions) to implement nSPV_send
|
// nSPV wallet uses superlite functions (and some komodod built in functions) to implement nSPV_spend
|
||||||
|
|
||||||
#define NSPV_AUTOLOGOUT 60
|
#define NSPV_AUTOLOGOUT 60
|
||||||
#define NSPV_BRANCHID 0x76b809bb
|
#define NSPV_BRANCHID 0x76b809bb
|
||||||
@@ -210,7 +210,7 @@ std::string NSPV_signtx(CMutableTransaction &mtx,uint64_t txfee,CScript opret,st
|
|||||||
return(EncodeHexTx(mtx));
|
return(EncodeHexTx(mtx));
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue NSPV_send(char *srcaddr,char *destaddr,int64_t satoshis) // what its all about!
|
UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis) // what its all about!
|
||||||
{
|
{
|
||||||
UniValue result(UniValue::VOBJ); uint8_t rmd160[128]; int64_t txfee = 10000;
|
UniValue result(UniValue::VOBJ); uint8_t rmd160[128]; int64_t txfee = 10000;
|
||||||
if ( NSPV_logintime == 0 || time(NULL) > NSPV_logintime+NSPV_AUTOLOGOUT )
|
if ( NSPV_logintime == 0 || time(NULL) > NSPV_logintime+NSPV_AUTOLOGOUT )
|
||||||
|
|||||||
@@ -424,7 +424,7 @@ static const CRPCCommand vRPCCommands[] =
|
|||||||
{ "nSPV", "nspv_notarizations", &nspv_notarizations, true },
|
{ "nSPV", "nspv_notarizations", &nspv_notarizations, true },
|
||||||
{ "nSPV", "nspv_hdrsproof", &nspv_hdrsproof, true },
|
{ "nSPV", "nspv_hdrsproof", &nspv_hdrsproof, true },
|
||||||
{ "nSPV", "nspv_txproof", &nspv_txproof, true },
|
{ "nSPV", "nspv_txproof", &nspv_txproof, true },
|
||||||
{ "nSPV", "nspv_send", &nspv_send, true },
|
{ "nSPV", "nspv_spend", &nspv_spend, true },
|
||||||
|
|
||||||
// rewards
|
// rewards
|
||||||
{ "rewards", "rewardslist", &rewardslist, true },
|
{ "rewards", "rewardslist", &rewardslist, true },
|
||||||
|
|||||||
@@ -462,7 +462,8 @@ extern UniValue nspv_spentinfo(const UniValue& params, bool fHelp);
|
|||||||
extern UniValue nspv_notarizations(const UniValue& params, bool fHelp);
|
extern UniValue nspv_notarizations(const UniValue& params, bool fHelp);
|
||||||
extern UniValue nspv_hdrsproof(const UniValue& params, bool fHelp);
|
extern UniValue nspv_hdrsproof(const UniValue& params, bool fHelp);
|
||||||
extern UniValue nspv_txproof(const UniValue& params, bool fHelp);
|
extern UniValue nspv_txproof(const UniValue& params, bool fHelp);
|
||||||
extern UniValue nspv_send(const UniValue& params, bool fHelp);
|
extern UniValue nspv_spend(const UniValue& params, bool fHelp);
|
||||||
|
extern UniValue nspv_broadcast(const UniValue& params, bool fHelp);
|
||||||
|
|
||||||
extern UniValue getblocksubsidy(const UniValue& params, bool fHelp);
|
extern UniValue getblocksubsidy(const UniValue& params, bool fHelp);
|
||||||
|
|
||||||
|
|||||||
@@ -975,7 +975,7 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
|
|||||||
UniValue NSPV_getinfo_json();
|
UniValue NSPV_getinfo_json();
|
||||||
UniValue NSPV_login(char *wifstr);
|
UniValue NSPV_login(char *wifstr);
|
||||||
UniValue NSPV_addressutxos(char *coinaddr);
|
UniValue NSPV_addressutxos(char *coinaddr);
|
||||||
UniValue NSPV_send(char *srcaddr,char *destaddr,int64_t satoshis);
|
UniValue NSPV_spend(char *srcaddr,char *destaddr,int64_t satoshis);
|
||||||
UniValue NSPV_spentinfo(uint256 txid,int32_t vout);
|
UniValue NSPV_spentinfo(uint256 txid,int32_t vout);
|
||||||
UniValue NSPV_notarizations(int32_t height);
|
UniValue NSPV_notarizations(int32_t height);
|
||||||
UniValue NSPV_hdrsproof(int32_t prevheight,int32_t nextheight);
|
UniValue NSPV_hdrsproof(int32_t prevheight,int32_t nextheight);
|
||||||
@@ -1045,16 +1045,16 @@ UniValue nspv_txproof(const UniValue& params, bool fHelp)
|
|||||||
return(NSPV_txproof(txid,height));
|
return(NSPV_txproof(txid,height));
|
||||||
}
|
}
|
||||||
|
|
||||||
UniValue nspv_send(const UniValue& params, bool fHelp)
|
UniValue nspv_spend(const UniValue& params, bool fHelp)
|
||||||
{
|
{
|
||||||
uint64_t satoshis;
|
uint64_t satoshis;
|
||||||
if ( fHelp || params.size() != 2 )
|
if ( fHelp || params.size() != 2 )
|
||||||
throw runtime_error("nspv_send destaddr amount\n");
|
throw runtime_error("nspv_spend destaddr amount\n");
|
||||||
if ( NSPV_address.size() == 0 )
|
if ( NSPV_address.size() == 0 )
|
||||||
throw runtime_error("to nspv_send you need an active nspv_login\n");
|
throw runtime_error("to nspv_send you need an active nspv_login\n");
|
||||||
satoshis = atof(params[1].get_str().c_str())*COIN + 0.0000000049;
|
satoshis = atof(params[1].get_str().c_str())*COIN + 0.0000000049;
|
||||||
if ( satoshis < 1000 )
|
if ( satoshis < 1000 )
|
||||||
throw runtime_error("amount too small\n");
|
throw runtime_error("amount too small\n");
|
||||||
return(NSPV_send((char *)NSPV_address.c_str(),(char *)params[0].get_str().c_str(),satoshis));
|
return(NSPV_spend((char *)NSPV_address.c_str(),(char *)params[0].get_str().c_str(),satoshis));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user