Merge #17999: refactor: Add ChainClient setMockTime, getWallets methods

3ce16ad2f9 refactor: Use psbt forward declaration (Russell Yanofsky)
1dde238f2c Add ChainClient setMockTime, getWallets methods (Russell Yanofsky)

Pull request description:

  This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10).

  These changes are needed to set mock times, and get wallet interface pointers correctly when
  wallet code is running in a different process from node code in #10102

ACKs for top commit:
  MarcoFalke:
    re-ACK 3ce16ad2f9 🔙
  promag:
    Code review ACK 3ce16ad2f9.

Tree-SHA512: 6c093bfcd68adf5858a1aade4361cdb7fb015496673504ac7a93d0bd2595215047184551d6fd526baa27782331cd2819ce45c4cf923b205ce93ac29e485b5dd8
This commit is contained in:
MarcoFalke
2020-04-10 12:57:28 -04:00
6 changed files with 31 additions and 7 deletions

View File

@@ -4,6 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <httpserver.h>
#include <interfaces/chain.h>
#include <key_io.h>
#include <node/context.h>
#include <outputtype.h>
@@ -363,7 +364,13 @@ static UniValue setmocktime(const JSONRPCRequest& request)
LOCK(cs_main);
RPCTypeCheck(request.params, {UniValue::VNUM});
SetMockTime(request.params[0].get_int64());
int64_t time = request.params[0].get_int64();
SetMockTime(time);
if (g_rpc_node) {
for (const auto& chain_client : g_rpc_node->chain_clients) {
chain_client->setMockTime(time);
}
}
return NullUniValue;
}