update primitives section

This commit is contained in:
Michel van Kessel
2020-12-20 22:17:29 +01:00
parent f479d9111f
commit 59f0fb2c9a
4 changed files with 26 additions and 27 deletions

View File

@@ -3,19 +3,20 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "primitives/block.h"
#include <primitives/block.h>
#include "hash.h"
#include "crypto/scrypt.h"
#include "tinyformat.h"
#include "utilstrencodings.h"
#include "crypto/common.h"
#include <hash.h>
#include <crypto/scrypt.h>
#include <tinyformat.h>
#include <utilstrencodings.h>
#include <crypto/common.h>
uint256 CBlockHeader::GetHash() const
{
if (nVersion > 6)
return SerializeHash(*this);
return GetPoWHash();
if (nVersion > 6)
return SerializeHash(*this);
else
return GetPoWHash();
}
uint256 CBlockHeader::GetPoWHash() const

View File

@@ -6,9 +6,11 @@
#ifndef BITCOIN_PRIMITIVES_BLOCK_H
#define BITCOIN_PRIMITIVES_BLOCK_H
#include "primitives/transaction.h"
#include "serialize.h"
#include "uint256.h"
#include <primitives/transaction.h>
#include <serialize.h>
#include <uint256.h>
#include <arith_uint256.h>
#include <hash.h>
/** Nodes collect new transactions into a block, hash them into a hash tree,
* and scan through nonce values to make the block's hash satisfy proof-of-work
@@ -62,7 +64,6 @@ public:
}
uint256 GetHash() const;
uint256 GetPoWHash() const;
int64_t GetBlockTime() const
@@ -72,14 +73,12 @@ public:
};
class CBlock : public CBlockHeader
{
public:
// network and disk
std::vector<CTransaction> vtx;
// network and disk
// ppcoin: block signature - signed by one of the coin base txout[N]'s owner
std::vector<unsigned char> vchBlockSig;
// memory only
@@ -136,8 +135,6 @@ public:
return block;
}
std::string ToString() const;
};
@@ -174,6 +171,7 @@ struct CBlockLocator
{
return vHave.empty();
}
};
#endif // BITCOIN_PRIMITIVES_BLOCK_H

View File

@@ -3,12 +3,12 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "primitives/transaction.h"
#include <primitives/transaction.h>
#include "hash.h"
#include "tinyformat.h"
#include "utilstrencodings.h"
#include "script/interpreter.h"
#include <hash.h>
#include <tinyformat.h>
#include <utilstrencodings.h>
#include <script/interpreter.h>
std::string COutPoint::ToString() const
{

View File

@@ -6,10 +6,10 @@
#ifndef BITCOIN_PRIMITIVES_TRANSACTION_H
#define BITCOIN_PRIMITIVES_TRANSACTION_H
#include "amount.h"
#include "script/script.h"
#include "serialize.h"
#include "uint256.h"
#include <amount.h>
#include <script/script.h>
#include <serialize.h>
#include <uint256.h>
/** An outpoint - a combination of a transaction hash and an index n into its vout */
class COutPoint