Merge bitcoin/bitcoin#26823: refactor: Work around Werror=free-nonheap-object in AssumeCalculateMemPoolAncestors

faa86eeb41 refactor: Work around Werror=free-nonheap-object in AssumeCalculateMemPoolAncestors (MarcoFalke)

Pull request description:

  This works around the s390x gcc bug mentioned in https://github.com/bitcoin/bitcoin/issues/26820

ACKs for top commit:
  achow101:
    ACK faa86eeb41

Tree-SHA512: 041d5daa157ea1856b0a8027181085d70624f5f8822049ace9963e90c653bbb8c91d1f16b8a5bf460687eb4ed13f1db72e3885a511aadbad6dede93d9f9ccd6d
This commit is contained in:
MarcoFalke 2023-01-06 08:04:24 +01:00
commit 2cfe379623
No known key found for this signature in database
GPG Key ID: CE2B75697E69A548

View File

@ -260,8 +260,8 @@ CTxMemPool::setEntries CTxMemPool::AssumeCalculateMemPoolAncestors(
const Limits& limits,
bool fSearchForParents /* = true */) const
{
auto result{Assume(CalculateMemPoolAncestors(entry, limits, fSearchForParents))};
if (!result) {
auto result{CalculateMemPoolAncestors(entry, limits, fSearchForParents)};
if (!Assume(result)) {
LogPrintLevel(BCLog::MEMPOOL, BCLog::Level::Error, "%s: CalculateMemPoolAncestors failed unexpectedly, continuing with empty ancestor set (%s)\n",
calling_fn_name, util::ErrorString(result).original);
}