Browse Source

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.
0.8
Pieter Wuille 12 years ago
parent
commit
c2b72ba27f
  1. 17
      src/main.cpp
  2. 3
      src/net.cpp
  3. 1
      src/net.h

17
src/main.cpp

@ -466,13 +466,6 @@ CTransaction::GetLegacySigOpCount() const @@ -466,13 +466,6 @@ CTransaction::GetLegacySigOpCount() const
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
{
if (fClient)
{
if (hashBlock == 0)
return 0;
}
else
{
CBlock blockTmp;
@ -507,7 +500,6 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock) @@ -507,7 +500,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
map<uint256, CBlockIndex*>::iterator mi = mapBlockIndex.find(hashBlock);
@ -914,18 +906,9 @@ int CMerkleTx::GetBlocksToMaturity() const @@ -914,18 +906,9 @@ 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);
}
}

3
src/net.cpp

@ -45,10 +45,9 @@ struct LocalServiceInfo { @@ -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] = {};

1
src/net.h

@ -86,7 +86,6 @@ enum threadId @@ -86,7 +86,6 @@ enum threadId
THREAD_MAX
};
extern bool fClient;
extern bool fDiscover;
extern bool fUseUPnP;
extern uint64 nLocalServices;

Loading…
Cancel
Save