RPC Browser

Arguments


Help Content

waitfornewblock ( timeout "current_tip" )

Waits for any new block and returns useful info about it.

Returns the current block on timeout or exit.

Make sure to use no RPC timeout (bitcoin-cli -rpcclienttimeout=0)

Arguments:
1. timeout        (numeric, optional, default=0) Time in milliseconds to wait for a response. 0 indicates no timeout.
2. current_tip    (string, optional) Method waits for the chain tip to differ from this.

Result:
{                    (json object)
  "hash" : "hex",    (string) The blockhash
  "height" : n       (numeric) Block height
}

Examples:
> bitcoin-cli waitfornewblock 1000
> curl --user myusername --data-binary '{"jsonrpc": "2.0", "id": "curltest", "method": "waitfornewblock", "params": [1000]}' -H 'content-type: application/json' http://127.0.0.1:8332/

timeout

{
    "name": "timeout",
    "detailsLines": [],
    "properties": [
        "numeric",
        "optional",
        "default=0"
    ],
    "description": "Time in milliseconds to wait for a response. 0 indicates no timeout."
}

current_tip

{
    "name": "current_tip",
    "detailsLines": [],
    "properties": [
        "string",
        "optional"
    ],
    "description": "Method waits for the chain tip to differ from this."
}

Recent (5)

Blockchain (38)

Control (6)

Mining (7)

Network (14)

Rawtransactions (20)

Signer (1)

Util (8)

Zmq (1)