fix isEncrypted.
This commit is contained in:
parent
ed9508740a
commit
98465d61e8
@ -747,10 +747,18 @@ Wallet.prototype.encrypt = function(options) {
|
|||||||
return bitcoindjs.walletEncrypt(options || {});
|
return bitcoindjs.walletEncrypt(options || {});
|
||||||
};
|
};
|
||||||
|
|
||||||
Wallet.prototype.isEncrypted = function() {
|
Wallet.prototype.encrypted = function() {
|
||||||
return bitcoindjs.walletEncrypted();
|
return bitcoindjs.walletEncrypted();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Wallet.prototype.isEncrypted = function() {
|
||||||
|
return this.encrypted().encrypted;
|
||||||
|
};
|
||||||
|
|
||||||
|
Wallet.prototype.isLocked = function() {
|
||||||
|
return this.encrypted().locked;
|
||||||
|
};
|
||||||
|
|
||||||
Wallet.prototype.dumpKey = function(options) {
|
Wallet.prototype.dumpKey = function(options) {
|
||||||
return bitcoindjs.dumpKey(options || {});
|
return bitcoindjs.dumpKey(options || {});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3748,12 +3748,18 @@ NAN_METHOD(WalletEncrypted) {
|
|||||||
"Usage: bitcoindjs.walletEncrypted()");
|
"Usage: bitcoindjs.walletEncrypted()");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLocked = pwalletMain->IsLocked();
|
bool isLocked = false;
|
||||||
bool isEncrypted = pwalletMain->IsCrypted();
|
bool isEncrypted = false;
|
||||||
|
|
||||||
|
isEncrypted = pwalletMain->IsCrypted();
|
||||||
|
|
||||||
|
if (isEncrypted) {
|
||||||
|
isLocked = pwalletMain->IsLocked();
|
||||||
|
}
|
||||||
|
|
||||||
Local<Object> result = NanNew<Object>();
|
Local<Object> result = NanNew<Object>();
|
||||||
result->Set(NanNew<String>("locked"), NanNew<Boolean>(isLocked));
|
result->Set(NanNew<String>("locked"), NanNew<Boolean>(isLocked));
|
||||||
result->Set(NanNew<String>("encrypted"), NanNew<Boolean>(isCrypted));
|
result->Set(NanNew<String>("encrypted"), NanNew<Boolean>(isEncrypted));
|
||||||
|
|
||||||
NanReturnValue(result);
|
NanReturnValue(result);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user