<commit_before>#ifndef __FB_UIHEAD__
#define __FB_UIHEAD__

#include <afxdb.h>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <time.h>
#include <math.h>
#include <string>
#include "json\json.h"

using namespace std;
//#define
#define LANGUAGE_FILE			"\\Config\\Language.ini"
#define LANGUAGE_FILE_CN		"\\Config\\Language_CN.ini"
#define LANGUAGE_FILE_EN		"\\Config\\Language_EN.ini"

#define MSG_USER_ACCEPTRECOD_UI			    WM_USER+103	    //µAcceptBetRecod
#define MSG_USER_DARK_UI			        WM_USER+104	    //µDark
#define MSG_USER_MAIN_UI			        WM_USER+105	    //µMian

#define MSG_USER_SENDRECOD_UI			    WM_USER+106	    //µSendRecord
#define MSG_USER_SIGNACCEPT_UI			    WM_USER+107	    //µSignAccountsDlg 1131
#define MSG_USER_TRANSRECORD_UI			    WM_USER+108	    //µTransRecord
#define MSG_USER_BETPOOL_UI			        WM_USER+109	    //µCAcceptBetDlg
#define MSG_USER_GET_SERVER_DATA            WM_USER+110     //ӷȡ 1134
#define MSG_USER_GET_UPDATABASE             WM_USER+111     //ݿлȡ
#define MSG_USER_SHOW_INIT                  WM_USER+112     //ʾʼ 
#define MSG_USER_GET_TIPBLOCK_DATA          WM_USER+113     //·bloktip hash 
#define MSG_USER_SENDDARK_UI			    WM_USER+114	    //µDark
#define MSG_USER_ACCEPTDARK_UI			    WM_USER+115	    //µDark
#define MSG_USER_SENDBET_UI			        WM_USER+116	    //µp2p
#define MSG_USER_GETAPPM_UI			        WM_USER+116	    //µֽ
#define MSG_USER_UP_PROGRESS			    WM_USER+117	    //½  1131
#define MSG_USER_INSERT_DATA                WM_USER+118	    //ݵݿ
#define MSG_USER_UPDATA_DATA                WM_USER+119	    //ݵݿ
#define MSG_USER_BLOCKSTATE_UI			    WM_USER+120	    //µֽ  1138
#define MSG_USER_SIGUSER_UI			        WM_USER+121	    //µעӦ  1138
#define MSG_USER_SEND_UI			        WM_USER+122    //µת  1138
#define MSG_USER_RECIVE_UI			        WM_USER+122    //µҳ
#define MSG_USER_STARTPROCESS_UI			WM_USER+123    //µҳ
#define MSG_USER_UPDATA_UI			        WM_USER+124   //µҳ

#define MSG_USER_QUITTHREAD			        WM_USER+200	    //˳߳
#define MSG_USER_OUT                        WM_USER+201     //˳


#define MSG_USER_END			        WM_USER+800	    //˳߳

//enum
enum {
	LANGUAGE_CN = 0x01,
	LANGUAGE_EN ,
} ;
typedef enum tagDialogType{
	DIALOG_MYWALLET     = 0x01,    //ҵǮ 
	DIALOG_P2P_BET       ,         //P2pԼ
	DIALOG_GUARANTEE     ,         //  
	DIALOG_PRESS         ,         //ѹ
	DIALOG_SIGN_ACCOUNTS ,         //עʺ
	DIALOG_SIGN_USE      ,         //עӦ
	DIALOG_TRANSFER      ,         //ת
	DIALOG_TRANSFER_RECORD,        //׼¼
	DIALOG_SEND_RECORD   ,         //ͼ¼
	DIALOG_ACCEPTBET_RECORD   ,         //ͼ¼
	DIALOG_SEND_PRESS         ,         //͵ѹ
	DIALOG_ACCEPT_PRESS         ,         //͵ѹ
	DIALOG_BLOCK_STATE        ,         //״̬
} DialogType ;
 

