Skip to content

Commit

Permalink
Add the wallet to the pool before the initial key derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
dworznik committed Mar 14, 2016
1 parent e5c05c3 commit 49581a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bcoin/pool.js
Expand Up @@ -1219,13 +1219,14 @@ Pool.prototype.isWatched = function(tx, bloom) {
Pool.prototype.addWallet = function addWallet(wallet, callback) {
var self = this;

this.watchWallet(wallet);

if (this.loading)
return this.once('load', this.addWallet.bind(this, wallet, callback));

if (this.wallets.indexOf(wallet) !== -1)
return false;

this.watchWallet(wallet);
this.wallets.push(wallet);

function search() {
Expand Down
4 changes: 4 additions & 0 deletions lib/bcoin/wallet.js
Expand Up @@ -67,6 +67,10 @@ function Wallet(options) {
this.m = options.m || 1;
this.n = options.n || 1;

if(options.pool) {
options.addWallet(this);
}

if (this.n > 1)
this.type = 'multisig';

Expand Down

0 comments on commit 49581a0

Please sign in to comment.