Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(rpc): Asset Unlock status by index #5776

Merged
7 changes: 4 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ void PrepareShutdown(NodeContext& node)
llmq::quorumSnapshotManager.reset();
deterministicMNManager.reset();
creditPoolManager.reset();
node.creditPoolManager = nullptr;
node.mnhf_manager.reset();
node.evodb.reset();
}
Expand Down Expand Up @@ -1924,8 +1925,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
node.evodb = std::make_unique<CEvoDB>(nEvoDbCache, false, fReset || fReindexChainState);
node.mnhf_manager.reset();
node.mnhf_manager = std::make_unique<CMNHFManager>(*node.evodb);
node.creditPoolManager.reset();
node.creditPoolManager = std::make_unique<CCreditPoolManager>(*node.evodb);

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: extra \n


chainman.Reset();
chainman.InitializeChainstate(Assert(node.mempool.get()), *node.mnhf_manager, *node.evodb, llmq::chainLocksHandler, llmq::quorumInstantSendManager, llmq::quorumBlockProcessor);
Expand All @@ -1943,7 +1943,8 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
deterministicMNManager.reset();
deterministicMNManager.reset(new CDeterministicMNManager(chainman.ActiveChainstate(), *node.connman, *node.evodb));
creditPoolManager.reset();
creditPoolManager.reset(new CCreditPoolManager(*node.evodb));
creditPoolManager = std::make_unique<CCreditPoolManager>(*node.evodb);
node.creditPoolManager = creditPoolManager.get();
llmq::quorumSnapshotManager.reset();
llmq::quorumSnapshotManager.reset(new llmq::CQuorumSnapshotManager(*node.evodb));

Expand Down
2 changes: 1 addition & 1 deletion src/node/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ struct NodeContext {
std::function<void()> rpc_interruption_point = [] {};
//! Dash
std::unique_ptr<LLMQContext> llmq_ctx;
std::unique_ptr<CCreditPoolManager> creditPoolManager;
CCreditPoolManager* creditPoolManager;
std::unique_ptr<CMNHFManager> mnhf_manager;
std::unique_ptr<CJContext> cj_ctx;

Expand Down
9 changes: 7 additions & 2 deletions src/test/util/setup_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ BasicTestingSetup::BasicTestingSetup(const std::string& chainName, const std::ve
connman = std::make_unique<CConnman>(0x1337, 0x1337, *m_node.addrman);
llmq::quorumSnapshotManager.reset(new llmq::CQuorumSnapshotManager(*m_node.evodb));
creditPoolManager = std::make_unique<CCreditPoolManager>(*m_node.evodb);
m_node.creditPoolManager = creditPoolManager.get();
static bool noui_connected = false;
if (!noui_connected) {
noui_connect();
Expand All @@ -182,6 +183,7 @@ BasicTestingSetup::~BasicTestingSetup()
connman.reset();
llmq::quorumSnapshotManager.reset();
creditPoolManager.reset();
m_node.creditPoolManager = nullptr;
m_node.mnhf_manager.reset();
m_node.evodb.reset();

Expand Down Expand Up @@ -215,7 +217,9 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
::mmetaman = std::make_unique<CMasternodeMetaMan>(/* load_cache */ false);
::netfulfilledman = std::make_unique<CNetFulfilledRequestManager>(/* load_cache */ false);

m_node.creditPoolManager = std::make_unique<CCreditPoolManager>(*m_node.evodb);
creditPoolManager = std::make_unique<CCreditPoolManager>(*m_node.evodb);
m_node.creditPoolManager = creditPoolManager.get();


// Start script-checking threads. Set g_parallel_script_checks to true so they are used.
constexpr int script_check_threads = 2;
Expand All @@ -226,7 +230,8 @@ ChainTestingSetup::ChainTestingSetup(const std::string& chainName, const std::ve
ChainTestingSetup::~ChainTestingSetup()
{
m_node.scheduler->stop();
m_node.creditPoolManager.reset();
creditPoolManager.reset();
m_node.creditPoolManager = nullptr;
StopScriptCheckWorkerThreads();
GetMainSignals().FlushBackgroundCallbacks();
GetMainSignals().UnregisterBackgroundSignalScheduler();
Expand Down