aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/interfaces/chain.h5
-rw-r--r--src/node/interfaces.cpp1
2 files changed, 5 insertions, 1 deletions
diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h
index 7cac435e96..bd259cb6b5 100644
--- a/src/interfaces/chain.h
+++ b/src/interfaces/chain.h
@@ -35,7 +35,9 @@ namespace interfaces {
class Handler;
class Wallet;
-//! Helper for findBlock to selectively return pieces of block data.
+//! Helper for findBlock to selectively return pieces of block data. If block is
+//! found, data will be returned by setting specified output variables. If block
+//! is not found, output variables will keep their previous values.
class FoundBlock
{
public:
@@ -60,6 +62,7 @@ public:
bool* m_in_active_chain = nullptr;
const FoundBlock* m_next_block = nullptr;
CBlock* m_data = nullptr;
+ mutable bool found = false;
};
//! Interface giving clients (wallet processes, maybe other analysis tools in
diff --git a/src/node/interfaces.cpp b/src/node/interfaces.cpp
index 183b5a5d91..eef4ce1c6c 100644
--- a/src/node/interfaces.cpp
+++ b/src/node/interfaces.cpp
@@ -334,6 +334,7 @@ bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLock<Rec
REVERSE_LOCK(lock);
if (!ReadBlockFromDisk(*block.m_data, index, Params().GetConsensus())) block.m_data->SetNull();
}
+ block.found = true;
return true;
}