From 24e44c354d5b9174cb9cb7d157a985e197aa7886 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Wed, 7 Jun 2017 13:00:11 -0400 Subject: Don't return stale data from CCoinsViewCache::Cursor() CCoinsViewCache doesn't actually support cursor iteration returning the current contents of the cache, so raise an error when the cursor method is called instead of returning a cursor that iterates over stale data. Also update the gettxoutsetinfo RPC which was relying on the old behavior to be explicit about which view it is returning data about. --- src/coins.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/coins.h') diff --git a/src/coins.h b/src/coins.h index 476db8f37c..b10c7ea9a0 100644 --- a/src/coins.h +++ b/src/coins.h @@ -212,6 +212,9 @@ public: uint256 GetBestBlock() const; void SetBestBlock(const uint256 &hashBlock); bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock); + CCoinsViewCursor* Cursor() const { + throw std::logic_error("CCoinsViewCache cursor iteration not supported."); + } /** * Check if we have the given utxo already loaded in this cache. -- cgit v1.2.3