Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/mining.cpp
Show First 20 Lines • Show All 656 Lines • ▼ Show 20 Lines | static UniValue getblocktemplate(const Config &config, | ||||
result.pushKV("version", pblock->nVersion); | result.pushKV("version", pblock->nVersion); | ||||
result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex()); | result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex()); | ||||
result.pushKV("transactions", transactions); | result.pushKV("transactions", transactions); | ||||
result.pushKV("coinbaseaux", aux); | result.pushKV("coinbaseaux", aux); | ||||
result.pushKV("coinbasevalue", | result.pushKV("coinbasevalue", | ||||
int64_t(pblock->vtx[0]->vout[0].nValue / SATOSHI)); | int64_t(pblock->vtx[0]->vout[0].nValue / SATOSHI)); | ||||
result.pushKV("longpollid", | result.pushKV("longpollid", chainActive.Tip()->GetBlockHash().GetHex() + | ||||
chainActive.Tip()->GetBlockHash().GetHex() + | |||||
i64tostr(nTransactionsUpdatedLast)); | i64tostr(nTransactionsUpdatedLast)); | ||||
result.pushKV("target", hashTarget.GetHex()); | result.pushKV("target", hashTarget.GetHex()); | ||||
result.pushKV("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1); | result.pushKV("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1); | ||||
result.pushKV("mutable", aMutable); | result.pushKV("mutable", aMutable); | ||||
result.pushKV("noncerange", "00000000ffffffff"); | result.pushKV("noncerange", "00000000ffffffff"); | ||||
// FIXME: Allow for mining block greater than 1M. | // FIXME: Allow for mining block greater than 1M. | ||||
result.pushKV("sigoplimit", GetMaxBlockSigOpsCount(DEFAULT_MAX_BLOCK_SIZE)); | result.pushKV("sigoplimit", GetMaxBlockSigOpsCount(DEFAULT_MAX_BLOCK_SIZE)); | ||||
result.pushKV("sizelimit", DEFAULT_MAX_BLOCK_SIZE); | result.pushKV("sizelimit", DEFAULT_MAX_BLOCK_SIZE); | ||||
result.pushKV("curtime", pblock->GetBlockTime()); | result.pushKV("curtime", pblock->GetBlockTime()); | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |