aboutsummaryrefslogtreecommitdiff
path: root/main.h
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-11-13 01:23:08 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2009-11-13 01:23:08 +0000
commit70e79525c97c33a5fca8674d47d86cc2b7ae197a (patch)
tree7427ce9b17468ed4a9dec82b380c2dd40a5332ca /main.h
parent956468c29adcbff83ab7c2e52d91f8e87b704853 (diff)
downloadbitcoin-70e79525c97c33a5fca8674d47d86cc2b7ae197a.tar.xz
monitor ThreadSocketHandler and terminate and restart if hung, convert _beginthread to CreateThread wrapper, disconnect inactive connections, ping, break up long messages to speed up initial download, better priorities for initiating connections, track how many nodes have requested our blocks and transactions, status #/offline and warning message on unsent blocks, minimize on close as separate option -- linux-test5
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@38 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'main.h')
-rw-r--r--main.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/main.h b/main.h
index 853fdfa5b6..8bb1e19e8a 100644
--- a/main.h
+++ b/main.h
@@ -34,6 +34,8 @@ extern int nBestHeight;
extern uint256 hashBestChain;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
+extern map<uint256, int> mapRequestCount;
+extern CCriticalSection cs_mapRequestCount;
// Settings
extern int fGenerateBitcoins;
@@ -647,6 +649,15 @@ public:
nGetCreditCached = 0;
}
+ IMPLEMENT_SERIALIZE
+ (
+ nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
+ nVersion = this->nVersion;
+ READWRITE(hashBlock);
+ READWRITE(vMerkleBranch);
+ READWRITE(nIndex);
+ )
+
int64 GetCredit(bool fUseCache=false) const
{
// Must wait until coinbase is safely deep enough in the chain before valuing it
@@ -661,15 +672,6 @@ public:
return nGetCreditCached;
}
- IMPLEMENT_SERIALIZE
- (
- nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
- nVersion = this->nVersion;
- READWRITE(hashBlock);
- READWRITE(vMerkleBranch);
- READWRITE(nIndex);
- )
-
int SetMerkleBranch(const CBlock* pblock=NULL);
int GetDepthInMainChain() const;
@@ -749,6 +751,7 @@ public:
int64 GetTxTime() const;
+ int GetRequestCount() const;
void AddSupportingTransactions(CTxDB& txdb);
@@ -978,7 +981,7 @@ public:
return true;
}
- bool ReadFromDisk(unsigned int nFile, unsigned int nBlockPos, bool fReadTransactions)
+ bool ReadFromDisk(unsigned int nFile, unsigned int nBlockPos, bool fReadTransactions=true)
{
SetNull();
@@ -1027,7 +1030,7 @@ public:
int64 GetBlockValue(int64 nFees) const;
bool DisconnectBlock(CTxDB& txdb, CBlockIndex* pindex);
bool ConnectBlock(CTxDB& txdb, CBlockIndex* pindex);
- bool ReadFromDisk(const CBlockIndex* blockindex, bool fReadTransactions);
+ bool ReadFromDisk(const CBlockIndex* blockindex, bool fReadTransactions=true);
bool AddToBlockIndex(unsigned int nFile, unsigned int nBlockPos);
bool CheckBlock() const;
bool AcceptBlock();