diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp --- a/src/bench/mempool_eviction.cpp +++ b/src/bench/mempool_eviction.cpp @@ -14,11 +14,11 @@ int64_t nTime = 0; unsigned int nHeight = 1; bool spendsCoinbase = false; - unsigned int sigOpCost = 4; + unsigned int nSigOpCount = 1; LockPoints lp; pool.addUnchecked(tx->GetId(), CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, - sigOpCost, lp)); + nSigOpCount, lp)); } // Right now this is only testing eviction performance in an extremely small 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 @@ -18,7 +18,7 @@ pool.addUnchecked(tx->GetId(), CTxMemPoolEntry(tx, fee, /* time */ 0, /* height */ 1, /* spendsCoinbase */ false, - /* sigOpCost */ 4, lp)); + /* sigOpCount */ 1, lp)); } static void RpcMempool(benchmark::State &state) { diff --git a/src/consensus/tx_verify.h b/src/consensus/tx_verify.h --- a/src/consensus/tx_verify.h +++ b/src/consensus/tx_verify.h @@ -91,11 +91,11 @@ /** * Compute total signature operation of a transaction. - * @param[in] tx Transaction for which we are computing the cost + * @param[in] tx Transaction for which we are computing the count * @param[in] inputs Map of previous transactions that have outputs we're * spending * @param[in] flags Script verification flags - * @return Total signature operation cost of tx + * @return Total signature operation count of tx */ uint64_t GetTransactionSigOpCount(const CTransaction &tx, const CCoinsViewCache &inputs, diff --git a/src/miner.h b/src/miner.h --- a/src/miner.h +++ b/src/miner.h @@ -191,7 +191,7 @@ /** Remove confirmed (inBlock) entries from given set */ void onlyUnconfirmed(CTxMemPool::setEntries &testSet); /** Test if a new package would "fit" in the block */ - bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost) const; + bool TestPackage(uint64_t packageSize, int64_t packageSigOpCount) const; /** * Perform checks on each transaction in a package: * locktime, serialized size (if necessary). These checks should always diff --git a/src/policy/policy.h b/src/policy/policy.h --- a/src/policy/policy.h +++ b/src/policy/policy.h @@ -123,11 +123,11 @@ extern uint32_t nBytesPerSigOp; /** Compute the virtual transaction size (weight reinterpreted as bytes). */ -int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCost, +int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCount, unsigned int bytes_per_sigop); -int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCost, +int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCount, unsigned int bytes_per_sigop); -int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCost, +int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCount, unsigned int bytes_per_sigop); #endif // BITCOIN_POLICY_POLICY_H diff --git a/src/policy/policy.cpp b/src/policy/policy.cpp --- a/src/policy/policy.cpp +++ b/src/policy/policy.cpp @@ -180,19 +180,19 @@ CFeeRate dustRelayFee = CFeeRate(DUST_RELAY_TX_FEE); uint32_t nBytesPerSigOp = DEFAULT_BYTES_PER_SIGOP; -int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCost, +int64_t GetVirtualTransactionSize(int64_t nSize, int64_t nSigOpCount, unsigned int bytes_per_sigop) { return nSize; } -int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCost, +int64_t GetVirtualTransactionSize(const CTransaction &tx, int64_t nSigOpCount, unsigned int bytes_per_sigop) { return GetVirtualTransactionSize(::GetSerializeSize(tx, PROTOCOL_VERSION), - nSigOpCost, bytes_per_sigop); + nSigOpCount, bytes_per_sigop); } -int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCost, +int64_t GetVirtualTransactionInputSize(const CTxIn &txin, int64_t nSigOpCount, unsigned int bytes_per_sigop) { return GetVirtualTransactionSize(::GetSerializeSize(txin, PROTOCOL_VERSION), - nSigOpCost, bytes_per_sigop); + nSigOpCount, bytes_per_sigop); } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -395,8 +395,8 @@ "key is not present, fee is unknown and clients MUST NOT assume " "there isn't one\n" " \"sigops\" : n, (numeric) total SigOps " - "cost, as counted for purposes of block limits; if key is not " - "present, sigop cost is unknown and clients MUST NOT assume it is " + "count, as counted for purposes of block limits; if key is not " + "present, sigop count is unknown and clients MUST NOT assume it is " "zero\n" " \"required\" : true|false (boolean) if provided and " "true, this transaction must be in the final block\n" diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -371,7 +371,7 @@ g_mempool.addUnchecked(txid, entry.Fee(LOWFEE) .Time(GetTime()) .SpendsCoinbase(spendsCoinbase) - .SigOpsCost(80) + .SigOpCount(20) .FromTx(tx)); tx.vin[0].prevout = COutPoint(txid, 0); } diff --git a/src/test/sigopcount_tests.cpp b/src/test/sigopcount_tests.cpp --- a/src/test/sigopcount_tests.cpp +++ b/src/test/sigopcount_tests.cpp @@ -153,10 +153,10 @@ AddCoins(coins, CTransaction(creationTx), 0); } -BOOST_AUTO_TEST_CASE(GetTxSigOpCost) { +BOOST_AUTO_TEST_CASE(GetTxSigOpCount) { // Transaction creates outputs CMutableTransaction creationTx; - // Transaction that spends outputs and whose sig op cost is going to be + // Transaction that spends outputs and whose sig op count is going to be // tested CMutableTransaction spendingTx; 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 @@ -123,11 +123,11 @@ int64_t nTime; unsigned int nHeight; bool spendsCoinbase; - unsigned int sigOpCost; + unsigned int nSigOpCount; LockPoints lp; TestMemPoolEntryHelper() - : nFee(), nTime(0), nHeight(1), spendsCoinbase(false), sigOpCost(4) {} + : nFee(), nTime(0), nHeight(1), spendsCoinbase(false), nSigOpCount(1) {} CTxMemPoolEntry FromTx(const CMutableTransaction &tx); CTxMemPoolEntry FromTx(const CTransactionRef &tx); @@ -149,8 +149,8 @@ spendsCoinbase = _flag; return *this; } - TestMemPoolEntryHelper &SigOpsCost(unsigned int _sigopsCost) { - sigOpCost = _sigopsCost; + TestMemPoolEntryHelper &SigOpCount(unsigned int _nSigOpCount) { + nSigOpCount = _nSigOpCount; return *this; } }; diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -207,8 +207,8 @@ } CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef &tx) { - return CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, sigOpCost, - lp); + return CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, + nSigOpCount, lp); } /** diff --git a/src/txmempool.h b/src/txmempool.h --- a/src/txmempool.h +++ b/src/txmempool.h @@ -107,7 +107,7 @@ public: CTxMemPoolEntry(const CTransactionRef &_tx, const Amount _nFee, int64_t _nTime, unsigned int _entryHeight, - bool spendsCoinbase, int64_t nSigOpsCost, LockPoints lp); + bool spendsCoinbase, int64_t _nSigOpCount, LockPoints lp); const CTransaction &GetTx() const { return *this->tx; } CTransactionRef GetSharedTx() const { return this->tx; } @@ -169,20 +169,20 @@ struct update_ancestor_state { update_ancestor_state(int64_t _modifySize, Amount _modifyFee, - int64_t _modifyCount, int64_t _modifySigOpsCost) + int64_t _modifyCount, int64_t _modifySigOpCount) : modifySize(_modifySize), modifyFee(_modifyFee), - modifyCount(_modifyCount), modifySigOpsCost(_modifySigOpsCost) {} + modifyCount(_modifyCount), modifySigOpCount(_modifySigOpCount) {} void operator()(CTxMemPoolEntry &e) { e.UpdateAncestorState(modifySize, modifyFee, modifyCount, - modifySigOpsCost); + modifySigOpCount); } private: int64_t modifySize; Amount modifyFee; int64_t modifyCount; - int64_t modifySigOpsCost; + int64_t modifySigOpCount; }; struct update_fee_delta {