Skip to content

Commit

Permalink
fix(Wallet): use xprv private key serialization format
Browse files Browse the repository at this point in the history
Fixes format errors that occurred when using IndexedDB (in the browser).
  • Loading branch information
mappum committed Jan 5, 2016
1 parent a15e80a commit 60e5a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ Wallet.prototype._scanChain = function (opts) {
})
txs.on('end', function () {
self.scanning = false
if (!txs.last) return
self.state.tip = {
height: txs.last.height,
header: txs.last.header
Expand Down Expand Up @@ -570,7 +571,7 @@ Wallet.prototype._loadRootKey = function (cb) {
if (err && !err.notFound) return cb(err)
if (err && err.notFound) {
self.rootKey = new HDPrivateKey()
var serialized = self.rootKey.toBuffer()
var serialized = self.rootKey.xprivkey
self.store.put('root', serialized, opts, function (err) { cb(err, self.rootKey) })
return
}
Expand Down

0 comments on commit 60e5a79

Please sign in to comment.