This allows to remove an assert and at the same time make it more obvious that the block is never nullptr.
Also, add missing {}
while touching the function.
This allows to remove an assert and at the same time make it more obvious that the block is never nullptr.
Also, add missing {}
while touching the function.
Concept ACK
Candidates for similar treatment can be found using the git grep
commands in #19062 :)
assert(pindex);
, so passing nullptr wasn’t possible before this commit either.
BlockRequested no longer takes a pointer. Which means we can’t call it for blocks for which we don’t have a header.
(from #20295 (comment))
I think this is fine. Since headers-first syncing, we’ll never attempt to download a block if we don’t already have its header.
Adding the assert in #22141 didn’t add any new assumptions. All callers of BlockRequested
were already dereferencing the CBlockIndex*
that was bring passed in.