fix v8 assertion failure on tx sending.
This commit is contained in:
parent
df62ac4e22
commit
e18bfdd2fb
@ -3222,7 +3222,7 @@ NAN_METHOD(WalletRemoveRecipient) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* WalletSendTo()
|
* WalletSendTo()
|
||||||
* bitcoindjs.walletSendTo(options)
|
* bitcoindjs.walletSendTo(options, callback)
|
||||||
* Send bitcoin to an address, automatically creating the transaction based on
|
* Send bitcoin to an address, automatically creating the transaction based on
|
||||||
* availing unspent outputs.
|
* availing unspent outputs.
|
||||||
*/
|
*/
|
||||||
@ -3230,16 +3230,18 @@ NAN_METHOD(WalletRemoveRecipient) {
|
|||||||
NAN_METHOD(WalletSendTo) {
|
NAN_METHOD(WalletSendTo) {
|
||||||
NanScope();
|
NanScope();
|
||||||
|
|
||||||
if (args.Length() < 1 || !args[0]->IsObject()) {
|
if (args.Length() < 2 || !args[0]->IsObject() || !args[1]->IsFunction()) {
|
||||||
return NanThrowError(
|
return NanThrowError(
|
||||||
"Usage: bitcoindjs.walletSendTo(options)");
|
"Usage: bitcoindjs.walletSendTo(options, callback)");
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Object> options = Local<Object>::Cast(args[0]);
|
Local<Object> options = Local<Object>::Cast(args[0]);
|
||||||
|
Local<Function> callback = Local<Function>::Cast(args[1]);
|
||||||
|
|
||||||
async_wallet_sendto_data *data = new async_wallet_sendto_data();
|
async_wallet_sendto_data *data = new async_wallet_sendto_data();
|
||||||
|
|
||||||
data->err_msg = std::string("");
|
data->err_msg = std::string("");
|
||||||
|
data->callback = Persistent<Function>::New(callback);
|
||||||
|
|
||||||
String::Utf8Value addr_(options->Get(NanNew<String>("address"))->ToString());
|
String::Utf8Value addr_(options->Get(NanNew<String>("address"))->ToString());
|
||||||
std::string addr = std::string(*addr_);
|
std::string addr = std::string(*addr_);
|
||||||
@ -3342,7 +3344,7 @@ async_wallet_sendto_after(uv_work_t *req) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* WalletSendFrom()
|
* WalletSendFrom()
|
||||||
* bitcoindjs.walletSendFrom(options)
|
* bitcoindjs.walletSendFrom(options, callback)
|
||||||
* Send bitcoin to a particular address from a particular owned account name.
|
* Send bitcoin to a particular address from a particular owned account name.
|
||||||
* This once again automatically creates and signs a transaction based on any
|
* This once again automatically creates and signs a transaction based on any
|
||||||
* unspent outputs available.
|
* unspent outputs available.
|
||||||
@ -3351,16 +3353,18 @@ async_wallet_sendto_after(uv_work_t *req) {
|
|||||||
NAN_METHOD(WalletSendFrom) {
|
NAN_METHOD(WalletSendFrom) {
|
||||||
NanScope();
|
NanScope();
|
||||||
|
|
||||||
if (args.Length() < 1 || !args[0]->IsObject()) {
|
if (args.Length() < 2 || !args[0]->IsObject() || !args[1]->IsFunction()) {
|
||||||
return NanThrowError(
|
return NanThrowError(
|
||||||
"Usage: bitcoindjs.walletSendFrom(options)");
|
"Usage: bitcoindjs.walletSendFrom(options, callback)");
|
||||||
}
|
}
|
||||||
|
|
||||||
Local<Object> options = Local<Object>::Cast(args[0]);
|
Local<Object> options = Local<Object>::Cast(args[0]);
|
||||||
|
Local<Function> callback = Local<Function>::Cast(args[1]);
|
||||||
|
|
||||||
async_wallet_sendfrom_data *data = new async_wallet_sendfrom_data();
|
async_wallet_sendfrom_data *data = new async_wallet_sendfrom_data();
|
||||||
|
|
||||||
data->err_msg = std::string("");
|
data->err_msg = std::string("");
|
||||||
|
data->callback = Persistent<Function>::New(callback);
|
||||||
|
|
||||||
String::Utf8Value addr_(options->Get(NanNew<String>("address"))->ToString());
|
String::Utf8Value addr_(options->Get(NanNew<String>("address"))->ToString());
|
||||||
std::string addr = std::string(*addr_);
|
std::string addr = std::string(*addr_);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user