summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
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()) {