From eb7c29abb11d7622bdd3f270601c06c0c4b23e18 Mon Sep 17 00:00:00 2001 From: DcruBro Date: Fri, 10 Apr 2026 16:36:37 +0200 Subject: [PATCH] pragma packing --- include/block/block.h | 2 ++ include/block/transaction.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/block/block.h b/include/block/block.h index 9dab75b..54b0a91 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -9,6 +9,7 @@ #include #include +#pragma pack(push, 1) // Ensure no padding for consistent file storage typedef struct { uint64_t blockNumber; uint64_t timestamp; @@ -19,6 +20,7 @@ typedef struct { uint8_t version; uint8_t reserved[3]; // 3 bytes (Explicit padding for 8-byte alignment) } block_header_t; +#pragma pack(pop) typedef struct { block_header_t header; diff --git a/include/block/transaction.h b/include/block/transaction.h index 746c9b5..4704bcc 100644 --- a/include/block/transaction.h +++ b/include/block/transaction.h @@ -21,6 +21,7 @@ static inline bool Address_IsCoinbase(const uint8_t address[32]) { } // 160 bytes total for v1 +#pragma pack(push, 1) // Ensure no padding for consistent file storage typedef struct { uint64_t fee; // Rewarded to the miner; can be zero, but the miner may choose to ignore transactions with very low fees uint64_t amount1; @@ -40,6 +41,7 @@ typedef struct { uint8_t version; uint8_t reserved[6]; // 6 bytes (Explicit padding for 8-byte alignment) } transaction_t; +#pragma pack(pop) typedef struct { uint8_t txHash[32];