diff --git a/src/bitcoindjs.cc b/src/bitcoindjs.cc index 0fc649cc..1ed8c906 100644 --- a/src/bitcoindjs.cc +++ b/src/bitcoindjs.cc @@ -1285,9 +1285,6 @@ NAN_METHOD(FillTransaction) { CScript scriptPubKey = scriptPubKeyMain; - CWalletTx wtxNew; - - CReserveKey reservekey(pwalletMain); int64_t nFeeRet = nTransactionFee; if (pwalletMain->IsLocked()) { @@ -1296,9 +1293,6 @@ NAN_METHOD(FillTransaction) { CCoinControl* coinControl = new CCoinControl(); - vector< pair > vecSend; - vecSend.push_back(make_pair(scriptPubKey, nValue)); - int64_t nTotalValue = nValue + nFeeRet; set > setCoins; int64_t nValueIn = 0; @@ -1310,10 +1304,9 @@ NAN_METHOD(FillTransaction) { } // Fill inputs if they aren't already filled - if (tx.vin.empty()) { - BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) { - tx.vin.push_back(CTxIn(coin.first->GetHash(), coin.second)); - } + tx.vin.clear(); + BOOST_FOREACH(const PAIRTYPE(const CWalletTx*,unsigned int)& coin, setCoins) { + tx.vin.push_back(CTxIn(coin.first->GetHash(), coin.second)); } // Sign everything