From 029c14392213b76de34a8d62f8dcdd03f2246a54 Mon Sep 17 00:00:00 2001 From: Tom Ritchford Date: Sun, 7 Dec 2014 13:01:57 -0500 Subject: [PATCH] Add a comment to ledger/Ledger.h. --- src/ripple/app/ledger/Ledger.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ripple/app/ledger/Ledger.h b/src/ripple/app/ledger/Ledger.h index 9c4e1f6f0f..11f9f8a483 100644 --- a/src/ripple/app/ledger/Ledger.h +++ b/src/ripple/app/ledger/Ledger.h @@ -66,6 +66,16 @@ class SqliteStatement; of data. It all depends on what is in the corresponding SHAMap entry. Various functions are provided to populate or depopulate the caches that the object holds references to. + + Ledgers are constructed as either mutable or immutable. + + 1) If you are the sole owner of a mutable ledger, you can do whatever you + want with no need for locks. + + 2) If you have an immutable ledger, you cannot ever change it, so no need + for locks. + + 3) Mutable ledgers cannot be shared. */ class Ledger : public std::enable_shared_from_this @@ -381,7 +391,7 @@ public: SLE::pointer getRippleState (uint256 const& uNode) const; - + SLE::pointer getRippleState ( Account const& a, Account const& b, Currency const& currency) const;