mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge 602b038d43 into merged_master (Bitcoin PR #21366)
This commit is contained in:
commit
d20af8f9ea
23 changed files with 90 additions and 156 deletions
|
|
@ -20,7 +20,6 @@
|
|||
#include <script/descriptor.h>
|
||||
#include <util/check.h>
|
||||
#include <util/message.h> // For MessageSign(), MessageVerify()
|
||||
#include <util/ref.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/system.h>
|
||||
|
||||
|
|
@ -427,8 +426,9 @@ static RPCHelpMan setmocktime()
|
|||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Mocktime can not be negative: %s.", time));
|
||||
}
|
||||
SetMockTime(time);
|
||||
if (request.context.Has<NodeContext>()) {
|
||||
for (const auto& chain_client : request.context.Get<NodeContext>().chain_clients) {
|
||||
auto node_context = util::AnyPtr<NodeContext>(request.context);
|
||||
if (node_context) {
|
||||
for (const auto& chain_client : node_context->chain_clients) {
|
||||
chain_client->setMockTime(time);
|
||||
}
|
||||
}
|
||||
|
|
@ -460,11 +460,11 @@ static RPCHelpMan mockscheduler()
|
|||
throw std::runtime_error("delta_time must be between 1 and 3600 seconds (1 hr)");
|
||||
}
|
||||
|
||||
auto node_context = util::AnyPtr<NodeContext>(request.context);
|
||||
// protect against null pointer dereference
|
||||
CHECK_NONFATAL(request.context.Has<NodeContext>());
|
||||
NodeContext& node = request.context.Get<NodeContext>();
|
||||
CHECK_NONFATAL(node.scheduler);
|
||||
node.scheduler->MockForward(std::chrono::seconds(delta_seconds));
|
||||
CHECK_NONFATAL(node_context);
|
||||
CHECK_NONFATAL(node_context->scheduler);
|
||||
node_context->scheduler->MockForward(std::chrono::seconds(delta_seconds));
|
||||
|
||||
return NullUniValue;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue