/* * This file is part of the Flowee project * Copyright (C) 2026 Tom Zander * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #ifndef FLOWEE_PRIMITIVES_BLOCKHEADER_H #define FLOWEE_PRIMITIVES_BLOCKHEADER_H #include class Block; class BlockHeader { public: BlockHeader() = default; BlockHeader(const Block &block); BlockHeader(const BlockHeader &other) = default; int32_t nVersion = 0; uint256 hashPrevBlock; uint256 hashMerkleRoot; uint32_t nTime = 0; uint32_t nBits = 0; uint32_t nNonce = 0; inline bool isNull() const { return (nBits == 0); } uint256 createHash() const; inline int64_t blockTime() const { return static_cast(nTime); } BlockHeader &operator=(const BlockHeader &other) = default; }; #endif