Fixes import & export with new encryption
This commit is contained in:
parent
1b0f6836dc
commit
35bab383b0
12 changed files with 86 additions and 67 deletions
|
|
@ -6,6 +6,7 @@ var preconditions = require('preconditions').singleton();
|
|||
var inherits = require('inherits');
|
||||
var events = require('events');
|
||||
var async = require('async');
|
||||
var cryptoUtil = require('../util/crypto');
|
||||
|
||||
var bitcore = require('bitcore');
|
||||
var bignum = bitcore.Bignum;
|
||||
|
|
@ -683,7 +684,6 @@ Wallet.prototype.getNetworkName = function() {
|
|||
};
|
||||
|
||||
/**
|
||||
* @desc
|
||||
* @return {bool}
|
||||
*/
|
||||
Wallet.prototype.isTestnet = function() {
|
||||
|
|
@ -2864,4 +2864,11 @@ Wallet.prototype.getTransactionHistory = function(cb) {
|
|||
}
|
||||
};
|
||||
|
||||
Wallet.prototype.exportEncrypted = function(password, opts) {
|
||||
opts = opts || {};
|
||||
var crypto = opts.cryptoUtil || cryptoUtil;
|
||||
var key = crypto.kdf(password);
|
||||
return crypto.encrypt(key, this.toObj());
|
||||
};
|
||||
|
||||
module.exports = Wallet;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue