diff options
author | John Wiegley <johnw@newartisans.com> | 2014-04-13 23:25:31 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2014-04-13 23:26:14 -0500 |
commit | 8f8a94c28e26c0b46a43e89d566c941994645de7 (patch) | |
tree | 3cbd52816734c55fb6233b9a3f7fb35cb0b36fd9 /src/account.cc | |
parent | 634aa589cd97d088524ae2fb68ec6120d5e4a873 (diff) | |
download | fork-ledger-8f8a94c28e26c0b46a43e89d566c941994645de7.tar.gz fork-ledger-8f8a94c28e26c0b46a43e89d566c941994645de7.tar.bz2 fork-ledger-8f8a94c28e26c0b46a43e89d566c941994645de7.zip |
Add the concept of "deferred postings"
This is pretty much exclusively for allowing one to use balance
assertions with replicated transactions across multiple files.
Diffstat (limited to 'src/account.cc')
-rw-r--r-- | src/account.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc index 4b3a4e97..a702cf11 100644 --- a/src/account.cc +++ b/src/account.cc @@ -139,6 +139,21 @@ void account_t::add_post(post_t * post) } } +void account_t::add_deferred_post(const string& uuid, post_t * post) +{ + if (! deferred_posts) + deferred_posts = deferred_posts_map_t(); + + deferred_posts_map_t::iterator i = deferred_posts->find(uuid); + if (i == deferred_posts->end()) { + posts_list lst; + lst.push_back(post); + deferred_posts->insert(deferred_posts_map_t::value_type(uuid, lst)); + } else { + (*i).second.push_back(post); + } +} + bool account_t::remove_post(post_t * post) { // It's possible that 'post' wasn't yet in this account, but try to |