typedef enum tagUiDataType{
	DATA_MYWALLET     = 0x001,   //ҵǮ 
	DATA_P2P_BET       ,         //P2pԼ
	DATA_GUARANTEE     ,         //  
	DATA_PRESS         ,         //ѹ
	DATA_SIGN_ACCOUNTS ,         //עʺ
	DATA_SIGN_USE      ,         //עӦ
	DATA_TRANSFER      ,         //ת
	DATA_TRANSFER_RECORD,        //׼¼
	DATA_SEND_RECORD   ,         //ͼ¼
} UiDataType ;

typedef enum tagUiType{
	UI_TRANSIONRECORD     = 0x01,   //׼¼ 
	UI_SENDP2P_RECORD       ,       //P2pԼ
	UI_ACCEPTP2P_RECORD     ,       //ܶԼ¼  
	UI_DARK_RECORD          ,       //ѹ
} UiType ;

CString txTypeArray[] = { "NULL_TXTYPE", "REWARD_TX", "REG_ACCT_TX", "COMMON_TX", "CONTRACT_TX", "REG_APP_TX"};

#pragma pack(push)
#pragma pack(1)
namespace uistruct {
	//listaddrṹ
	typedef struct LISTADDR{   
		char    address[34+1] ;   //address
		char    RegID[34]   ;   //RegID
		double  fMoney      ;   //
		int     nColdDig    ;   //Ƿ֧ڿ 1:֧   0:֧
		int     bSign       ;   //Ƿע       1:ע    ,  0:ûע
		char    Lebel[34]       ;
		LISTADDR(){
			memset(address,0,sizeof(address));
			memset(RegID,0,sizeof(RegID));
			memset(Lebel,0,sizeof(Lebel));
			fMoney = 0.0;
			nColdDig =0;
			bSign = 0;
		}
		string ToJson(){
			Json::Value root;
			root["address"] = address;
			root["RegID"] = RegID;
			root["fMoney"] = fMoney;
			root["nColdDig"] = nColdDig;
			root["bSign"] = bSign;
			root["Lebel"] = Lebel;
			return root.toStyledString();
		}
		bool JsonToStruct(string json){
			Json::Reader reader;  
			Json::Value root; 
			if (!reader.parse(json, root)) 
				return false ;
			CString temp = root["address"].asCString();
			memcpy(address,temp,sizeof(address));
			temp = root["RegID"].asCString();
			memcpy(RegID,temp,sizeof(RegID));
			this->fMoney = root["fMoney"].asDouble();
			this->nColdDig = root["nColdDig"].asInt();
			this->bSign = root["bSign"].asInt();
			temp = root["Lebel"].asCString();
			memcpy(Lebel,temp,sizeof(Lebel));
	
			return true;
		}
	}LISTADDR_t;
	typedef std::vector<LISTADDR_t> LISTADDRLIST ;
	//ʼṹ
	typedef struct INITSERVER{   
		char    sType[32] ;   //
		char    msg[1000] ;   //
	}INITSERVER_t;

	//ͶԼ  նԼ
	typedef struct DB_DATA{
		unsigned char betstate;
		INT64         money;
		unsigned int hight;
		unsigned char dhash[32];//32 + one byte checksum
		unsigned char accepthash[32];//32 + one byte checksum
		char     sendbetid[6];
		char     acceptbetid[6];
		unsigned char acceptebetdata;
	}DB_DATA_t;
	
	typedef struct P2P_BET_RECORD {
		time_t sendtime       ;     //ʱ
		time_t recvtime       ;     //ʱ
		int    timeout        ;     //ʱ
		char   tx_hash[64+1]    ;      //Լhash
		char   left_addr[34+1]  ;		//Լַ
		char   right_addr[34+1] ;		//ܶԼַ
		INT64  amount  ;				//
		char   content[33]    ;       // 
		int    actor  ;               // 0 Լ 1 ܶԼ 2 ʹԼǽܶԼ
		int    comfirmed      ;        // Ƿȷ
		int    height         ;           //ȷ߶
		int    state          ;         //0 ״̬ 1 Ӷ״̬ 2 Ҷ״̬ 3 ѾҶʱ 4 ڽӶ 5ڽҶ
		char   relate_hash[64+1];          //Ӷhash
		int guessnum;      //Ӳµ 
	}P2P_BET_RECORD_t;

