mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-09 06:09:48 +02:00
Add ChainClient setMockTime, getWallets methods
Needed to set mock times, and get wallet interface pointers correctly when wallet code is running in a different process from node code.
This commit is contained in:
@@ -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>
|
||||
@@ -356,7 +357,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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user