aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2013-01-09 19:39:52 +0100
committerPieter Wuille <pieter.wuille@gmail.com>2013-01-09 22:28:46 +0100
commitc2b72ba27f0b41d15c70818cb974d4fe7188d17c (patch)
treea76205d143c4e345666b488212253d7e9de51266
parent429915bd0dfcdb03b13d9a3c2fb82d5401ef70ce (diff)
downloadbitcoin-c2b72ba27f0b41d15c70818cb974d4fe7188d17c.tar.xz
Remove fClient
Client (SPV) mode never got implemented entirely, and whatever part was already working, is likely not been tested (or even executed at all) for the past two years. This removes it entirely. If we want an SPV implementation, I think we should first get the block chain data structures to be encapsulated in a class implementing a standard interface, and then writing an alternate implementation with SPV semantics.
-rw-r--r--src/main.cpp43
-rw-r--r--src/net.cpp3
-rw-r--r--src/net.h1
3 files changed, 14 insertions, 33 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 28fbc8b450..7585ae3aef 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -467,28 +467,21 @@ CTransaction::GetLegacySigOpCount() const
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
{
- if (fClient)
- {
- if (hashBlock == 0)
- return 0;
- }
- else
- {
- CBlock blockTmp;
-
- if (pblock == NULL) {
- CCoins coins;
- if (pcoinsTip->GetCoins(GetHash(), coins)) {
- CBlockIndex *pindex = FindBlockByHeight(coins.nHeight);
- if (pindex) {
- if (!blockTmp.ReadFromDisk(pindex))
- return 0;
- pblock = &blockTmp;
- }
+ CBlock blockTmp;
+
+ if (pblock == NULL) {
+ CCoins coins;
+ if (pcoinsTip->GetCoins(GetHash(), coins)) {
+ CBlockIndex *pindex = FindBlockByHeight(coins.nHeight);
+ if (pindex) {
+ if (!blockTmp.ReadFromDisk(pindex))
+ return 0;
+ pblock = &blockTmp;
}
}
+ }
- if (pblock) {
+ if (pblock) {
// Update the tx's hashBlock
hashBlock = pblock->GetHash();
@@ -506,7 +499,6 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
// Fill in merkle branch
vMerkleBranch = pblock->GetMerkleBranch(nIndex);
- }
}
// Is the tx in a block that's in the main chain
@@ -915,16 +907,7 @@ int CMerkleTx::GetBlocksToMaturity() const
bool CMerkleTx::AcceptToMemoryPool(bool fCheckInputs)
{
- if (fClient)
- {
- if (!IsInMainChain() && !ClientCheckInputs())
- return false;
- return CTransaction::AcceptToMemoryPool(false);
- }
- else
- {
- return CTransaction::AcceptToMemoryPool(fCheckInputs);
- }
+ return CTransaction::AcceptToMemoryPool(fCheckInputs);
}
diff --git a/src/net.cpp b/src/net.cpp
index b54f8c15f7..7867c85b7f 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -45,10 +45,9 @@ struct LocalServiceInfo {
//
// Global state variables
//
-bool fClient = false;
bool fDiscover = true;
bool fUseUPnP = false;
-uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
+uint64 nLocalServices = NODE_NETWORK;
static CCriticalSection cs_mapLocalHost;
static map<CNetAddr, LocalServiceInfo> mapLocalHost;
static bool vfReachable[NET_MAX] = {};
diff --git a/src/net.h b/src/net.h
index e37953772e..44c80dac28 100644
--- a/src/net.h
+++ b/src/net.h
@@ -86,7 +86,6 @@ enum threadId
THREAD_MAX
};
-extern bool fClient;
extern bool fDiscover;
extern bool fUseUPnP;
extern uint64 nLocalServices;