summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-02-26 15:45:15 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-02-26 15:45:15 -0600
commitaa9b07d79bff00506b913d1e56575c3859fc173f (patch)
tree70bf76b03217eec5d09855f2a7bda9d5b9230fa0 /src/journal.cc
parent4cf95497f9afaead3d9d308dabe8e8b26949502f (diff)
downloadfork-ledger-aa9b07d79bff00506b913d1e56575c3859fc173f.tar.gz
fork-ledger-aa9b07d79bff00506b913d1e56575c3859fc173f.tar.bz2
fork-ledger-aa9b07d79bff00506b913d1e56575c3859fc173f.zip
Added --rich-data for 'convert', and SHA1 checksum checking
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/journal.cc b/src/journal.cc
index 0691954f..bbfa205c 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -107,6 +107,17 @@ account_t * journal_t::find_account_re(const string& regexp)
bool journal_t::add_xact(xact_t * xact)
{
+ if (optional<value_t> ref = xact->get_tag(_("SHA1"))) {
+ std::pair<checksum_map_t::iterator, bool> result
+ = checksum_map.insert(checksum_map_t::value_type(ref->to_string(), xact));
+ if (! result.second) {
+ throw_(std::runtime_error,
+ _("Found duplicated transaction with SHA1: ")
+ << ref->to_string());
+ return false;
+ }
+ }
+
xact->journal = this;
if (! xact->finalize()) {