mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 06:58:57 +01:00
scripted-diff: Rename COutput member variables
Update the member variables to match the new style -BEGIN VERIFY SCRIPT- sed -i 's/fSpendableIn/spendable/' $(git grep -l "fSpendableIn") sed -i 's/fSpendable/spendable/' $(git grep -l "fSpendable") sed -i 's/fSolvableIn/solvable/' $(git grep -l "fSolvableIn") sed -i 's/fSolvable/solvable/' $(git grep -l "fSolvable") sed -i 's/fSafeIn/safe/' $(git grep -l "fSafeIn") sed -i 's/fSafe/safe/' $(git grep -l "fSafe") sed -i 's/nInputBytes/input_bytes/' $(git grep -l "nInputBytes") sed -i 's/nDepthIn/depth/' $(git grep -l "nDepthIn" src/wallet src/bench) sed -i 's/nDepth/depth/' src/wallet/spend.h sed -i 's/\.nDepth/.depth/' $(git grep -l "\.nDepth" src/wallet/) sed -i 's/nDepth, FormatMoney/depth, FormatMoney/' src/wallet/spend.cpp -END VERIFY SCRIPT-
This commit is contained in:
@@ -157,7 +157,7 @@ inline std::vector<OutputGroup>& GroupCoins(const std::vector<COutput>& coins)
|
||||
static_groups.clear();
|
||||
for (auto& coin : coins) {
|
||||
static_groups.emplace_back();
|
||||
static_groups.back().Insert(coin.GetInputCoin(), coin.nDepth, coin.tx->m_amounts[CWalletTx::DEBIT].m_cached[ISMINE_SPENDABLE] && coin.tx->m_amounts[CWalletTx::DEBIT].m_value[ISMINE_SPENDABLE] == 1 /* HACK: we can't figure out the is_me flag so we use the conditions defined above; perhaps set safe to false for !fIsFromMe in add_coin() */, 0, 0, false);
|
||||
static_groups.back().Insert(coin.GetInputCoin(), coin.depth, coin.tx->m_amounts[CWalletTx::DEBIT].m_cached[ISMINE_SPENDABLE] && coin.tx->m_amounts[CWalletTx::DEBIT].m_value[ISMINE_SPENDABLE] == 1 /* HACK: we can't figure out the is_me flag so we use the conditions defined above; perhaps set safe to false for !fIsFromMe in add_coin() */, 0, 0, false);
|
||||
}
|
||||
return static_groups;
|
||||
}
|
||||
@@ -315,13 +315,13 @@ BOOST_AUTO_TEST_CASE(bnb_search_test)
|
||||
std::vector<COutput> coins;
|
||||
|
||||
add_coin(coins, *wallet, 1);
|
||||
coins.at(0).nInputBytes = 40; // Make sure that it has a negative effective value. The next check should assert if this somehow got through. Otherwise it will fail
|
||||
coins.at(0).input_bytes = 40; // Make sure that it has a negative effective value. The next check should assert if this somehow got through. Otherwise it will fail
|
||||
BOOST_CHECK(!SelectCoinsBnB(GroupCoins(coins), 1 * CENT, coin_selection_params_bnb.m_cost_of_change));
|
||||
|
||||
// Test fees subtracted from output:
|
||||
coins.clear();
|
||||
add_coin(coins, *wallet, 1 * CENT);
|
||||
coins.at(0).nInputBytes = 40;
|
||||
coins.at(0).input_bytes = 40;
|
||||
coin_selection_params_bnb.m_subtract_fee_outputs = true;
|
||||
const auto result9 = SelectCoinsBnB(GroupCoins(coins), 1 * CENT, coin_selection_params_bnb.m_cost_of_change);
|
||||
BOOST_CHECK(result9);
|
||||
|
||||
Reference in New Issue
Block a user