aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-07-06 07:21:36 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-07-06 07:21:40 +0200
commitaef381161f3bac4a720d9134920b8836a09fb280 (patch)
tree2341d4a15616d4282e6f55b487d41f355905ddd0 /src
parent005d3b6430096c2e2e35050f4658f902984cfecc (diff)
parent20f3cd75f6af8f75de943fef43b4b7769746f732 (diff)
downloadbitcoin-aef381161f3bac4a720d9134920b8836a09fb280.tar.xz
Merge #8298: wallet: Revert input selection post-pruning
20f3cd7 wallet: Revert input selection post-pruning (Wladimir J. van der Laan)
Diffstat (limited to 'src')
-rw-r--r--src/wallet/test/wallet_tests.cpp14
-rw-r--r--src/wallet/wallet.cpp10
2 files changed, 0 insertions, 24 deletions
diff --git a/src/wallet/test/wallet_tests.cpp b/src/wallet/test/wallet_tests.cpp
index 0a4f06ba88..c6c5058984 100644
--- a/src/wallet/test/wallet_tests.cpp
+++ b/src/wallet/test/wallet_tests.cpp
@@ -349,20 +349,6 @@ BOOST_AUTO_TEST_CASE(ApproximateBestSubset)
BOOST_CHECK(wallet.SelectCoinsMinConf(1003 * COIN, 1, 6, vCoins, setCoinsRet, nValueRet));
BOOST_CHECK_EQUAL(nValueRet, 1003 * COIN);
BOOST_CHECK_EQUAL(setCoinsRet.size(), 2U);
-
- empty_wallet();
-
- // Test trimming
- for (int i = 0; i < 100; i++)
- add_coin(10 * COIN);
- for (int i = 0; i < 100; i++)
- add_coin(1000 * COIN);
-
- BOOST_CHECK(wallet.SelectCoinsMinConf(100001 * COIN, 1, 6, vCoins, setCoinsRet, nValueRet));
- // We need all 100 larger coins and exactly one small coin.
- // Superfluous small coins must be trimmed from the set:
- BOOST_CHECK_EQUAL(nValueRet, 100010 * COIN);
- BOOST_CHECK_EQUAL(setCoinsRet.size(), 101);
}
BOOST_AUTO_TEST_SUITE_END()
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 87b85eeb72..a0095ebd92 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1879,16 +1879,6 @@ static void ApproximateBestSubset(vector<pair<CAmount, pair<const CWalletTx*,uns
}
}
}
-
- //Reduces the approximate best subset by removing any inputs that are smaller than the surplus of nTotal beyond nTargetValue.
- for (unsigned int i = 0; i < vValue.size(); i++)
- {
- if (vfBest[i] && (nBest - vValue[i].first) >= nTargetValue )
- {
- vfBest[i] = false;
- nBest -= vValue[i].first;
- }
- }
}
bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, vector<COutput> vCoins,