Language

Choose a language

/build/rpc / btc

preciousblock

preciousblock "blockhash" Treats a block as if it were received before others with the same work. A later preciousblock call can override the effect of an earlier one. The effects of preciousblock are not retained across restarts. Arguments: 1. blockhash (string, required) the hash of the block to mark as precious Result: null (json null) Examples: > bitcoin-cli preciousblock "blockhash" > curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "preciousblock", "params": ["blockhash"]}' -H 'content-type: application/json' http://127.0.0.1:8332/

Signature

preciousblock(blockhash: string) → any

Code samples

curl --user "$RPC_USER:$RPC_PASS" \
  --data-binary '{"jsonrpc":"1.0","id":"docs","method":"preciousblock","params":["\"<blockhash>\""]}' \
  -H 'content-type: text/plain;' \
  http://127.0.0.1:8332/

Parameters

NameTypeReq.Description
blockhashstringyesthe hash of the block to mark as precious

Result

Type:  any

null (json null)

Source: services/core-node/bcore/src/rpc/blockchain.cpp:1590

C++ symbol: preciousblock