Skip to content

Commit 9cc6eb3

Browse files
committed
Get rid of -Wthread-safety-precise warnings
1 parent 971a468 commit 9cc6eb3

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/blockencodings.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,12 @@ ReadStatus PartiallyDownloadedBlock::InitData(const CBlockHeaderAndShortTxIDs& c
105105
std::vector<bool> have_txn(txn_available.size());
106106
{
107107
LOCK(pool->cs);
108-
const std::vector<std::pair<uint256, CTxMemPool::txiter> >& vTxHashes = pool->vTxHashes;
109-
for (size_t i = 0; i < vTxHashes.size(); i++) {
110-
uint64_t shortid = cmpctblock.GetShortID(vTxHashes[i].first);
108+
for (size_t i = 0; i < pool->vTxHashes.size(); i++) {
109+
uint64_t shortid = cmpctblock.GetShortID(pool->vTxHashes[i].first);
111110
std::unordered_map<uint64_t, uint16_t>::iterator idit = shorttxids.find(shortid);
112111
if (idit != shorttxids.end()) {
113112
if (!have_txn[idit->second]) {
114-
txn_available[idit->second] = vTxHashes[i].second->GetSharedTx();
113+
txn_available[idit->second] = pool->vTxHashes[i].second->GetSharedTx();
115114
have_txn[idit->second] = true;
116115
mempool_count++;
117116
} else {

src/blockencodings.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class PartiallyDownloadedBlock {
126126
protected:
127127
std::vector<CTransactionRef> txn_available;
128128
size_t prefilled_count = 0, mempool_count = 0, extra_count = 0;
129-
CTxMemPool* pool;
129+
const CTxMemPool* pool;
130130
public:
131131
CBlockHeader header;
132132
explicit PartiallyDownloadedBlock(CTxMemPool* poolIn) : pool(poolIn) {}

src/wallet/rpcdump.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
746746
// the user could have gotten from another RPC command prior to now
747747
wallet.BlockUntilSyncedToCurrentChain();
748748

749-
LOCK2(pwallet->cs_wallet, spk_man.cs_KeyStore);
749+
LOCK2(wallet.cs_wallet, spk_man.cs_KeyStore);
750750

751751
EnsureWalletIsUnlocked(&wallet);
752752

@@ -769,7 +769,7 @@ UniValue dumpwallet(const JSONRPCRequest& request)
769769

770770
std::map<CKeyID, int64_t> mapKeyBirth;
771771
const std::map<CKeyID, int64_t>& mapKeyPool = spk_man.GetAllReserveKeys();
772-
pwallet->GetKeyBirthTimes(mapKeyBirth);
772+
wallet.GetKeyBirthTimes(mapKeyBirth);
773773

774774
std::set<CScriptID> scripts = spk_man.GetCScripts();
775775

0 commit comments

Comments
 (0)