pragma packing
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#pragma pack(push, 1) // Ensure no padding for consistent file storage
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t blockNumber;
|
uint64_t blockNumber;
|
||||||
uint64_t timestamp;
|
uint64_t timestamp;
|
||||||
@@ -19,6 +20,7 @@ typedef struct {
|
|||||||
uint8_t version;
|
uint8_t version;
|
||||||
uint8_t reserved[3]; // 3 bytes (Explicit padding for 8-byte alignment)
|
uint8_t reserved[3]; // 3 bytes (Explicit padding for 8-byte alignment)
|
||||||
} block_header_t;
|
} block_header_t;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
block_header_t header;
|
block_header_t header;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ static inline bool Address_IsCoinbase(const uint8_t address[32]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 160 bytes total for v1
|
// 160 bytes total for v1
|
||||||
|
#pragma pack(push, 1) // Ensure no padding for consistent file storage
|
||||||
typedef struct {
|
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 fee; // Rewarded to the miner; can be zero, but the miner may choose to ignore transactions with very low fees
|
||||||
uint64_t amount1;
|
uint64_t amount1;
|
||||||
@@ -40,6 +41,7 @@ typedef struct {
|
|||||||
uint8_t version;
|
uint8_t version;
|
||||||
uint8_t reserved[6]; // 6 bytes (Explicit padding for 8-byte alignment)
|
uint8_t reserved[6]; // 6 bytes (Explicit padding for 8-byte alignment)
|
||||||
} transaction_t;
|
} transaction_t;
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t txHash[32];
|
uint8_t txHash[32];
|
||||||
|
|||||||
Reference in New Issue
Block a user