Remove height triggers and add PoWtarget in getblocktemplate
This commit is contained in:
@@ -438,6 +438,7 @@ static UniValue BIP22ValidationResult(const CValidationState& state)
|
||||
|
||||
UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
||||
{
|
||||
extern uint64_t ASSETCHAINS_STAKED;
|
||||
if (fHelp || params.size() > 1)
|
||||
throw runtime_error(
|
||||
"getblocktemplate ( \"jsonrequestobject\" )\n"
|
||||
@@ -727,7 +728,15 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
|
||||
result.push_back(Pair("coinbasevalue", (int64_t)pblock->vtx[0].vout[0].nValue));
|
||||
}
|
||||
result.push_back(Pair("longpollid", chainActive.LastTip()->GetBlockHash().GetHex() + i64tostr(nTransactionsUpdatedLast)));
|
||||
result.push_back(Pair("target", hashTarget.GetHex()));
|
||||
if ( ASSETCHAINS_STAKED != 0 )
|
||||
{
|
||||
arith_uint256 POWtarget; int32_t PosPerc;
|
||||
POWtarget = komodo_PoWtarget(&PoSperc,hashTarget,(int32_t)(pindexPrev->nHeight+1),ASSETCHAINS_STAKED);
|
||||
result.push_back(Pair("target", POWtarget.GetHex()));
|
||||
result.push_back(Pair("PoSperc", (int64_t)PoSperc));
|
||||
result.push_back(Pair("ac_staked", (int64_t)ASSETCHAINS_STAKED));
|
||||
result.push_back(Pair("origtarget", hashTarget.GetHex()));
|
||||
} else result.push_back(Pair("target", hashTarget.GetHex()));
|
||||
result.push_back(Pair("mintime", (int64_t)pindexPrev->GetMedianTimePast()+1));
|
||||
result.push_back(Pair("mutable", aMutable));
|
||||
result.push_back(Pair("noncerange", "00000000ffffffff"));
|
||||
|
||||
Reference in New Issue
Block a user