mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 23:18:14 +01:00
Use unique_ptr for pcoinscatcher/pcoinsdbview/pcoinsTip/pblocktree
* pcoinscatcher (CCoinsViewErrorCatcher) * pcoinsdbview (CCoinsViewDB) * pcoinsTip (CCoinsViewCache) * pblocktree (CBlockTreeDB) * Remove variables shadowing pcoinsdbview
This commit is contained in:
@@ -928,7 +928,7 @@ UniValue gettxoutsetinfo(const JSONRPCRequest& request)
|
||||
|
||||
CCoinsStats stats;
|
||||
FlushStateToDisk();
|
||||
if (GetUTXOStats(pcoinsdbview, stats)) {
|
||||
if (GetUTXOStats(pcoinsdbview.get(), stats)) {
|
||||
ret.push_back(Pair("height", (int64_t)stats.nHeight));
|
||||
ret.push_back(Pair("bestblock", stats.hashBlock.GetHex()));
|
||||
ret.push_back(Pair("transactions", (int64_t)stats.nTransactions));
|
||||
@@ -996,7 +996,7 @@ UniValue gettxout(const JSONRPCRequest& request)
|
||||
Coin coin;
|
||||
if (fMempool) {
|
||||
LOCK(mempool.cs);
|
||||
CCoinsViewMemPool view(pcoinsTip, mempool);
|
||||
CCoinsViewMemPool view(pcoinsTip.get(), mempool);
|
||||
if (!view.GetCoin(out, coin) || mempool.isSpent(out)) {
|
||||
return NullUniValue;
|
||||
}
|
||||
@@ -1048,7 +1048,7 @@ UniValue verifychain(const JSONRPCRequest& request)
|
||||
if (!request.params[1].isNull())
|
||||
nCheckDepth = request.params[1].get_int();
|
||||
|
||||
return CVerifyDB().VerifyDB(Params(), pcoinsTip, nCheckLevel, nCheckDepth);
|
||||
return CVerifyDB().VerifyDB(Params(), pcoinsTip.get(), nCheckLevel, nCheckDepth);
|
||||
}
|
||||
|
||||
/** Implementation of IsSuperMajority with better feedback */
|
||||
|
||||
Reference in New Issue
Block a user