update comments for tx weight

This commit is contained in:
Brian Deery 2016-11-14 00:38:07 -06:00
parent 87ab49e4fe
commit 07ede5d711
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ bool IsStandardTx(const CTransaction& tx, std::string& reason, const bool witnes
// Extremely large transactions with lots of inputs can cost the network // Extremely large transactions with lots of inputs can cost the network
// almost as much to process as they cost the sender in fees, because // almost as much to process as they cost the sender in fees, because
// computing signature hashes is O(ninputs*txsize). Limiting transactions // computing signature hashes is O(ninputs*txsize). Limiting transactions
// to MAX_STANDARD_TX_SIZE mitigates CPU exhaustion attacks. // to MAX_STANDARD_TX_WEIGHT mitigates CPU exhaustion attacks.
unsigned int sz = GetTransactionWeight(tx); unsigned int sz = GetTransactionWeight(tx);
if (sz >= MAX_STANDARD_TX_WEIGHT) { if (sz >= MAX_STANDARD_TX_WEIGHT) {
reason = "tx-size"; reason = "tx-size";

View file

@ -266,7 +266,7 @@ BOOST_AUTO_TEST_CASE(coin_selection_tests)
// test with many inputs // test with many inputs
for (CAmount amt=1500; amt < COIN; amt*=10) { for (CAmount amt=1500; amt < COIN; amt*=10) {
empty_wallet(); empty_wallet();
// Create 676 inputs (= MAX_STANDARD_TX_SIZE / 148 bytes per input) // Create 676 inputs (= (old MAX_STANDARD_TX_SIZE == 100000) / 148 bytes per input)
for (uint16_t j = 0; j < 676; j++) for (uint16_t j = 0; j < 676; j++)
add_coin(amt); add_coin(amt);
BOOST_CHECK(wallet.SelectCoinsMinConf(2000, 1, 1, vCoins, setCoinsRet, nValueRet)); BOOST_CHECK(wallet.SelectCoinsMinConf(2000, 1, 1, vCoins, setCoinsRet, nValueRet));