mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Merge cdcc74bbcc into merged_master (Elements PR #1270)
This commit is contained in:
commit
61b0543ba7
20 changed files with 508 additions and 127 deletions
|
|
@ -3401,12 +3401,13 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
|
|||
for (; pindex; pindex = m_chainman.ActiveChain().Next(pindex))
|
||||
{
|
||||
if (pindex->trimmed()) {
|
||||
// For simplicity, if any of the headers they're asking for are trimmed,
|
||||
// just drop the request.
|
||||
LogPrint(BCLog::NET, "%s: ignoring getheaders from peer=%i which would return at least one trimmed header\n", __func__, pfrom.GetId());
|
||||
return;
|
||||
// Header is trimmed, reload from disk before sending
|
||||
CBlockIndex tmpBlockIndexFull;
|
||||
const CBlockIndex* pindexfull = pindex->untrim_to(&tmpBlockIndexFull);
|
||||
vHeaders.push_back(pindexfull->GetBlockHeader());
|
||||
} else {
|
||||
vHeaders.push_back(pindex->GetBlockHeader());
|
||||
}
|
||||
vHeaders.push_back(pindex->GetBlockHeader());
|
||||
if (--nLimit <= 0 || pindex->GetBlockHash() == hashStop)
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue