diff options
Diffstat (limited to 'src/xact.cc')
-rw-r--r-- | src/xact.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/xact.cc b/src/xact.cc index eeb487d9..0bf1fc2c 100644 --- a/src/xact.cc +++ b/src/xact.cc @@ -691,6 +691,21 @@ void auto_xact_t::extend_xact(xact_base_t& xact, current_year); } } + if (check_exprs) { + foreach (check_expr_pair& pair, *check_exprs) { + if (pair.second == auto_xact_t::EXPR_GENERAL) { + pair.first.calc(bound_scope); + } + else if (! pair.first.calc(bound_scope).to_boolean()) { + if (pair.second == auto_xact_t::EXPR_ASSERTION) { + throw_(parse_error, + _("Transaction assertion failed: %1" << pair.first)); + } else { + warning_(_("Transaction check failed: %1" << pair.first)); + } + } + } + } foreach (post_t * post, posts) { amount_t post_amount; |