Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/evo/evodb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ void CEvoDB::RollbackCurTransaction()

bool CEvoDB::CommitRootTransaction()
{
LOCK(cs);
assert(curDBTransaction.IsClean());
rootDBTransaction.Commit();
bool ret = db.WriteBatch(rootBatch);
Expand Down
3 changes: 3 additions & 0 deletions src/llmq/quorums_chainlocks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ bool CChainLocksHandler::IsTxSafeForMining(const uint256& txid)
// This should also not be called from validation signals, as this might result in recursive calls
void CChainLocksHandler::EnforceBestChainLock()
{
AssertLockNotHeld(cs);
AssertLockNotHeld(cs_main);

CChainLockSig clsig;
const CBlockIndex* pindex;
const CBlockIndex* currentBestChainLockBlockIndex;
Expand Down
6 changes: 5 additions & 1 deletion src/llmq/quorums_instantsend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,10 @@ bool CInstantSendManager::ProcessTx(const CTransaction& tx, bool allowReSigning,
for (size_t i = 0; i < tx.vin.size(); i++) {
auto& in = tx.vin[i];
auto& id = ids[i];
inputRequestIds.emplace(id);
{
LOCK(cs);
inputRequestIds.emplace(id);
}
LogPrint(BCLog::INSTANTSEND, "CInstantSendManager::%s -- txid=%s: trying to vote on input %s with id %s. allowReSigning=%d\n", __func__,
tx.GetHash().ToString(), in.prevout.ToStringShort(), id.ToString(), allowReSigning);
if (quorumSigningManager->AsyncSignIfMember(llmqType, id, tx.GetHash(), allowReSigning)) {
Expand Down Expand Up @@ -1119,6 +1122,7 @@ void CInstantSendManager::RemoveConflictedTx(const CTransaction& tx)

void CInstantSendManager::TruncateRecoveredSigsForInputs(const llmq::CInstantSendLock& islock)
{
AssertLockHeld(cs);
auto& consensusParams = Params().GetConsensus();

for (auto& in : islock.inputs) {
Expand Down
9 changes: 5 additions & 4 deletions src/spork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,6 @@ bool CSporkManager::UpdateSpork(SporkId nSporkID, int64_t nValue, CConnman& conn
{
CSporkMessage spork = CSporkMessage(nSporkID, nValue, GetAdjustedTime());

LOCK(cs);

if (!spork.Sign(sporkPrivKey)) {
LogPrintf("CSporkManager::%s -- ERROR: signing failed for spork %d\n", __func__, nSporkID);
return false;
Expand All @@ -201,8 +199,11 @@ bool CSporkManager::UpdateSpork(SporkId nSporkID, int64_t nValue, CConnman& conn

LogPrintf("CSporkManager::%s -- signed %d %s\n", __func__, nSporkID, spork.GetHash().ToString());

mapSporksByHash[spork.GetHash()] = spork;
mapSporksActive[nSporkID][keyIDSigner] = spork;
{
LOCK(cs);
mapSporksByHash[spork.GetHash()] = spork;
mapSporksActive[nSporkID][keyIDSigner] = spork;
}

spork.Relay(connman);
return true;
Expand Down
1 change: 1 addition & 0 deletions src/spork.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ class CSporkManager
// we don't serialize pubkey ids because pubkeys should be
// hardcoded or be setted with cmdline or options, should
// not reuse pubkeys from previous dashd run
LOCK(cs);
READWRITE(mapSporksByHash);
READWRITE(mapSporksActive);
// we don't serialize private key to prevent its leakage
Expand Down