aboutsummaryrefslogtreecommitdiff
path: root/src/coins.h
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-06-05 20:28:08 -0400
committerMatt Corallo <git@bluematt.me>2017-06-09 13:10:08 -0400
commit9417d7a336e71ee31ce673a6de5abb3d56941204 (patch)
tree012e3d7d3005a47a0ec8bf17df6ccf2d47828bc7 /src/coins.h
parentf58349ca856fc59704fb78c19267b1cef1c9650b (diff)
downloadbitcoin-9417d7a336e71ee31ce673a6de5abb3d56941204.tar.xz
Be much more agressive in AccessCoin docs.
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.
Diffstat (limited to 'src/coins.h')
-rw-r--r--src/coins.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/coins.h b/src/coins.h
index 4a0eaadc82..89613a61b4 100644
--- a/src/coins.h
+++ b/src/coins.h
@@ -222,8 +222,13 @@ public:
/**
* 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;