diff --git a/src/interfaces/chain.h b/src/interfaces/chain.h index 6f3f01faa2..683d6c1955 100644 --- a/src/interfaces/chain.h +++ b/src/interfaces/chain.h @@ -46,7 +46,9 @@ namespace interfaces { class Wallet; class Handler; -//! 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: @@ -71,6 +73,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 12f5727cb2..34ed833f25 100644 --- a/src/node/interfaces.cpp +++ b/src/node/interfaces.cpp @@ -483,6 +483,7 @@ bool FillBlock(const CBlockIndex* index, const FoundBlock& block, UniqueLockSetNull(); } + block.found = true; return true; }