From 2f8272c2a4b6fa84c04dfeb4d751bb218f2d4c78 Mon Sep 17 00:00:00 2001 From: gzhao408 Date: Mon, 1 Feb 2021 15:24:30 -0800 Subject: [PATCH] [doc] GetBestBlock() doesn't do nothing This has tripped people up multiple times because it looks like GetBestBlock is a const function returning the value of hashBlock. --- src/validation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index d1b9efe7bac..7f1238f7953 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -690,7 +690,8 @@ bool MemPoolAccept::PreChecks(ATMPArgs& args, Workspace& ws) } } - // Bring the best block into scope + // This is const, but calls into the back end CoinsViews. The CCoinsViewDB at the bottom of the + // hierarchy brings the best block into scope. See CCoinsViewDB::GetBestBlock(). m_view.GetBestBlock(); // we have all inputs cached now, so switch back to dummy (to protect