Skip to content

Commit a04bf92

Browse files
committed
[Move-only] Move tier two managers dump from init.cpp to a separate "tiertwo/init.cpp"
Same for budget finalization mode.
1 parent 77d8dcb commit a04bf92

File tree

3 files changed

+21
-9
lines changed

3 files changed

+21
-9
lines changed

src/init.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include "addrman.h"
1919
#include "amount.h"
2020
#include "bls/bls_wrapper.h"
21-
#include "budget/budgetdb.h"
22-
#include "budget/budgetmanager.h"
2321
#include "checkpoints.h"
2422
#include "compat/sanity.h"
2523
#include "consensus/upgrades.h"
@@ -31,7 +29,6 @@
3129
#include "invalid.h"
3230
#include "key.h"
3331
#include "mapport.h"
34-
#include "masternode-payments.h"
3532
#include "masternodeconfig.h"
3633
#include "masternodeman.h"
3734
#include "miner.h"
@@ -228,9 +225,7 @@ void Shutdown()
228225
g_connman.reset();
229226
peerLogic.reset();
230227

231-
DumpMasternodes();
232-
DumpBudgets(g_budgetman);
233-
DumpMasternodePayments();
228+
DumpTierTwo();
234229
if (::mempool.IsLoaded() && gArgs.GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
235230
DumpMempool(::mempool);
236231
}
@@ -1772,8 +1767,8 @@ bool AppInitMain()
17721767
}
17731768
}
17741769

1775-
//get the mode of budget voting for this masternode
1776-
g_budgetman.strBudgetMode = gArgs.GetArg("-budgetvotemode", "auto");
1770+
// set the mode of budget voting for this node
1771+
SetBudgetFinMode(gArgs.GetArg("-budgetvotemode", "auto"));
17771772

17781773
#ifdef ENABLE_WALLET
17791774
// !TODO: remove after complete transition to DMN
@@ -1807,7 +1802,6 @@ bool AppInitMain()
18071802
}
18081803

18091804
LogPrintf("fLiteMode %d\n", fLiteMode);
1810-
LogPrintf("Budget Mode %s\n", g_budgetman.strBudgetMode.c_str());
18111805

18121806
threadGroup.create_thread(std::bind(&ThreadCheckMasternodes));
18131807

src/tiertwo/init.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,17 @@ void RegisterTierTwoValidationInterface()
8080
{
8181
RegisterValidationInterface(&g_budgetman);
8282
RegisterValidationInterface(&masternodePayments);
83+
}
84+
85+
void DumpTierTwo()
86+
{
87+
DumpMasternodes();
88+
DumpBudgets(g_budgetman);
89+
DumpMasternodePayments();
90+
}
91+
92+
void SetBudgetFinMode(const std::string& mode)
93+
{
94+
g_budgetman.strBudgetMode = mode;
95+
LogPrintf("Budget Mode %s\n", g_budgetman.strBudgetMode);
8396
}

src/tiertwo/init.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ bool LoadTierTwo(int chain_active_height);
1212
/** Register all tier two objects */
1313
void RegisterTierTwoValidationInterface();
1414

15+
/** Dump tier two managers to disk */
16+
void DumpTierTwo();
17+
18+
void SetBudgetFinMode(const std::string& mode);
19+
1520

1621
#endif //PIVX_TIERTWO_INIT_H

0 commit comments

Comments
 (0)