aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-05 09:29:30 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-12-05 09:29:30 +0000
commitf03304a9c79a6cc6096ed501ad38702fd012e7f7 (patch)
treeb336b15afca6035f7c09021e12179078ae6900c4 /main.h
parentbdde31d787c4fe2da8e9fb168abbd22af2c27442 (diff)
preps for future client-only mode,
jgarzik's initial download speedup git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@195 1a98c847-1fd6-4fd8-948a-caf3550aa51b
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();