mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-26 03:03:22 -03:00
commit
1b72229797
3 changed files with 13 additions and 32 deletions
41
src/main.cpp
41
src/main.cpp
|
@ -467,28 +467,21 @@ CTransaction::GetLegacySigOpCount() const
|
||||||
|
|
||||||
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
|
int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
|
||||||
{
|
{
|
||||||
if (fClient)
|
CBlock blockTmp;
|
||||||
{
|
|
||||||
if (hashBlock == 0)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
CBlock blockTmp;
|
|
||||||
|
|
||||||
if (pblock == NULL) {
|
if (pblock == NULL) {
|
||||||
CCoins coins;
|
CCoins coins;
|
||||||
if (pcoinsTip->GetCoins(GetHash(), coins)) {
|
if (pcoinsTip->GetCoins(GetHash(), coins)) {
|
||||||
CBlockIndex *pindex = FindBlockByHeight(coins.nHeight);
|
CBlockIndex *pindex = FindBlockByHeight(coins.nHeight);
|
||||||
if (pindex) {
|
if (pindex) {
|
||||||
if (!blockTmp.ReadFromDisk(pindex))
|
if (!blockTmp.ReadFromDisk(pindex))
|
||||||
return 0;
|
return 0;
|
||||||
pblock = &blockTmp;
|
pblock = &blockTmp;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (pblock) {
|
if (pblock) {
|
||||||
// Update the tx's hashBlock
|
// Update the tx's hashBlock
|
||||||
hashBlock = pblock->GetHash();
|
hashBlock = pblock->GetHash();
|
||||||
|
|
||||||
|
@ -506,7 +499,6 @@ int CMerkleTx::SetMerkleBranch(const CBlock* pblock)
|
||||||
|
|
||||||
// Fill in merkle branch
|
// Fill in merkle branch
|
||||||
vMerkleBranch = pblock->GetMerkleBranch(nIndex);
|
vMerkleBranch = pblock->GetMerkleBranch(nIndex);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is the tx in a block that's in the main chain
|
// 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)
|
bool CMerkleTx::AcceptToMemoryPool(bool fCheckInputs)
|
||||||
{
|
{
|
||||||
if (fClient)
|
return CTransaction::AcceptToMemoryPool(fCheckInputs);
|
||||||
{
|
|
||||||
if (!IsInMainChain() && !ClientCheckInputs())
|
|
||||||
return false;
|
|
||||||
return CTransaction::AcceptToMemoryPool(false);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return CTransaction::AcceptToMemoryPool(fCheckInputs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,9 @@ struct LocalServiceInfo {
|
||||||
//
|
//
|
||||||
// Global state variables
|
// Global state variables
|
||||||
//
|
//
|
||||||
bool fClient = false;
|
|
||||||
bool fDiscover = true;
|
bool fDiscover = true;
|
||||||
bool fUseUPnP = false;
|
bool fUseUPnP = false;
|
||||||
uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
|
uint64 nLocalServices = NODE_NETWORK;
|
||||||
static CCriticalSection cs_mapLocalHost;
|
static CCriticalSection cs_mapLocalHost;
|
||||||
static map<CNetAddr, LocalServiceInfo> mapLocalHost;
|
static map<CNetAddr, LocalServiceInfo> mapLocalHost;
|
||||||
static bool vfReachable[NET_MAX] = {};
|
static bool vfReachable[NET_MAX] = {};
|
||||||
|
|
|
@ -86,7 +86,6 @@ enum threadId
|
||||||
THREAD_MAX
|
THREAD_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
extern bool fClient;
|
|
||||||
extern bool fDiscover;
|
extern bool fDiscover;
|
||||||
extern bool fUseUPnP;
|
extern bool fUseUPnP;
|
||||||
extern uint64 nLocalServices;
|
extern uint64 nLocalServices;
|
||||||
|
|
Loading…
Add table
Reference in a new issue