Skip to content

Commit

Permalink
Be much more agressive in AccessCoin docs.
Browse files Browse the repository at this point in the history
While the current implementation is pretty free, there is a lot
of possibility for this to blow up in our face with future changes,
especially as the backing map gets tweaked.
  • Loading branch information
TheBlueMatt committed Jun 9, 2017
1 parent f58349c commit 9417d7a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/coins.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,13 @@ class CCoinsViewCache : public CCoinsViewBacked

/**
* Return a reference to Coin in the cache, or a pruned one if not found. This is
* more efficient than GetCoin. Modifications to other cache entries are
* allowed while accessing the returned pointer.
* more efficient than GetCoin.
*
* Generally, do not hold the reference returned for more than a short scope.
* While the current implementation allows for modifications to the contents
* of the cache while holding the reference, this behavior should not be relied
* on! To be safe, best to not hold the returned reference through any other
* calls to this cache.
*/
const Coin& AccessCoin(const COutPoint &output) const;

Expand Down

0 comments on commit 9417d7a

Please sign in to comment.