From a792f9048977b352fe27d61bf1c386ac016d1ba2 Mon Sep 17 00:00:00 2001 From: Sami Ahmed Date: Thu, 23 Apr 2026 02:39:37 -0700 Subject: [PATCH] Fix linker error: move extern txdb declaration out of UtxoSnapshot namespace The extern declaration for the global leveldb::DB *txdb was inside namespace UtxoSnapshot{}, causing the linker to look for UtxoSnapshot::txdb instead of the global ::txdb defined in txdb-leveldb.cpp. Co-Authored-By: Claude Opus 4.6 --- src/utxosnapshot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utxosnapshot.cpp b/src/utxosnapshot.cpp index 7f37fb7..ed8558c 100644 --- a/src/utxosnapshot.cpp +++ b/src/utxosnapshot.cpp @@ -25,6 +25,9 @@ namespace fs = boost::filesystem; +// Global LevelDB pointer (defined in txdb-leveldb.cpp) +extern leveldb::DB *txdb; + namespace UtxoSnapshot { // --------------------------------------------------------------------------- @@ -124,9 +127,6 @@ bool DumpSnapshot(const fs::path& destPath, // Write UTXO section using LevelDB iterator (same pattern as SumUtxoValues) { - // Access the global LevelDB directly via a CTxDB instance - // We need a raw iterator, so we re-implement the iteration pattern - extern leveldb::DB *txdb; CDataStream ssKeyPrefix(SER_DISK, CLIENT_VERSION); ssKeyPrefix << std::make_pair(std::string("u"), std::make_pair(uint256(0), (unsigned int)0));