0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-04 13:55:23 -05:00

Get rid of -Wthread-safety-precise warnings

This commit is contained in:
Hennadii Stepanov 2020-05-28 09:55:39 +03:00
parent 971a468ccf
commit 9cc6eb3c9e
No known key found for this signature in database
GPG key ID: 410108112E7EA81F
3 changed files with 6 additions and 7 deletions

View file

@ -105,13 +105,12 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
std::vector<bool> have_txn(txn_available.size()); std::vector<bool> have_txn(txn_available.size());
{ {
LOCK(pool->cs); LOCK(pool->cs);
const std::vector<std::pair<uint256, CTxMemPool::txiter> >& vTxHashes = pool->vTxHashes; for (size_t i = 0; i < pool->vTxHashes.size(); i++) {
for (size_t i = 0; i < vTxHashes.size(); i++) { uint64_t shortid = cmpctblock.GetShortID(pool->vTxHashes[i].first);
uint64_t shortid = cmpctblock.GetShortID(vTxHashes[i].first);
std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid); std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);
if (idit != shorttxids.end()) { if (idit != shorttxids.end()) {
if (!have_txn[idit->second]) { if (!have_txn[idit->second]) {
txn_available[idit->second] = vTxHashes[i].second->GetSharedTx(); txn_available[idit->second] = pool->vTxHashes[i].second->GetSharedTx();
have_txn[idit->second] = true; have_txn[idit->second] = true;
mempool_count++; mempool_count++;
} else { } else {

View file

@ -126,7 +126,7 @@ class PartiallyDownloadedBlock {
protected: protected:
std::vector<CTransactionRef> txn_available; std::vector<CTransactionRef> txn_available;
size_t prefilled_count = 0, mempool_count = 0, extra_count = 0; size_t prefilled_count = 0, mempool_count = 0, extra_count = 0;
CTxMemPool* pool; const CTxMemPool* pool;
public: public:
CBlockHeader header; CBlockHeader header;
explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {} explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}

View file

@ -746,7 +746,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
// the user could have gotten from another RPC command prior to now // the user could have gotten from another RPC command prior to now
wallet.BlockUntilSyncedToCurrentChain(); wallet.BlockUntilSyncedToCurrentChain();
LOCK2(pwallet->cs_wallet, spk_man.cs_KeyStore); LOCK2(wallet.cs_wallet, spk_man.cs_KeyStore);
EnsureWalletIsUnlocked(&wallet); EnsureWalletIsUnlocked(&wallet);
@ -769,7 +769,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
std::map<CKeyID, int64_t> mapKeyBirth; std::map<CKeyID, int64_t> mapKeyBirth;
const std::map<CKeyID, int64_t>& mapKeyPool = spk_man.GetAllReserveKeys(); const std::map<CKeyID, int64_t>& mapKeyPool = spk_man.GetAllReserveKeys();
pwallet->GetKeyBirthTimes(mapKeyBirth); wallet.GetKeyBirthTimes(mapKeyBirth);
std::set<CScriptID> scripts = spk_man.GetCScripts(); std::set<CScriptID> scripts = spk_man.GetCScripts();