Skip to content

Commit 31b5de2

Browse files
committed
test
1 parent af1b642 commit 31b5de2

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/dynafed.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ bool NextBlockIsParameterTransition(const CBlockIndex* pindexPrev, const Consens
1111
winning_entry.SetNull();
1212
return false;
1313
}
14+
LOCK(cs_main);
1415
std::map<uint256, uint32_t> vote_tally;
1516
assert(next_height >= consensus.dynamic_epoch_length);
1617
for (int32_t height = next_height - 1; height >= (int32_t)(next_height - consensus.dynamic_epoch_length); --height) {
@@ -62,6 +63,7 @@ DynaFedParamEntry ComputeNextBlockFullCurrentParameters(const CBlockIndex* pinde
6263
// may be pre-dynafed params
6364
const CBlockIndex* p_epoch_start = pindexPrev->GetAncestor(epoch_start_height);
6465
assert(p_epoch_start);
66+
LOCK(cs_main);
6567
ForceUntrimHeader(p_epoch_start);
6668
if (p_epoch_start->dynafed_params().IsNull()) {
6769
// We need to construct the "full" current parameters of pre-dynafed
@@ -96,6 +98,7 @@ DynaFedParamEntry ComputeNextBlockCurrentParameters(const CBlockIndex* pindexPre
9698
{
9799
assert(pindexPrev);
98100

101+
LOCK(cs_main);
99102
ForceUntrimHeader(pindexPrev);
100103
DynaFedParamEntry entry = ComputeNextBlockFullCurrentParameters(pindexPrev, consensus);
101104

src/pegins.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ std::vector<std::pair<CScript, CScript>> GetValidFedpegScripts(const CBlockIndex
475475
fedpegscripts.push_back(std::make_pair(next_param.m_fedpeg_program, next_param.m_fedpegscript));
476476
}
477477

478+
LOCK(cs_main);
478479
// Next we walk backwards up to M epoch starts
479480
for (int32_t i = 0; i < (int32_t) params.total_valid_epochs; i++) {
480481
// We are within total_valid_epochs of the genesis

src/validation.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2510,6 +2510,7 @@ void CChainState::UpdateTip(const CBlockIndex* pindexNew)
25102510
this->CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), this->CoinsTip().GetCacheSize(),
25112511
!warning_messages.empty() ? strprintf(" warning='%s'", warning_messages.original) : "");
25122512

2513+
LOCK(cs_main);
25132514
ForceUntrimHeader(pindexNew);
25142515
// Do some logging if dynafed parameters changed.
25152516
if (pindexNew->pprev && !pindexNew->dynafed_params().IsNull()) {

0 commit comments

Comments
 (0)