mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-20 13:37:28 +02:00
refactor: Use reference instead of pointer in IsBlockPruned
This makes it harder to pass nullptr and cause issues such as
dde7ac5c70
This commit is contained in:
parent
dce1dfbc47
commit
fa604eb6cf
5 changed files with 11 additions and 13 deletions
|
|
@ -304,10 +304,9 @@ static bool rest_block(const std::any& context,
|
|||
if (!pblockindex) {
|
||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not found");
|
||||
}
|
||||
|
||||
if (chainman.m_blockman.IsBlockPruned(pblockindex))
|
||||
if (chainman.m_blockman.IsBlockPruned(*pblockindex)) {
|
||||
return RESTERR(req, HTTP_NOT_FOUND, hashStr + " not available (pruned data)");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (!chainman.m_blockman.ReadBlockFromDisk(block, *pblockindex)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue