@@ -20,9 +20,9 @@ int main (int argc, char* argv[])
2020 set<string> prepared_xacts;
2121 set<string> committed_xacts;
2222 bool verbose = false ;
23- for (int i = 1 ; i < argc; i++) {
24- if (argv[i][0 ] == ' -' ) {
25- switch (argv[i][1 ]) {
23+ for (int i = 1 ; i < argc; i++) {
24+ if (argv[i][0 ] == ' -' ) {
25+ switch (argv[i][1 ]) {
2626 case ' C' :
2727 case ' c' :
2828 connections.push_back (string (argv[++i]));
@@ -39,12 +39,12 @@ int main (int argc, char* argv[])
3939 " \t -v\t verbose mode: print extra information while processing\n " );
4040 return 1 ;
4141 }
42- if (verbose) {
42+ if (verbose) {
4343 cout << " Collecting information about prepared transactions...\n " ;
4444 }
4545 for (vector<string>::iterator ic = connections.begin (); ic != connections.end (); ++ic)
4646 {
47- if (verbose) {
47+ if (verbose) {
4848 cout << " Connecting to " << *ic << " ...\n " ;
4949 }
5050 connection con (*ic);
@@ -57,17 +57,17 @@ int main (int argc, char* argv[])
5757 }
5858 txn.commit ();
5959 }
60- if (verbose) {
60+ if (verbose) {
6161 cout << " Prepared transactions: " ;
6262 for (set<string>::iterator it = prepared_xacts.begin (); it != prepared_xacts.end (); ++it)
6363 {
6464 cout << *it << " , " ;
6565 }
6666 cout << " \n Checking which of them are committed...\n " ;
67- }
67+ }
6868 for (vector<string>::iterator ic = connections.begin (); ic != connections.end (); ++ic)
6969 {
70- if (verbose) {
70+ if (verbose) {
7171 cout << " Connecting to " << *ic << " ...\n " ;
7272 }
7373 connection con (*ic);
@@ -83,17 +83,17 @@ int main (int argc, char* argv[])
8383 }
8484 txn.commit ();
8585 }
86- if (verbose) {
86+ if (verbose) {
8787 cout << " Committed transactions: " ;
8888 for (set<string>::iterator it = committed_xacts.begin (); it != committed_xacts.end (); ++it)
8989 {
9090 cout << *it << " , " ;
9191 }
9292 cout << " \n Committing them at all nodes...\n " ;
93- }
93+ }
9494 for (vector<string>::iterator ic = connections.begin (); ic != connections.end (); ++ic)
9595 {
96- if (verbose) {
96+ if (verbose) {
9797 cout << " Connecting to " << *ic << " ...\n " ;
9898 }
9999 connection con (*ic);
@@ -108,12 +108,12 @@ int main (int argc, char* argv[])
108108 result rc = txn.prepared (" commit-check" )(gid).exec ();
109109 if (rc.empty ()) {
110110 if (committed_xacts.find (gid) != committed_xacts.end ()) {
111- if (verbose) {
111+ if (verbose) {
112112 cout << " Commit transaction " << gid << " \n " ;
113113 }
114114 txn.prepared (" commit-prepared" )(gid);
115- } else {
116- if (verbose) {
115+ } else {
116+ if (verbose) {
117117 cout << " Rollback transaction " << gid << " \n " ;
118118 }
119119 txn.prepared (" rollback-prepared" )(gid);
@@ -122,8 +122,8 @@ int main (int argc, char* argv[])
122122 }
123123 txn.commit ();
124124 }
125- if (verbose) {
125+ if (verbose) {
126126 cout << " Recovery completed\n " ;
127127 }
128128 return 0 ;
129- }
129+ }
0 commit comments