	typedef std::vector<P2P_BET_RECORD_t> P2PBETRECORDLIST ;

	typedef struct {                 //ԼӦݿṹ
		unsigned char betstate;        //00δӶ 01Ӷ
		INT64 money;
		unsigned short hight;
		unsigned char dhash[32];//32 + one byte checksum
		unsigned char accepthash[32];//32 + one byte checksum
		unsigned char sendbetid[6];
		unsigned char acceptbetid[6];
		unsigned char acceptebetdata;

	}DBBET_DATA;
	typedef std::vector<DBBET_DATA> DBBETDATALIST ;
	//׼¼
	typedef struct REVTRANSACTION{
		CString    txhash  ;   //hash
		string    txtype ;  //
		int       ver;
		string    addr   ;  //
		string    pubkey;
		string	  miner_pubkey;
		double    fees       ;
		int       height     ;  // 
		string    desaddr   ;
		double   money        ;
		string   Contract  ;
		int      confirmedHeight ; //ȷʱ
		int      confirmedtime ; //ȷʱ
		string     blockhash      ;  //1:Ϊȷ״̬   0:ΪδΪȷ״̬
		int       state;
		string ToJson(){
			Json::Value root;
			root["hash"] = txhash.GetString();
			root["txtype"] = txtype;
			root["ver"] = ver;
			root["addr"] = addr;
			root["pubkey"] = pubkey;
			root["miner_pubkey"] = miner_pubkey;
			root["fees"] = fees;
			root["height"] = height;
			root["desaddr"] = desaddr;
			root["money"] = money;
			root["Contract"] = Contract;
			root["confirmedHeight"] = confirmedHeight;
			root["confirmedtime"] = confirmedtime;
			root["blockhash"] = blockhash;
			root["state"] = state;
			return root.toStyledString();
		}
		REVTRANSACTION(){
			txhash = _T("")  ;   
			txtype = "";  //
			ver = 0;
			addr  = "" ;  //
			 pubkey  = "";
			  miner_pubkey  = "";
			  fees = 0.0      ;
			 height = 0    ;  // 
			desaddr  = ""   ;
			 money =0.0       ;
			 Contract  = ""  ;
			confirmedHeight = 0 ; //ȷʱ
			confirmedtime = 0; //ȷʱ
			blockhash  = ""      ;  //1:Ϊȷ״̬   0:ΪδΪȷ״̬
		}
		bool JsonToStruct(string json){
			Json::Reader reader;  
			Json::Value root; 
			if (!reader.parse(json, root)) 
				return false ;

			this->txhash = root["hash"].asCString() ;  
			this->txtype = root["txtype"].asString(); 
			this->ver = root["ver"].asInt();
			this->addr = root["addr"].asString()  ;
			this->height  =root["height"].asInt()   ;

			if(json.find("money") >=0)
			this->money = (root["money"].asInt64()*1.0)/100000000 ;

			if(json.find("pubkey") >=0)
			this->pubkey = root["pubkey"].asString();
			if(json.find("miner_pubkey") >=0)
			this->miner_pubkey = root["miner_pubkey"].asString();
			if(json.find("fees") >=0)
			this->fees = (root["fees"].asInt64()*1.0)/100000000 ;     ;
			if(json.find("desaddr") >=0)
			this->desaddr =root["desaddr"].asString()  ;
			if(json.find("Contract") >=0)
			this->Contract = root["Contract"] .asString() ;
			if(json.find("confirmHeight") >=0)
			this->confirmedHeight = root["confirmHeight"].asInt() ; 
			if(json.find("confirmedtime") >=0)
			this->confirmedtime = root["confirmedtime"].asInt();  <commit_msg>fix debug<commit_after>#ifndef __FB_UIHEAD__
#define __FB_UIHEAD__

#include <afxdb.h>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <time.h>
#include <math.h>
#include <string>
#include "json\json.h"

using namespace std;
//#define
#define LANGUAGE_FILE			"\\Config\\Language.ini"
#define LANGUAGE_FILE_CN		"\\Config\\Language_CN.ini"
#define LANGUAGE_FILE_EN		"\\Config\\Language_EN.ini"

#define MSG_USER_ACCEPTRECOD_UI			    WM_USER+103	    //µAcceptBetRecod
#define MSG_USER_DARK_UI			        WM_USER+104	    //µDark
#define MSG_USER_MAIN_UI			        WM_USER+105	    //µMian

#define MSG_USER_SENDRECOD_UI			    WM_USER+106	    //µSendRecord
#define MSG_USER_SIGNACCEPT_UI			    WM_USER+107	    //µSignAccountsDlg 1131
#define MSG_USER_TRANSRECORD_UI			    WM_USER+108	    //µTransRecord
#define MSG_USER_BETPOOL_UI			        WM_USER+109	    //µCAcceptBetDlg
#define MSG_USER_GET_SERVER_DATA            WM_USER+110     //ӷȡ 1134
#define MSG_USER_GET_UPDATABASE             WM_USER+111     //ݿлȡ
#define MSG_USER_SHOW_INIT                  WM_USER+112     //ʾʼ 
#define MSG_USER_GET_TIPBLOCK_DATA          WM_USER+113     //·bloktip hash 
#define MSG_USER_SENDDARK_UI			    WM_USER+114	    //µDark
#define MSG_USER_ACCEPTDARK_UI			    WM_USER+115	    //µDark
#define MSG_USER_SENDBET_UI			        WM_USER+116	    //µp2p
#define MSG_USER_GETAPPM_UI			        WM_USER+116	    //µֽ
#define MSG_USER_UP_PROGRESS			    WM_USER+117	    //½  1131
#define MSG_USER_INSERT_DATA                WM_USER+118	    //ݵݿ
#define MSG_USER_UPDATA_DATA                WM_USER+119	    //ݵݿ
#define MSG_USER_BLOCKSTATE_UI			    WM_USER+120	    //µֽ  1138
#define MSG_USER_SIGUSER_UI			        WM_USER+121	    //µעӦ  1138
#define MSG_USER_SEND_UI			        WM_USER+122    //µת  1138
#define MSG_USER_RECIVE_UI			        WM_USER+122    //µҳ
#define MSG_USER_STARTPROCESS_UI			WM_USER+123    //µҳ
#define MSG_USER_UPDATA_UI			        WM_USER+124   //µҳ

#define MSG_USER_QUITTHREAD			        WM_USER+200	    //˳߳
#define MSG_USER_OUT                        WM_USER+201     //˳


#define MSG_USER_END			        WM_USER+800	    //˳߳

//enum
enum {
	LANGUAGE_CN = 0x01,
	LANGUAGE_EN ,
} ;
typedef enum tagDialogType{
	DIALOG_MYWALLET     = 0x01,    //ҵǮ 
	DIALOG_P2P_BET       ,         //P2pԼ
	DIALOG_GUARANTEE     ,         //  
	DIALOG_PRESS         ,         //ѹ
	DIALOG_SIGN_ACCOUNTS ,         //עʺ
	DIALOG_SIGN_USE      ,         //עӦ
	DIALOG_TRANSFER      ,         //ת
	DIALOG_TRANSFER_RECORD,        //׼¼
	DIALOG_SEND_RECORD   ,         //ͼ¼
	DIALOG_ACCEPTBET_RECORD   ,         //ͼ¼
	DIALOG_SEND_PRESS         ,         //͵ѹ
	DIALOG_ACCEPT_PRESS         ,         //͵ѹ
	DIALOG_BLOCK_STATE        ,         //״̬
} DialogType ;
 

typedef enum tagUiDataType{
	DATA_MYWALLET     = 0x001,   //ҵǮ 
	DATA_P2P_BET       ,         //P2pԼ
	DATA_GUARANTEE     ,         //  
	DATA_PRESS         ,         //ѹ
	DATA_SIGN_ACCOUNTS ,         //עʺ
	DATA_SIGN_USE      ,         //עӦ
	DATA_TRANSFER      ,         //ת
	DATA_TRANSFER_RECORD,        //׼¼
	DATA_SEND_RECORD   ,         //ͼ¼
} UiDataType ;

typedef enum tagUiType{
	UI_TRANSIONRECORD     = 0x01,   //׼¼ 
	UI_SENDP2P_RECORD       ,       //P2pԼ
	UI_ACCEPTP2P_RECORD     ,       //ܶԼ¼  
	UI_DARK_RECORD          ,       //ѹ
} UiType ;

CString txTypeArray[] = { "NULL_TXTYPE", "REWARD_TX", "REG_ACCT_TX", "COMMON_TX", "CONTRACT_TX", "REG_APP_TX"};

#pragma pack(push)
#pragma pack(1)
namespace uistruct {
	//listaddrṹ
	typedef struct LISTADDR{   
		char    address[34+1] ;   //address
		char    RegID[34]   ;   //RegID
		double  fMoney      ;   //
		int     nColdDig    ;   //Ƿ֧ڿ 1:֧   0:֧
		int     bSign       ;   //Ƿע       1:ע    ,  0:ûע
		char    Lebel[34]       ;
		LISTADDR(){
			memset(address,0,sizeof(address));
			memset(RegID,0,sizeof(RegID));
			memset(Lebel,0,sizeof(Lebel));
			fMoney = 0.0;
			nColdDig =0;
			bSign = 0;
		}
		string ToJson(){
			Json::Value root;
			root["address"] = address;
			root["RegID"] = RegID;
			root["fMoney"] = fMoney;
			root["nColdDig"] = nColdDig;
			root["bSign"] = bSign;
			root["Lebel"] = Lebel;
			return root.toStyledString();
		}
		bool JsonToStruct(string json){
			Json::Reader reader;  
			Json::Value root; 
			if (!reader.parse(json, root)) 
				return false ;
			CString temp = root["address"].asCString();
			memcpy(address,temp,sizeof(address));
			temp = root["RegID"].asCString();
			memcpy(RegID,temp,sizeof(RegID));
			this->fMoney = root["fMoney"].asDouble();
			this->nColdDig = root["nColdDig"].asInt();
			this->bSign = root["bSign"].asInt();
			temp = root["Lebel"].asCString();
			memcpy(Lebel,temp,sizeof(Lebel));
	
			return true;
		}
	}LISTADDR_t;
	typedef std::vector<LISTADDR_t> LISTADDRLIST ;
	//ʼṹ
	typedef struct INITSERVER{   
		char    sType[32] ;   //
		char    msg[1000] ;   //
	}INITSERVER_t;

	//ͶԼ  նԼ
	typedef struct DB_DATA{
		unsigned char betstate;
		INT64         money;
		unsigned int hight;
		unsigned char dhash[32];//32 + one byte checksum
		unsigned char accepthash[32];//32 + one byte checksum
		char     sendbetid[6];
		char     acceptbetid[6];
		unsigned char acceptebetdata;
	}DB_DATA_t;
	
	typedef struct P2P_BET_RECORD {
		time_t sendtime       ;     //ʱ
		time_t recvtime       ;     //ʱ
		int    timeout        ;     //ʱ
		char   tx_hash[64+1]    ;      //Լhash
		char   left_addr[34+1]  ;		//Լַ
		char   right_addr[34+1] ;		//ܶԼַ
		INT64  amount  ;				//
		char   content[33]    ;       // 
		int    actor  ;               // 0 Լ 1 ܶԼ 2 ʹԼǽܶԼ
		int    comfirmed      ;        // Ƿȷ
		int    height         ;           //ȷ߶
		int    state          ;         //0 ״̬ 1 Ӷ״̬ 2 Ҷ״̬ 3 ѾҶʱ 4 ڽӶ 5ڽҶ
		char   relate_hash[64+1];          //Ӷhash
		int guessnum;      //Ӳµ 
	}P2P_BET_RECORD_t;

	typedef std::vector<P2P_BET_RECORD_t> P2PBETRECORDLIST ;

	typedef struct {                 //ԼӦݿṹ
		unsigned char betstate;        //00δӶ 01Ӷ
		INT64 money;
		unsigned short hight;
		unsigned char dhash[32];//32 + one byte checksum
		unsigned char accepthash[32];//32 + one byte checksum
		unsigned char sendbetid[6];
		unsigned char acceptbetid[6];
		unsigned char acceptebetdata;

	}DBBET_DATA;
	typedef std::vector<DBBET_DATA> DBBETDATALIST ;
	//׼¼
	typedef struct REVTRANSACTION{
		CString    txhash  ;   //hash
		string    txtype ;  //
		int       ver;
		string    addr   ;  //
		string    pubkey;
		string	  miner_pubkey;
		double    fees       ;
		int       height     ;  // 
		string    desaddr   ;
		double   money        ;
		string   Contract  ;
		int      confirmedHeight ; //ȷʱ
		int      confirmedtime ; //ȷʱ
		string     blockhash      ;  //1:Ϊȷ״̬   0:ΪδΪȷ״̬
		int       state;
		string ToJson(){
			Json::Value root;
			root["hash"] = txhash.GetString();
			root["txtype"] = txtype;
			root["ver"] = ver;
			root["addr"] = addr;
			root["pubkey"] = pubkey;
			root["miner_pubkey"] = miner_pubkey;
			root["fees"] = fees;
			root["height"] = height;
			root["desaddr"] = desaddr;
			root["money"] = money;
			root["Contract"] = Contract;
			root["confirmedHeight"] = confirmedHeight;
			root["confirmedtime"] = confirmedtime;
			root["blockhash"] = blockhash;
			root["state"] = state;
			return root.toStyledString();
		}
		REVTRANSACTION(){
			txhash = _T("")  ;   
			txtype = "";  //
			ver = 0;
			addr  = "" ;  //
			 pubkey  = "";
			  miner_pubkey  = "";
			  fees = 0.0      ;
			 height = 0    ;  // 
			desaddr  = ""   ;
			 money =0.0       ;
			 Contract  = ""  ;
			confirmedHeight = 0 ; //ȷʱ
			confirmedtime = 0; //ȷʱ
			blockhash  = ""      ;  //1:Ϊȷ״̬   0:ΪδΪȷ״̬
		}
		bool JsonToStruct(string json){
			Json::Reader reader;  
			Json::Value root; 
			if (!reader.parse(json, root)) 
				return false ;

			this->txhash = root["hash"].asCString() ;  
			this->txtype = root["txtype"].asString(); 
			this->ver = root["ver"].asInt();
			this->addr = root["addr"].asString()  ;
			this->height  =root["height"].asInt()   ;

			if(json.find("money") >=0)
			{
				this->money = (root["money"].asDouble()*1.0)/100000000 ;
			}
			

			if(json.find("pubkey") >=0)
			this->pubkey = root["pubkey"].asString();
			if(json.find("miner_pubkey") >=0)
			this->miner_pubkey = root["miner_pubkey"].asString();
			if(json.find("fees") >=0)
			{
				this->fees = (root["fees"].asDouble()*1.0)/100000000 ;
			}
			
			if(json.find("desaddr") >=0)
			this->desaddr =root["desaddr"].asString()  ;
			if(json.find("Contract") >=0)
			this->Contract = root["Contract"] .asString() ;
			if(json.find("confirmHeight") >=0)
			this->confirmedHeight = root["confirmHeight"].asInt() ; 
			if(json.find("confirmedtime") >=0)
			this->confirmedtime = root["confirmedtime"].asInt();  
{'fraction_non_alphanumeric': 0.13277359583092066, 'fraction_numerical': 0.02918355529820498, 'mean_word_length': 2.250705815923207, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 73, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2306734', 'n_tokens_mistral': 7914, 'n_tokens_neox': 6983, 'n_words': 1237}