|
|
@ -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) |
|
|
|
if (pblock == NULL) { |
|
|
|
return 0; |
|
|
|
CCoins coins; |
|
|
|
} |
|
|
|
if (pcoinsTip->GetCoins(GetHash(), coins)) { |
|
|
|
else |
|
|
|
CBlockIndex *pindex = FindBlockByHeight(coins.nHeight); |
|
|
|
{ |
|
|
|
if (pindex) { |
|
|
|
CBlock blockTmp; |
|
|
|
if (!blockTmp.ReadFromDisk(pindex)) |
|
|
|
|
|
|
|
return 0; |
|
|
|
if (pblock == NULL) { |
|
|
|
pblock = &blockTmp; |
|
|
|
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
|
|
|
|
// 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); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|