Browse Source

test

metaverse
jl777 8 years ago
parent
commit
ce906ce757
  1. 3
      src/bitcoind.cpp
  2. 2
      src/rpcrawtransaction.cpp
  3. 5
      src/rpcserver.cpp
  4. 10
      src/wallet/wallet.cpp

3
src/bitcoind.cpp

@ -144,7 +144,8 @@ bool AppInit(int argc, char* argv[])
fDaemon = GetBoolArg("-daemon", false);
if (fDaemon)
{
fprintf(stdout, "Komodo server starting\n");
extern char ASSETCHAINS_SYMBOL[16];
fprintf(stdout, "Komodo %s server starting\n",ASSETCHAINS_SYMBOL);
// Daemonize
pid_t pid = fork();

2
src/rpcrawtransaction.cpp

@ -253,8 +253,6 @@ Value getrawtransaction(const Array& params, bool fHelp)
return result;
}
uint32_t komodo_interest_args(int32_t *txheightp,uint32_t *tiptimep,uint64_t *valuep,uint256 hash,int32_t n);
Value gettxoutproof(const Array& params, bool fHelp)
{
if (fHelp || (params.size() != 1 && params.size() != 2))

5
src/rpcserver.cpp

@ -253,11 +253,12 @@ Value help(const Array& params, bool fHelp)
Value stop(const Array& params, bool fHelp)
{
// Accept the deprecated and ignored 'detach' boolean argument
extern char ASSETCHAINS_SYMBOL[16];
// Accept the deprecated and ignored 'detach' boolean argument
if (fHelp || params.size() > 1)
throw runtime_error(
"stop\n"
"\nStop Komodo server.");
"\nStop Komodo %s server.",ASSETCHAINS_SYMBOL);
// Shutdown will take long enough that the response should get back
StartShutdown();
return "Komodo server stopping";

10
src/wallet/wallet.cpp

@ -2354,7 +2354,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int
return true;
}
uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime);
uint64_t komodo_accrued_interest(uint256 hash,int32_t n,int32_t checkheight,uint64_t checkvalue);
bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*,unsigned int> >& setCoinsRet, CAmount& nValueRet, bool& fOnlyCoinbaseCoinsRet, bool& fNeedCoinbaseCoinsRet, const CCoinControl* coinControl) const
{
@ -2400,13 +2400,13 @@ bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*
nValueRet += out.tx->vout[out.i].nValue;
#ifdef KOMODO_ENABLE_INTEREST
if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& chainActive.Tip()->nHeight+1 >= 60000 )
{
{sss
uint64_t interest;
interest = komodo_interest(chainActive.Tip()->nHeight+1,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime);
if ( interest != 0 || out.tx->vout[out.i].nValue >= COIN*100 )
//if ( interest != 0 || out.tx->vout[out.i].nValue >= COIN*100 )
{
printf("nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)out.tx->vout[out.i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);
fprintf(stderr,"nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)nValueRet/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);
printf("wallet nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)out.tx->vout[out.i].nValue/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);
fprintf(stderr,"wallet nValueRet %.8f += interest %.8f ht.%d lock.%u tip.%u\n",(double)nValueRet/COIN,(double)interest/COIN,chainActive.Tip()->nHeight+1,out.tx->nLockTime,chainActive.Tip()->nTime);
}
nValueRet += interest;
}

Loading…
Cancel
Save