MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / getblocktemplate

Function getblocktemplate

src/rpcmining.cpp:323–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323UniValue getblocktemplate(const UniValue& params, bool fHelp)
324{
325 if (fHelp || params.size() > 1)
326 throw runtime_error(
327 "getblocktemplate ( \"jsonrequestobject\" )\n"
328 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
329 "It returns data needed to construct a block to work on.\n"
330 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
331
332 "\nArguments:\n"
333 "1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n"
334 " {\n"
335 " \"mode\":\"template\" (string, optional) This must be set to \"template\" or omitted\n"
336 " \"capabilities\":[ (array, optional) A list of strings\n"
337 " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
338 " ,...\n"
339 " ]\n"
340 " }\n"
341 "\n"
342
343 "\nResult:\n"
344 "{\n"
345 " \"version\" : n, (numeric) The block version\n"
346 " \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
347 " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
348 " {\n"
349 " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
350 " \"hash\" : \"xxxx\", (string) hash/id encoded in little-endian hexadecimal\n"
351 " \"depends\" : [ (array) array of numbers \n"
352 " n (numeric) transactions before this one (by 1-based index in 'transactions' list) that must be present in the final block if this one is\n"
353 " ,...\n"
354 " ],\n"
355 " \"fee\": n, (numeric) difference in value between transaction inputs and outputs (in Satoshis); for coinbase transactions, this is a negative Number of the total collected block fees (ie, not including the block subsidy); if key is not present, fee is unknown and clients MUST NOT assume there isn't one\n"
356 " \"sigops\" : n, (numeric) total number of SigOps, as counted for purposes of block limits; if key is not present, sigop count is unknown and clients MUST NOT assume there aren't any\n"
357 " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
358 " }\n"
359 " ,...\n"
360 " ],\n"
361 " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"
362 " \"flags\" : \"flags\" (string) \n"
363 " },\n"
364 " \"coinbasevalue\" : n, (numeric) maximum allowable input to coinbase transaction, including the generation award and transaction fees (in Satoshis)\n"
365 " \"coinbasetxn\" : { ... }, (json object) information for coinbase transaction\n"
366 " \"target\" : \"xxxx\", (string) The hash target\n"
367 " \"mintime\" : xxx, (numeric) The minimum timestamp appropriate for next block time in seconds since epoch (Jan 1 1970 GMT)\n"
368 " \"mutable\" : [ (array of string) list of ways the block template may be changed \n"
369 " \"value\" (string) A way the block template may be changed, e.g. 'time', 'transactions', 'prevblock'\n"
370 " ,...\n"
371 " ],\n"
372 " \"noncerange\" : \"00000000ffffffff\", (string) A range of valid nonces\n"
373 " \"sigoplimit\" : n, (numeric) limit of sigops in blocks\n"
374 " \"sizelimit\" : n, (numeric) limit of block size\n"
375 " \"curtime\" : ttt, (numeric) current timestamp in seconds since epoch (Jan 1 1970 GMT)\n"
376 " \"bits\" : \"xxx\", (string) compressed target of next block\n"
377 " \"height\" : n (numeric) The height of the next block\n"
378 "}\n"
379
380 "\nExamples:\n"

Callers

nothing calls this directly

Calls 15

HelpExampleCliFunction · 0.85
HelpExampleRpcFunction · 0.85
JSONRPCErrorFunction · 0.85
DecodeHexBlkFunction · 0.85
TestBlockValidityFunction · 0.85
BIP22ValidationResultFunction · 0.85
IsInitialBlockDownloadFunction · 0.85
atoi64Function · 0.85
IsRPCRunningFunction · 0.85
GetTimeFunction · 0.85
CreateNewBlockFunction · 0.85
UpdateTimeFunction · 0.85

Tested by

no test coverage detected