4656a00705
This changes the database access APIs and each of the "manager" packages (waddrmgr/wstakemgr) so that transactions are opened (only) by the wallet package and the namespace buckets that each manager expects to operate on are passed in as parameters. This helps improve the atomicity situation as it means that many calls to these APIs can be grouped together into a single database transaction. This change does not attempt to completely fix the "half-processed" block problem. Mined transactions are still added to the wallet database under their own database transaction as this is how they are notified by the consensus JSON-RPC server (as loose transactions, without the rest of the block that contains them). It will make updating to a fixed notification model significantly easier, as the same "manager" APIs can still be used, but grouped into a single atomic transaction. |
||
---|---|---|
.. | ||
db.go | ||
doc.go | ||
driver.go | ||
driver_test.go | ||
interface_test.go | ||
README.md |
bdb
[] (https://travis-ci.org/btcsuite/btcwallet)
Package bdb implements an driver for walletdb that uses boltdb for the backing datastore. Package bdb is licensed under the copyfree ISC license.
Usage
This package is only a driver to the walletdb package and provides the database type of "bdb". The only parameter the Open and Create functions take is the database path as a string:
db, err := walletdb.Open("bdb", "path/to/database.db")
if err != nil {
// Handle error
}
db, err := walletdb.Create("bdb", "path/to/database.db")
if err != nil {
// Handle error
}
Documentation
[] (http://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb)
Full go doc
style documentation for the project can be viewed online without
installing this package by using the GoDoc site here:
http://godoc.org/github.com/btcsuite/btcwallet/walletdb/bdb
You can also view the documentation locally once the package is installed with
the godoc
tool by running godoc -http=":6060"
and pointing your browser to
http://localhost:6060/pkg/github.com/btcsuite/btcwallet/walletdb/bdb
License
Package bdb is licensed under the copyfree ISC License.