mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
trivial: access activeMasternodeInfo when lock is in scope
This commit is contained in:
parent
1c30df0afe
commit
9a3c5a3c48
15
src/init.cpp
15
src/init.cpp
@ -1606,8 +1606,11 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
|
||||
StartScriptCheckWorkerThreads(script_threads);
|
||||
}
|
||||
|
||||
assert(activeMasternodeInfo.blsKeyOperator == nullptr);
|
||||
assert(activeMasternodeInfo.blsPubKeyOperator == nullptr);
|
||||
{
|
||||
LOCK(activeMasternodeInfoCs);
|
||||
assert(activeMasternodeInfo.blsKeyOperator == nullptr);
|
||||
assert(activeMasternodeInfo.blsPubKeyOperator == nullptr);
|
||||
}
|
||||
fMasternodeMode = false;
|
||||
std::string strMasterNodeBLSPrivKey = args.GetArg("-masternodeblsprivkey", "");
|
||||
if (!strMasterNodeBLSPrivKey.empty()) {
|
||||
@ -1620,11 +1623,11 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
|
||||
LOCK(activeMasternodeInfoCs);
|
||||
activeMasternodeInfo.blsKeyOperator = std::make_unique<CBLSSecretKey>(keyOperator);
|
||||
activeMasternodeInfo.blsPubKeyOperator = std::make_unique<CBLSPublicKey>(keyOperator.GetPublicKey());
|
||||
// We don't know the actual scheme at this point, print both
|
||||
LogPrintf("MASTERNODE:\n blsPubKeyOperator legacy: %s\n blsPubKeyOperator basic: %s\n",
|
||||
activeMasternodeInfo.blsPubKeyOperator->ToString(true),
|
||||
activeMasternodeInfo.blsPubKeyOperator->ToString(false));
|
||||
}
|
||||
// We don't know the actual scheme at this point, print both
|
||||
LogPrintf("MASTERNODE:\n blsPubKeyOperator legacy: %s\n blsPubKeyOperator basic: %s\n",
|
||||
activeMasternodeInfo.blsPubKeyOperator->ToString(true),
|
||||
activeMasternodeInfo.blsPubKeyOperator->ToString(false));
|
||||
} else {
|
||||
LOCK(activeMasternodeInfoCs);
|
||||
activeMasternodeInfo.blsKeyOperator = std::make_unique<CBLSSecretKey>();
|
||||
|
Loading…
Reference in New Issue
Block a user