diff --git a/src/amount.h b/src/amount.h --- a/src/amount.h +++ b/src/amount.h @@ -151,7 +151,6 @@ static constexpr Amount SATOSHI = Amount::satoshi(); static constexpr Amount CASH = 100 * SATOSHI; static constexpr Amount COIN = 100000000 * SATOSHI; -static constexpr Amount CENT = COIN / 100; extern const std::string CURRENCY_UNIT; diff --git a/src/bench/ccoins_caching.cpp b/src/bench/ccoins_caching.cpp --- a/src/bench/ccoins_caching.cpp +++ b/src/bench/ccoins_caching.cpp @@ -12,8 +12,8 @@ // FIXME: Dedup with SetupDummyInputs in test/transaction_tests.cpp. // // Helper: create two dummy transactions, each with -// two outputs. The first has 11 and 50 CENT outputs -// paid to a TX_PUBKEY, the second 21 and 22 CENT outputs +// two outputs. The first has 11 and 50 COIN outputs +// paid to a TX_PUBKEY, the second 21 and 22 COIN outputs // paid to a TX_PUBKEYHASH. // static std::vector @@ -30,19 +30,19 @@ // Create some dummy input transactions dummyTransactions[0].vout.resize(2); - dummyTransactions[0].vout[0].nValue = 11 * CENT; + dummyTransactions[0].vout[0].nValue = 11 * COIN; dummyTransactions[0].vout[0].scriptPubKey << ToByteVector(key[0].GetPubKey()) << OP_CHECKSIG; - dummyTransactions[0].vout[1].nValue = 50 * CENT; + dummyTransactions[0].vout[1].nValue = 50 * COIN; dummyTransactions[0].vout[1].scriptPubKey << ToByteVector(key[1].GetPubKey()) << OP_CHECKSIG; AddCoins(coinsRet, CTransaction(dummyTransactions[0]), 0); dummyTransactions[1].vout.resize(2); - dummyTransactions[1].vout[0].nValue = 21 * CENT; + dummyTransactions[1].vout[0].nValue = 21 * COIN; dummyTransactions[1].vout[0].scriptPubKey = GetScriptForDestination(key[2].GetPubKey().GetID()); - dummyTransactions[1].vout[1].nValue = 22 * CENT; + dummyTransactions[1].vout[1].nValue = 22 * COIN; dummyTransactions[1].vout[1].scriptPubKey = GetScriptForDestination(key[3].GetPubKey().GetID()); AddCoins(coinsRet, CTransaction(dummyTransactions[1]), 0); @@ -74,7 +74,7 @@ t1.vin[2].scriptSig << std::vector(65, 0) << std::vector(33, 4); t1.vout.resize(2); - t1.vout[0].nValue = 90 * CENT; + t1.vout[0].nValue = 90 * COIN; t1.vout[0].scriptPubKey << OP_1; // Benchmark. @@ -84,7 +84,7 @@ AreInputsStandard(t, coins, STANDARD_SCRIPT_VERIFY_FLAGS); assert(success); Amount value = coins.GetValueIn(t); - assert(value == (50 + 21 + 22) * CENT); + assert(value == (50 + 21 + 22) * COIN); } } diff --git a/src/bench/rpc_mempool.cpp b/src/bench/rpc_mempool.cpp --- a/src/bench/rpc_mempool.cpp +++ b/src/bench/rpc_mempool.cpp @@ -31,9 +31,9 @@ tx.vin[0].scriptSig = CScript() << OP_1; tx.vout.resize(1); tx.vout[0].scriptPubKey = CScript() << OP_1 << OP_EQUAL; - tx.vout[0].nValue = i * CENT; + tx.vout[0].nValue = i * COIN; const CTransactionRef tx_r{MakeTransactionRef(tx)}; - AddTx(tx_r, /* fee */ i * CENT, pool); + AddTx(tx_r, /* fee */ i * COIN, pool); } while (state.KeepRunning()) { diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -57,6 +57,8 @@ return g_insecure_rand_ctx.randbool(); } +static constexpr Amount CENT(COIN / 100); + /** * Basic testing setup. * This just configures logging and chain parameters. diff --git a/src/util/moneystr.cpp b/src/util/moneystr.cpp --- a/src/util/moneystr.cpp +++ b/src/util/moneystr.cpp @@ -45,7 +45,7 @@ for (; *p; p++) { if (*p == '.') { p++; - Amount nMult = 10 * CENT; + Amount nMult = COIN / 10; while (isdigit(*p) && (nMult > Amount::zero())) { nUnits += (*p++ - '0') * nMult; nMult /= 10; diff --git a/src/wallet/coinselection.h b/src/wallet/coinselection.h --- a/src/wallet/coinselection.h +++ b/src/wallet/coinselection.h @@ -10,7 +10,7 @@ #include //! target minimum change amount -static const Amount MIN_CHANGE = CENT; +static constexpr Amount MIN_CHANGE{COIN / 100}; //! final minimum change amount after paying for fees static const Amount MIN_FINAL_CHANGE = MIN_CHANGE / 2;