MCPcopy Create free account
hub / github.com/LUX-Core/lux / getblocktemplate

Function getblocktemplate

src/rpcmining.cpp:339–818  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337}
338
339UniValue getblocktemplate(const UniValue& params, bool fHelp)
340{
341 if (fHelp || params.size() > 1)
342 throw runtime_error(
343 "getblocktemplate ( \"jsonrequestobject\" )\n"
344 "\nIf the request parameters include a 'mode' key, that is used to explicitly select between the default 'template' request or a 'proposal'.\n"
345 "It returns data needed to construct a block to work on.\n"
346 "See https://en.bitcoin.it/wiki/BIP_0022 for full specification.\n"
347
348 "\nArguments:\n"
349 "1. \"jsonrequestobject\" (string, optional) A json object in the following spec\n"
350 " {\n"
351 " \"mode\":\"template\" (string, optional) This must be set to \"template\", \"proposal\" (see BIP 23), or omitted\n"
352 " \"capabilities\":[ (array, optional) A list of strings\n"
353 " \"support\" (string) client side supported feature, 'longpoll', 'coinbasetxn', 'coinbasevalue', 'proposal', 'serverlist', 'workid'\n"
354 " ,...\n"
355 " ],\n"
356 " \"rules\":[ (array, optional) A list of strings\n"
357 " \"support\" (string) client side supported softfork deployment\n"
358 " ,...\n"
359 " ]\n"
360 " }\n"
361 "\n"
362
363 "\nResult:\n"
364 "{\n"
365 " \"version\" : n, (numeric) The preferred block version\n"
366 " \"rules\" : [ \"rulename\", ... ], (array of strings) specific block rules that are to be enforced\n"
367 " \"vbavailable\" : { (json object) set of pending, supported versionbit (BIP 9) softfork deployments\n"
368 " \"rulename\" : bitnumber (numeric) identifies the bit number as indicating acceptance and readiness for the named softfork rule\n"
369 " ,...\n"
370 " },\n"
371 " \"vbrequired\" : n, (numeric) bit mask of versionbits the server requires set in submissions\n"
372 " \"previousblockhash\" : \"xxxx\", (string) The hash of current highest block\n"
373 " \"stateroot\" : \"xxxx\", (string) The state root hash of current block for smart contracts\n"
374 " \"utxoroot\" : \"xxxx\", (string) The UTXO root hash of current block for smart contracts\n"
375 " \"screfund\" : [{ (array) smart contract(s) refund address(es)\n"
376 " \"payee\" : \"xxx\", (string) smart contract refund address\n"
377 " \"script\" : \"xxxx\", (string) scriptPubKey in hexadecimal\n"
378 " \"amount\": n (numeric) required amount to refund\n"
379 " }],\n"
380 " \"transactions\" : [ (array) contents of non-coinbase transactions that should be included in the next block\n"
381 " {\n"
382 " \"data\" : \"xxxx\", (string) transaction data encoded in hexadecimal (byte-for-byte)\n"
383 " \"txid\" : \"xxxx\", (string) transaction id encoded in little-endian hexadecimal\n"
384 " \"hash\" : \"xxxx\", (string) hash encoded in little-endian hexadecimal (including witness data)\n"
385 " \"depends\" : [ (array) array of numbers \n"
386 " 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"
387 " ,...\n"
388 " ],\n"
389 " \"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"
390 " \"sigops\" : n, (numeric) total SigOps cost, as counted for purposes of block limits; if key is not present, sigop cost is unknown and clients MUST NOT assume it is zero\n"
391 " \"cost\" : n, (numeric) total transaction size cost, as counted for purposes of block limits\n"
392 " \"required\" : true|false (boolean) if provided and true, this transaction must be in the final block\n"
393 " }\n"
394 " ,...\n"
395 " ],\n"
396 " \"coinbaseaux\" : { (json object) data that should be included in the coinbase's scriptSig content\n"

Callers

nothing calls this directly

Calls 15

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

Tested by

no test coverage detected