Commit graph

23 commits

Author SHA1 Message Date
Wilmer Paulino
81797fe29d
multi: extend walletdb bolt driver with NoFreelistSync option
This allows external callers to set the option instead. All tests
remained with the option enabled.
2019-10-03 13:28:04 -04:00
nsa
e809748b1e bdb: specify freelist options by default
This commit specifies two bbolt options when opening the bbolt db.
This reduces heap pressure in case there are a lot of pages on
the freelist.
2019-08-01 22:15:53 -04:00
Johan T. Halseth
3378be750b
walletdb/interface: add OnCommit and Tx methods
This commit adds the method OnCommit to the ReadWriteTx interface,
making it possible to add closures to be executed once the transaction
is commitited. The method Tx is added to the ReadWriteBucket interface,
for getting the bucket's underlying tx.

The bdb implementation is updated to satisfy the interface change.
2019-02-14 09:19:18 +01:00
Johan T. Halseth
b688a6d891
walletdb/bdb: update interface implementation godoc
Recently the Bucket and Tx interfaces were split into Read and ReadWrite
versions. This commit updates the godoc for the bdb interface
implementation to be consistent with this change.
2019-02-14 09:19:18 +01:00
Olaoluwa Osuntokun
20db88d8ff
walletdb/bdb: switch from bolt to bbolt
Fixes #545.
2018-11-29 18:43:37 -08:00
Olaoluwa Osuntokun
e9b145c524 multi: run goimports 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
7770cac383 multi: switch import paths back to upstream 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
321c2fac2b build: switch from bolt to bbolt 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
3dc7a8529c multi: switch all imports to roasbeef's forks 2018-05-23 19:38:56 -07:00
Alex
e273e178dd Repoint repo to btcsuite on btcwalletln, and a few rebase fixes. 2018-05-23 19:38:56 -07:00
Josh Rickmar
e344c374e1 refactor walletdb driver tests into walletdbtest pkg and fix for api changes. 2018-05-23 19:38:56 -07:00
Josh Rickmar
4656a00705 Improve wallet atomicity.
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.
2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
77b756c651 multi: point all imports towards roasbeef's forks 2018-05-23 19:38:56 -07:00
Josh Rickmar
39fd9bd0f3 Switch from forked to upstream bolt package. 2016-05-06 14:42:00 -04:00
Josh Rickmar
d2c851431b Rollback namespace transactions when bucket is not found.
This fixes a deadlock where failed transactions due to the namespaces'
bucket being missing would cause deadlocks due to bolt's mmap rwmutex
still being read or write locked (and no way to unlock it, since the
underlying bolt tx was not returned on failure).
2016-04-05 11:50:18 -04:00
Josh Rickmar
5140086f6e Use LICENSE file and short license headers. 2016-02-28 22:22:34 -05:00
Dave Collins
c820c8a015 Relicense to the btcsuite developers. 2015-05-01 12:20:05 -05:00
Josh Rickmar
437c7b3e59 Add cursor functionality to walletdb. 2015-04-20 18:20:19 -04:00
Dave Collins
f05ab25696 Update btcwallet import paths to new location. 2015-01-17 00:25:53 -06:00
Dave Collins
caa82e9605 Update bolt import paths to new location. 2015-01-15 22:55:55 -06:00
Dave Collins
349931dae9 Add README.md for walletdb and bdb driver. 2014-11-10 16:01:48 -06:00
Dave Collins
d7c00f48d7 Add full test coverage suite for walletdb package. 2014-11-10 16:01:46 -06:00
Dave Collins
e8b4de9379 Implement new namespaced db package named walletdb.
This commit implements a new namespaced db package which  is intended to
be used be wallet and any sub-packages as its data storage mechanism.

- Key/value store
- Namespace support
- Allows multiple packages to have their own area in the database without
  worrying about conflicts
- Read-only and read-write transactions with both manual and managed modes
- Nested buckets
- Supports registration of backend databases
- Comprehensive test coverage
2014-11-10 16:01:45 -06:00