waitfornewblock

Back to blockchain

Summary

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

Description

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 (qbit-cli -rpcclienttimeout=0)

Arguments

  • timeout (NUM): Time in milliseconds to wait for a response. 0 indicates no timeout.
  • current_tip (STR_HEX): Method waits for the chain tip to differ from this.

Results

  • value (OBJ): No description.
  • hash (STR_HEX): The blockhash
  • height (NUM): Block height

Examples

qbit-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:8352/