Branch: refs/heads/master
  Home:   https://github.com/btcsuite/btcwallet
  Commit: c8bdd71074dc05dd8e8f28ae195fac1f8c58ec14
      
https://github.com/btcsuite/btcwallet/commit/c8bdd71074dc05dd8e8f28ae195fac1f8c58ec14
  Author: Dave Collins <[email protected]>
  Date:   2015-03-04 (Wed, 04 Mar 2015)

  Changed paths:
    M waddrmgr/db.go
    M waddrmgr/error.go
    M waddrmgr/error_test.go
    M waddrmgr/internal_test.go
    M waddrmgr/manager.go
    M waddrmgr/manager_test.go

  Log Message:
  -----------
  waddrmgr: Make create/update logic more explicit.

This commit makes the creation and updating of the address manager more
explicit so it's easier to upgrade in the future.

In particular, rather than treating the initial creation as an upgrade by
relying on creating the initial buckets on the fly on each load, the code
now explicitly provides distinct create and upgrade paths that are invoked
from the Create and Open functions, respectively.

It also adds some commented out sample code to illustrate how upgrades
should be done and a check to ensure bumping the version number without
writing upgrade code results in a new error, ErrUpgrade, being returned.

Finally, a test has been added for the new functionality.


Reply via email to