// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java
// public class AppSettings {
// 	public static final double DUST_LIMIT = 0.00005460;
// 	public static final double MIN_FEE_BITCOINS = 0.0001;
// }
// 
// Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java
// public class ShortNumberConverter {
// 	
// 	public static String ToShort(Double value){
// 		NumberFormat formatter = new DecimalFormat();
// 
// 	    formatter = new DecimalFormat("0.000E00");
// 	    String temp = formatter.format(value);
// 	    
// 	    String temp2 = temp.substring(0, 5);
// 	    temp2 = temp2.replace(",", ".");
// 	    Double temp3 = Double.parseDouble(temp2);
// 	    formatter = new DecimalFormat("0.00");
// 	    formatter.setRoundingMode(RoundingMode.HALF_UP);
// 	    temp = formatter.format(temp3) + temp.substring(5);
// 	    
// 	    if(!temp.contains("E-")){
// 	    	temp = temp.substring(0, temp.indexOf("E")+1) + "0" + temp.substring(temp.indexOf("E")+1, temp.length());
// 	    }
// 
// 	    return temp.toLowerCase(Locale.ENGLISH);
// 	}
// 	/*public static Double FromShort(String value){
// 		
// 	}*/
// }
// 
// Path: src/com/blochstech/bitcoincardterminal/Utils/SyntacticSugar.java
// public class SyntacticSugar {
// 	@SuppressWarnings("unchecked")
// 	public static <T> T castAs(Object castee){
// 		try{
// 			return (T) castee;
// 		}catch(Exception ex){
// 			return null;
// 		}
// 	}
// 	
// 	public static boolean EqualWithinMargin(Double value1, Double value2, Double margin){
// 		return value1 * (1+margin) >= value2 && value2 * (1+margin) >= value1;
// 	}
// }


import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Locale;
import com.blochstech.bitcoincardterminal.Model.AppSettings;
import com.blochstech.bitcoincardterminal.Utils.ShortNumberConverter;
import com.blochstech.bitcoincardterminal.Utils.SyntacticSugar;
			if(go1 == true && go2 == true)
				break;
			if(go1 == false){
				if(addressBytes != null && waitingAddress != null)
				{
					if(addressBytes[i] != waitingAddress[i]){
						waitingAddressMatch = false;
						go1 = true;
					}
				}else{
					waitingAddressMatch = amount <= 0.0;
					go1 = true;
				}
			}
			if(go2 == false){
				if(terminalAddressBytes != null && waitingTerminalAddress != null)
				{
					if(terminalAddressBytes[i] != waitingTerminalAddress[i]){
						waitingTerminalAddressMatch = false;
						go1 = true;
					}
				}else{
					waitingAddressMatch = terminalAmount <= 0.0;
					go2 = true;
				}
			}
		}
		return waitingKnown
		   && waitingAddressMatch
		   && waitingTerminalAddressMatch
// Path: src/com/blochstech/bitcoincardterminal/Model/AppSettings.java
// public class AppSettings {
// 	public static final double DUST_LIMIT = 0.00005460;
// 	public static final double MIN_FEE_BITCOINS = 0.0001;
// }
// 
// Path: src/com/blochstech/bitcoincardterminal/Utils/ShortNumberConverter.java
// public class ShortNumberConverter {
// 	
// 	public static String ToShort(Double value){
// 		NumberFormat formatter = new DecimalFormat();
// 
// 	    formatter = new DecimalFormat("0.000E00");
// 	    String temp = formatter.format(value);
// 	    
// 	    String temp2 = temp.substring(0, 5);
// 	    temp2 = temp2.replace(",", ".");
// 	    Double temp3 = Double.parseDouble(temp2);
// 	    formatter = new DecimalFormat("0.00");
// 	    formatter.setRoundingMode(RoundingMode.HALF_UP);
// 	    temp = formatter.format(temp3) + temp.substring(5);
// 	    
// 	    if(!temp.contains("E-")){
// 	    	temp = temp.substring(0, temp.indexOf("E")+1) + "0" + temp.substring(temp.indexOf("E")+1, temp.length());
// 	    }
// 
// 	    return temp.toLowerCase(Locale.ENGLISH);
// 	}
// 	/*public static Double FromShort(String value){
// 		
// 	}*/
// }
// 
// Path: src/com/blochstech/bitcoincardterminal/Utils/SyntacticSugar.java
// public class SyntacticSugar {
// 	@SuppressWarnings("unchecked")
// 	public static <T> T castAs(Object castee){
// 		try{
// 			return (T) castee;
// 		}catch(Exception ex){
// 			return null;
// 		}
// 	}
// 	
// 	public static boolean EqualWithinMargin(Double value1, Double value2, Double margin){
// 		return value1 * (1+margin) >= value2 && value2 * (1+margin) >= value1;
// 	}
// }


// Path: src/com/blochstech/bitcoincardterminal/Model/Communication/BitcoinCardStateObject.java
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Locale;
import com.blochstech.bitcoincardterminal.Model.AppSettings;
import com.blochstech.bitcoincardterminal.Utils.ShortNumberConverter;
import com.blochstech.bitcoincardterminal.Utils.SyntacticSugar;

			if(go1 == true && go2 == true)
				break;
			if(go1 == false){
				if(addressBytes != null && waitingAddress != null)
				{
					if(addressBytes[i] != waitingAddress[i]){
						waitingAddressMatch = false;
						go1 = true;
					}
				}else{
					waitingAddressMatch = amount <= 0.0;
					go1 = true;
				}
			}
			if(go2 == false){
				if(terminalAddressBytes != null && waitingTerminalAddress != null)
				{
					if(terminalAddressBytes[i] != waitingTerminalAddress[i]){
						waitingTerminalAddressMatch = false;
						go1 = true;
					}
				}else{
					waitingAddressMatch = terminalAmount <= 0.0;
					go2 = true;
				}
			}
		}
		return waitingKnown
		   && waitingAddressMatch
		   && waitingTerminalAddressMatch
		   && SyntacticSugar.EqualWithinMargin(amount, waitingAmount, 0.001)