Skip to content

Commit 8b5397c

Browse files
committed
wallet: bdb: include bdb header from our implementation files only
This way the dependency can't sneak into other files without being noticed. Forward-declare bdb classes as necessary.
1 parent 6e01062 commit 8b5397c

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

src/wallet/bdb.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include <stdint.h>
2020

21+
#include <db_cxx.h>
2122
#include <sys/stat.h>
2223

2324
// Windows may not define S_IRUSR or S_IWUSR. We define both

src/wallet/bdb.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,13 @@
2121
#include <unordered_map>
2222
#include <vector>
2323

24-
#include <db_cxx.h>
25-
2624
struct bilingual_str;
2725

26+
class DbEnv;
27+
class DbTxn;
28+
class Db;
29+
class Dbc;
30+
2831
// This constant was introduced in BDB 4.0.14 and has never changed, but there
2932
// is a belt-and-suspenders check in the cpp file just in case.
3033
#define BDB_DB_FILE_ID_LEN 20 /* Unique file ID length. */

src/wallet/salvage.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
#include <wallet/wallet.h>
1212
#include <wallet/walletdb.h>
1313

14+
#include <db_cxx.h>
15+
1416
namespace wallet {
1517
/* End of headers, beginning of key/value data */
1618
static const char *HEADER_END = "HEADER=END";

0 commit comments

Comments
 (0)