wallet refactor

This commit is contained in:
Manuel Araoz 2014-08-19 10:20:35 -04:00
commit 28e00b24cc
2 changed files with 11 additions and 9 deletions

View file

@ -23,6 +23,7 @@ var preconditions = require('preconditions').singleton();
*/
function Network(opts) {
preconditions.checkArgument(opts);
var self = this;
opts = opts || {};
this.maxPeers = opts.maxPeers || 12;
@ -121,6 +122,7 @@ Network.prototype._addConnectedCopayer = function(copayerId) {
Network.prototype.getKey = function() {
if (!this.key) {
preconditions.checkState(this.privkey);
var key = new bitcore.Key();
key.private = new Buffer(this.privkey, 'hex');
key.regenerateSync();