Merge pull request #691 from jl777/jl777

reduce notary mining initial delay from 65 to 60 seconds
This commit is contained in:
jl777
2018-06-08 05:18:55 -11:00
committed by GitHub
2 changed files with 23 additions and 21 deletions

View File

@@ -475,8 +475,8 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn,int32_t gpucount)
if ( ASSETCHAINS_SYMBOL[0] == 0 && NOTARY_PUBKEY33[0] != 0 )
{
CMutableTransaction txNotary = CreateNewContextualCMutableTransaction(Params().GetConsensus(), chainActive.Height() + 1);
if ( pblock->nTime < pindexPrev->nTime+65 )
pblock->nTime = pindexPrev->nTime + 65;
if ( pblock->nTime < pindexPrev->nTime+60 )
pblock->nTime = pindexPrev->nTime + 60;
if ( gpucount < 33 )
pblock->nTime += (rand() % (33 - gpucount)*(33 - gpucount));
if ( komodo_notaryvin(txNotary,NOTARY_PUBKEY33) > 0 )

View File

@@ -2697,32 +2697,34 @@ UniValue listunspent(const UniValue& params, bool fHelp)
uint64_t komodo_interestsum()
{
#ifdef ENABLE_WALLET
uint64_t interest,sum = 0; int32_t txheight; uint32_t locktime;
vector<COutput> vecOutputs;
assert(pwalletMain != NULL);
LOCK2(cs_main, pwalletMain->cs_wallet);
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
BOOST_FOREACH(const COutput& out,vecOutputs)
if ( GetBoolArg("-disablewallet", false) == 0 )
{
CAmount nValue = out.tx->vout[out.i].nValue;
if ( out.tx->nLockTime != 0 && out.fSpendable != 0 )
uint64_t interest,sum = 0; int32_t txheight; uint32_t locktime;
vector<COutput> vecOutputs;
assert(pwalletMain != NULL);
LOCK2(cs_main, pwalletMain->cs_wallet);
pwalletMain->AvailableCoins(vecOutputs, false, NULL, true);
BOOST_FOREACH(const COutput& out,vecOutputs)
{
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex *tipindex,*pindex = it->second;
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 )
CAmount nValue = out.tx->vout[out.i].nValue;
if ( out.tx->nLockTime != 0 && out.fSpendable != 0 )
{
interest = komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight);
//interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,tipindex->nTime);
sum += interest;
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
CBlockIndex *tipindex,*pindex = it->second;
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 )
{
interest = komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight);
//interest = komodo_interest(pindex->nHeight,nValue,out.tx->nLockTime,tipindex->nTime);
sum += interest;
}
}
}
KOMODO_INTERESTSUM = sum;
KOMODO_WALLETBALANCE = pwalletMain->GetBalance();
return(sum);
}
KOMODO_INTERESTSUM = sum;
KOMODO_WALLETBALANCE = pwalletMain->GetBalance();
return(sum);
#else
return(0);
#endif
return(0);
}
UniValue fundrawtransaction(const UniValue& params, bool fHelp)