private boolean shouldWait(int txnId, Set<Integer> dependetTxns) {
		Set<BlockPtr> ptrList = blockPtrsInTxn.get(txnId);
		Iterator<Integer> iter = blockPtrsInTxn.keySet().iterator();
		while (iter.hasNext()) {
			int txn = iter.next();
			if (txn == txnId) {
				continue;
			}
			
			Set<BlockPtr> list = blockPtrsInTxn.get(txn);
			Iterator<BlockPtr> txnPtrIter = ptrList.iterator();
			
			while (txnPtrIter.hasNext()) {
				BlockPtr ptr = txnPtrIter.next();
				if (list.contains(ptr) && !committingTxns.contains(txn)) {
					dependetTxns.clear();
					return true;
				}

				if (list.contains(ptr) && committingTxns.contains(txn)) {
					dependetTxns.add(txn);					
				}
			}
		}
		
		return false;
	}