Browse Source

nspv_send -> spend

warmup
jl777 5 years ago
parent
commit
ffd7509692
  1. 4
      src/komodo_nSPV_wallet.h
  2. 2
      src/rpc/server.cpp
  3. 3
      src/rpc/server.h
  4. 8
      src/wallet/rpcdump.cpp

4
src/komodo_nSPV_wallet.h

@ -17,7 +17,7 @@
#ifndef 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_BRANCHID 0x76b809bb
@ -210,7 +210,7 @@ std::string NSPV_signtx(CMutableTransaction &mtx,uint64_t txfee,CScript opret,st
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;
if ( NSPV_logintime == 0 || time(NULL) > NSPV_logintime+NSPV_AUTOLOGOUT )

2
src/rpc/server.cpp

@ -424,7 +424,7 @@ static const CRPCCommand vRPCCommands[] =
{ "nSPV", "nspv_notarizations", &nspv_notarizations, true },
{ "nSPV", "nspv_hdrsproof", &nspv_hdrsproof, true },
{ "nSPV", "nspv_txproof", &nspv_txproof, true },
{ "nSPV", "nspv_send", &nspv_send, true },
{ "nSPV", "nspv_spend", &nspv_spend, true },
// rewards
{ "rewards", "rewardslist", &rewardslist, true },

3
src/rpc/server.h

@ -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_hdrsproof(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);

8
src/wallet/rpcdump.cpp

@ -975,7 +975,7 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
UniValue NSPV_getinfo_json();
UniValue NSPV_login(char *wifstr);
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_notarizations(int32_t height);
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));
}
UniValue nspv_send(const UniValue& params, bool fHelp)
UniValue nspv_spend(const UniValue& params, bool fHelp)
{
uint64_t satoshis;
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 )
throw runtime_error("to nspv_send you need an active nspv_login\n");
satoshis = atof(params[1].get_str().c_str())*COIN + 0.0000000049;
if ( satoshis < 1000 )
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));
}

Loading…
Cancel
Save