MCPcopy Create free account
hub / github.com/LUX-Core/lux / CleanTransactionLocksList

Function CleanTransactionLocksList

src/instantx.cpp:431–459  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

429}
430
431void CleanTransactionLocksList() {
432 if (chainActive.Tip() == NULL) return;
433
434 std::map<uint256, CTransactionLock>::iterator it = mapTxLocks.begin();
435
436 while (it != mapTxLocks.end()) {
437 if (GetTime() > it->second.nExpiration) { //keep them for an hour
438 LogPrintf("Removing old transaction lock %s\n", it->second.txHash.ToString().c_str());
439
440 if (mapTxLockReq.count(it->second.txHash)) {
441 CTransaction& tx = mapTxLockReq[it->second.txHash];
442
443 for (const CTxIn& in : tx.vin)
444 mapLockedInputs.erase(in.prevout);
445
446 mapTxLockReq.erase(it->second.txHash);
447 mapTxLockReqRejected.erase(it->second.txHash);
448
449 for (CConsensusVote& v : it->second.vecConsensusVotes)
450 mapTxLockVote.erase(v.GetHash());
451 }
452
453 mapTxLocks.erase(it++);
454 } else {
455 it++;
456 }
457 }
458
459}
460
461uint256 CConsensusVote::GetHash() const {
462 return vinMasternode.prevout.hash + vinMasternode.prevout.n + txHash;

Callers 1

ThreadCheckDarkSendPoolFunction · 0.85

Calls 8

GetTimeFunction · 0.85
TipMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ToStringMethod · 0.45
countMethod · 0.45
eraseMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected