diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-11-21 14:07:55 +1000 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-11-22 09:51:13 +1000 |
commit | c8b74258bad399d39262ed11b892a729196cb297 (patch) | |
tree | b91c7296f6d8ecde1c0297d57a68ecc8dc257ce2 /src/bitcoinrpc.cpp | |
parent | 34f5b0ab93e4f92e92531afa090caba06a031c68 (diff) |
setgenerate creates multiple blocks in -regtest mode
I'm writing some wallet regression tests using -regtest mode, and
need to generate an initial multi-hundred-block chain. Repeatedly
calling setgenerate to generate one block is slow and doesn't
work properly, because block creation happens asynchronously.
This adds two features to setgenerate in -regtest mode:
1) Instead of being interpreted as number of threads to start, the
third argument is the number of blocks to generate.
2) setgenerate will not return until the block creation threads
have created the requested number of blocks.
Diffstat (limited to 'src/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index a1e7d14dcc..3fe9f7eb99 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -238,7 +238,7 @@ static const CRPCCommand vRPCCommands[] = { "getdifficulty", &getdifficulty, true, false, false }, { "getnetworkhashps", &getnetworkhashps, true, false, false }, { "getgenerate", &getgenerate, true, false, false }, - { "setgenerate", &setgenerate, true, false, true }, + { "setgenerate", &setgenerate, true, true, false }, { "gethashespersec", &gethashespersec, true, false, false }, { "getinfo", &getinfo, true, false, false }, { "getmininginfo", &getmininginfo, true, false, false }, |