conformal/btcwallet — pull request #145 by larshesel (2014-10-24 13:33:17+00:00)
Title: Make scrypt parameters overridable/optional when creating the Manager

Here is a proposal for making the scrypt parameters overridable when the Manager is created in the waddrmgr.Create call.

This removes the package scope variables scryptN, scryptR, scryptP and newSecretKey.

Note that I do not store the scrypt parameters in the Manager structure, but persist them in the database so Load can retrieve them in order to recreate the newSecretKey function on the Manager structure which is needed by the ChangePassphrase function. The scrypt parameters are not needed elsewhere.

I've modeled the optional parameter on Dave Cheneys 'Functional Options' pattern: http://dotgo.sourcegraph.com/post/99643162983/dave-cheney-functional-options, with the difference that the parameter function does not work directly on the Manager structure but on an auxiliary options structure.