aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
Diffstat (limited to 'main.h')
-rw-r--r--main.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/main.h b/main.h
index 2c24eba2d5..cca233896e 100644
--- a/main.h
+++ b/main.h
@@ -865,11 +865,6 @@ public:
return nChangeCached;
}
- bool IsFromMe() const
- {
- return (GetDebit() > 0);
- }
-
void GetAccountAmounts(string strAccount, const set<CScript>& setPubKey,
int64& nGenerated, int64& nReceived, int64& nSent, int64& nFee) const
{
@@ -901,6 +896,11 @@ public:
}
}
+ bool IsFromMe() const
+ {
+ return (GetDebit() > 0);
+ }
+
bool IsConfirmed() const
{
// Quick answer in most cases
@@ -1158,14 +1158,12 @@ public:
}
- bool WriteToDisk(bool fWriteTransactions, unsigned int& nFileRet, unsigned int& nBlockPosRet)
+ bool WriteToDisk(unsigned int& nFileRet, unsigned int& nBlockPosRet)
{
// Open history file to append
CAutoFile fileout = AppendBlockFile(nFileRet);
if (!fileout)
return error("CBlock::WriteToDisk() : AppendBlockFile failed");
- if (!fWriteTransactions)
- fileout.nType |= SER_BLOCKHEADERONLY;
// Write index header
unsigned int nSize = fileout.GetSerializeSize(*this);
@@ -1310,6 +1308,19 @@ public:
nNonce = block.nNonce;
}
+ CBlock GetBlockHeader() const
+ {
+ CBlock block;
+ block.nVersion = nVersion;
+ if (pprev)
+ block.hashPrevBlock = pprev->GetBlockHash();
+ block.hashMerkleRoot = hashMerkleRoot;
+ block.nTime = nTime;
+ block.nBits = nBits;
+ block.nNonce = nNonce;
+ return block;
+ }
+
uint256 GetBlockHash() const
{
return *phashBlock;
@@ -1511,6 +1522,16 @@ public:
READWRITE(vHave);
)
+ void SetNull()
+ {
+ vHave.clear();
+ }
+
+ bool IsNull()
+ {
+ return vHave.empty();
+ }
+
void Set(const CBlockIndex* pindex)
{
vHave.clear();