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:
Cory Fields
2016-09-01 21:55:21 -04:00
parent 5b2ea29cf4
commit d6a5dc4a2e
5 changed files with 168 additions and 2 deletions
+1
View File
@@ -194,5 +194,6 @@ bool StartRPC();
void InterruptRPC();
void StopRPC();
std::string JSONRPCExecBatch(const UniValue& vReq);
void RPCNotifyBlockChange(bool ibd, const CBlockIndex *);
#endif // BITCOIN_RPCSERVER_H