mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
add waitfornewblock/waitforblock/waitforblockheight rpcs and use them for tests
waitfornewblock waits until a new block is received, or the timeout expires, then returns the current block height/hash. waitforblock waits for a specific blockhash, or until the timeout expires, then returns the current block height/hash. If the target blockhash is the current tip, it will return immediately. waitforblockheight waits until the tip has reached a certain height or higher, then returns the current height and hash. waitforblockheight is used to avoid polling in the rpc tests.
This commit is contained in:
@@ -46,6 +46,12 @@ static const CRPCConvertParam vRPCConvertParams[] =
|
||||
{ "getbalance", 1 },
|
||||
{ "getbalance", 2 },
|
||||
{ "getblockhash", 0 },
|
||||
{ "waitforblockheight", 0 },
|
||||
{ "waitforblockheight", 1 },
|
||||
{ "waitforblock", 1 },
|
||||
{ "waitforblock", 2 },
|
||||
{ "waitfornewblock", 0 },
|
||||
{ "waitfornewblock", 1 },
|
||||
{ "move", 2 },
|
||||
{ "move", 3 },
|
||||
{ "sendfrom", 2 },
|
||||
|
||||
Reference in New Issue
Block a user