mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
If AcceptBlockHeader returns true, pindex will be set.
Assert this instead of checking (and then dref'ing later anyway) to make sure no one thinks they can change that postcondition of AcceptBlockHeader..
This commit is contained in:
parent
96806c39f4
commit
7c29ec9449
@ -5218,10 +5218,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pindexLast)
|
assert(pindexLast);
|
||||||
UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash());
|
UpdateBlockAvailability(pfrom->GetId(), pindexLast->GetBlockHash());
|
||||||
|
|
||||||
if (nCount == MAX_HEADERS_RESULTS && pindexLast && hasNewHeaders) {
|
if (nCount == MAX_HEADERS_RESULTS && hasNewHeaders) {
|
||||||
// Headers message had its maximum size; the peer may have more headers.
|
// Headers message had its maximum size; the peer may have more headers.
|
||||||
// TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue
|
// TODO: optimize: if pindexLast is an ancestor of chainActive.Tip or pindexBestHeader, continue
|
||||||
// from there instead.
|
// from there instead.
|
||||||
|
Loading…
Reference in New Issue
Block a user