From c8377f7c082377b1e90acabeb4fa00908cdee4e8 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Tue, 30 Sep 2014 13:35:38 -0700 Subject: [PATCH] cleanup fill transaction more. --- src/bitcoindjs.cc | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index d7531546..c3bd6b73 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -1235,26 +1235,13 @@ NAN_METHOD(FillTransaction) { CDataStream ssData(ParseHex(tx_hex), SER_NETWORK, PROTOCOL_VERSION); ssData >> tx; - // Destination output - unsigned int d_output = 0; - if (options->Get(NanNew("output"))->IsNumber()) { - d_output = options->Get(NanNew("output"))->IntegerValue(); - if (d_output >= tx.vout.size()) { - return NanThrowError("Destination output does not exist"); - } - } - // Get total value of outputs // Get the scriptPubKey of the first output (presumably our destination) int64_t nValue = 0; - CScript scriptPubKeyMain; for (unsigned int vo = 0; vo < tx.vout.size(); vo++) { const CTxOut& txout = tx.vout[vo]; int64_t value = txout.nValue; const CScript& scriptPubKey = txout.scriptPubKey; - if (vo == d_output) { - scriptPubKeyMain = scriptPubKey; - } nValue += value; } @@ -1263,8 +1250,6 @@ NAN_METHOD(FillTransaction) { if (nValue + nTransactionFee > pwalletMain->GetBalance()) return NanThrowError("Insufficient funds"); - CScript scriptPubKey = scriptPubKeyMain; - int64_t nFeeRet = nTransactionFee; if (pwalletMain->IsLocked()) {