bitcoin/bitcoin — pull request #1293 by jgarzik (2012-05-14 00:23:03+00:00)
Title: Encapsulate BDB environment inside new CDBEnv class

Cleans up and organizes several scattered functions and variables related to
the BDB env. Class CDBInit() existed to provide a
guaranteed-via-C++-destructor cleanup of the db environment.

A formal CDBEnv class provides all of this inside a single wrapper.

NOTES:
1) Other db.cpp-related operations might be candidates for CDBEnv inclusion. This current commit was chosen as a good starting point, only encapsulating clearly-dbenv-related items.
2) Further wrappers may easily encapsulate remaining direct bitdb.dbenv accesses, though it hardly seems worth it.
3) CDBEnv is a starting point for easy cross-database transactions. BDB supports this, but bitcoin codebase hardcodes txn<->database association into CDB.