summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/journal.cc b/journal.cc
index 017f82c5..065825f2 100644
--- a/journal.cc
+++ b/journal.cc
@@ -281,6 +281,27 @@ entry_t::entry_t(const entry_t& e)
(*i)->entry = this;
}
+bool entry_t::get_state(transaction_t::state_t * state) const
+{
+ bool first = true;
+ bool hetero = false;
+
+ for (transactions_list::const_iterator i = transactions.begin();
+ i != transactions.end();
+ i++) {
+ if (first) {
+ *state = (*i)->state;
+ first = false;
+ }
+ else if (*state != (*i)->state) {
+ hetero = true;
+ break;
+ }
+ }
+
+ return ! hetero;
+}
+
void entry_t::add_transaction(transaction_t * xact)
{
xact->entry = this;