fix m, n, publicKeys in wallet constructor.

This commit is contained in:
Christopher Jeffrey 2015-12-05 01:03:51 -08:00
parent 1e10b83acf
commit 377e156874

View File

@ -58,13 +58,13 @@ function Wallet(options, passphrase) {
this.fee = 10000;
this.dust = 5460;
if (options.m != null) {
this.m = options.m;
this.n = options.n;
this.publicKeys = options.publicKeys || [];
this.m = options.m || 1;
this.n = options.n || 1;
this.publicKeys = options.publicKeys;
if (this.n < this.publicKeys.length) {
this.publicKeys.push(this.getPublicKey('base58'));
if (this.publicKeys) {
if (this.publicKeys.length < this.n) {
this.publicKeys.push(this.getPublicKey());
}
if (this.m < 1 || this.m > this.n) {