This commit is contained in:
jl777
2016-11-15 11:17:55 -03:00
parent 919b3cff75
commit ce906ce757
4 changed files with 10 additions and 10 deletions

View File

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

View File

@@ -253,8 +253,6 @@ Value getrawtransaction(const Array& params, bool fHelp)
return result; 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) Value gettxoutproof(const Array& params, bool fHelp)
{ {
if (fHelp || (params.size() != 1 && params.size() != 2)) if (fHelp || (params.size() != 1 && params.size() != 2))

View File

@@ -253,11 +253,12 @@ Value help(const Array& params, bool fHelp)
Value stop(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) if (fHelp || params.size() > 1)
throw runtime_error( throw runtime_error(
"stop\n" "stop\n"
"\nStop Komodo server."); "\nStop Komodo %s server.",ASSETCHAINS_SYMBOL);
// Shutdown will take long enough that the response should get back // Shutdown will take long enough that the response should get back
StartShutdown(); StartShutdown();
return "Komodo server stopping"; return "Komodo server stopping";

View File

@@ -2354,7 +2354,7 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int
return true; 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 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; nValueRet += out.tx->vout[out.i].nValue;
#ifdef KOMODO_ENABLE_INTEREST #ifdef KOMODO_ENABLE_INTEREST
if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& chainActive.Tip()->nHeight+1 >= 60000 ) if ( strcmp(ASSETCHAINS_SYMBOL,"REVS") == 0 )//&& chainActive.Tip()->nHeight+1 >= 60000 )
{ {sss
uint64_t interest; uint64_t interest;
interest = komodo_interest(chainActive.Tip()->nHeight+1,out.tx->vout[out.i].nValue,out.tx->nLockTime,chainActive.Tip()->nTime); 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); 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,"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); 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; nValueRet += interest;
} }