From fe643a37ae047f17e0265c325d8693aa3577d7db Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 13 Nov 2014 15:29:46 -0800 Subject: [PATCH] remove old WalletGetTransaction code. --- src/bitcoindjs.cc | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 858dd940..ad043c82 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -4410,21 +4410,10 @@ NAN_METHOD(WalletGetTransaction) { if (options->Get(NanNew("txid"))->IsString()) { String::Utf8Value txid_(options->Get(NanNew("txid"))->ToString()); txid = std::string(*txid_); + } else { + return NanThrowError("txid not specified."); } -#if 0 - // XXX - SLOW - Local txs = WalletListTransactions(args); - for (unsigned int i = 0; i < txs->Length(); ti++) { - String::Utf8Value id_(txs[i]->Get(NanNew("txid"))->ToString()); - std::string id = std::string(*id_); - if (id == txid) { - NanReturnValue(txs[i]); - } - } - NanReturnValue(Undefined()); -#endif - uint256 hash; hash.SetHex(txid); @@ -4446,7 +4435,8 @@ NAN_METHOD(WalletGetTransaction) { CAmount nNet = nCredit - nDebit; CAmount nFee = (wtx.IsFromMe(filter) ? wtx.GetValueOut() - nDebit : 0); - entry->Set(NanNew("amount"), NanNew(SatoshiFromAmount(nNet - nFee))); + entry->Set(NanNew("amount"), + NanNew(SatoshiFromAmount(nNet - nFee))); if (wtx.IsFromMe(filter)) { entry->Set(NanNew("fee"), NanNew(SatoshiFromAmount(nFee)));