mirror of
https://github.com/dashpay/dash.git
synced 2024-12-24 11:32:46 +01:00
fix: force ehf signal db update
This commit is contained in:
parent
94d80323d4
commit
05041a4572
@ -375,6 +375,25 @@ void CMNHFManager::ConnectManagers(gsl::not_null<ChainstateManager*> chainman, g
|
||||
m_qman = qman;
|
||||
}
|
||||
|
||||
bool CMNHFManager::ForceSignalDBUpdate()
|
||||
{
|
||||
// force ehf signals db update
|
||||
auto dbTx = m_evoDb.BeginTransaction();
|
||||
|
||||
const bool last_legacy = bls::bls_legacy_scheme.load();
|
||||
bls::bls_legacy_scheme.store(false);
|
||||
GetSignalsStage(m_chainman->ActiveChainstate().m_chain.Tip());
|
||||
bls::bls_legacy_scheme.store(last_legacy);
|
||||
|
||||
dbTx->Commit();
|
||||
// flush it to disk
|
||||
if (!m_evoDb.CommitRootTransaction()) {
|
||||
LogPrintf("CMNHFManager::%s -- failed to commit to evoDB\n", __func__);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string MNHFTx::ToString() const
|
||||
{
|
||||
return strprintf("MNHFTx(versionBit=%d, quorumHash=%s, sig=%s)",
|
||||
|
@ -155,6 +155,8 @@ public:
|
||||
*/
|
||||
void DisconnectManagers() { m_chainman = nullptr; m_qman = nullptr; };
|
||||
|
||||
bool ForceSignalDBUpdate();
|
||||
|
||||
private:
|
||||
void AddToCache(const Signals& signals, const CBlockIndex* const pindex);
|
||||
|
||||
|
@ -2058,6 +2058,10 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
||||
strLoadError = _("Error upgrading evo database");
|
||||
break;
|
||||
}
|
||||
if (!node.mnhf_manager->ForceSignalDBUpdate()) {
|
||||
strLoadError = _("Error upgrading evo database for EHF");
|
||||
break;
|
||||
}
|
||||
|
||||
for (CChainState* chainstate : chainman.GetAll()) {
|
||||
if (!is_coinsview_empty(chainstate)) {
|
||||
|
Loading…
Reference in New Issue
Block a user