Backward compatible dPoW enforcement!

This commit is contained in:
jl777
2018-10-14 11:56:02 -11:00
parent 68fd571656
commit c606ce6925
6 changed files with 30 additions and 49 deletions

View File

@@ -32,6 +32,7 @@ using namespace std;
extern void TxToJSON(const CTransaction& tx, const uint256 hashBlock, UniValue& entry);
void ScriptPubKeyToJSON(const CScript& scriptPubKey, UniValue& out, bool fIncludeHex);
int32_t komodo_longestchain();
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
double GetDifficultyINTERNAL(const CBlockIndex* blockindex, bool networkDifficulty)
{
@@ -1150,7 +1151,7 @@ UniValue gettxout(const UniValue& params, bool fHelp)
ret.push_back(Pair("bestblock", pindex->GetBlockHash().GetHex()));
if ((unsigned int)coins.nHeight == MEMPOOL_HEIGHT)
ret.push_back(Pair("confirmations", 0));
else ret.push_back(Pair("confirmations", pindex->nHeight - coins.nHeight + 1));
else ret.push_back(Pair("confirmations", komodo_dpowconfs(coins.nHeight,pindex->nHeight - coins.nHeight + 1)));
ret.push_back(Pair("value", ValueFromAmount(coins.vout[n].nValue)));
uint64_t interest; int32_t txheight; uint32_t locktime;
if ( (interest= komodo_accrued_interest(&txheight,&locktime,hash,n,coins.nHeight,coins.vout[n].nValue,(int32_t)pindex->nHeight)) != 0 )