添加默克尔树实现交易完整性验证

This commit is contained in:
Idiot-awa
2026-06-05 08:48:12 +08:00
parent ce8abe3c18
commit 541abc65a8
8 changed files with 170 additions and 145 deletions
+18
View File
@@ -80,4 +80,22 @@ void ShowTransactionLogs(); // 显示所有日志
void SearchLogs(const char* pattern);//日志搜索
int GetLogCount();
#define HASH_SIZE 32
typedef struct {
unsigned char data[HASH_SIZE];
} HashValue;
extern HashValue g_merkleRoot;
void HashLogEntry(const LogEntry* entry, HashValue* out);
void BuildMerkleTree(HashValue* root);
void HashToHex(const HashValue* hash, char* hex_out);
void PrintMerkleRoot();
int VerifyMerkleTree();
void SaveMerkleRoot();
void LoadMerkleRoot();
#endif