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 sigOpCount = 1; LockPoints lp; pool.addUnchecked(tx->GetId(), CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, - sigOpCost, lp)); + sigOpCount, 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/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 packageSigOps) const; /** * Perform checks on each transaction in a package: * locktime, serialized size (if necessary). These checks should always 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) + .SigOps(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,7 +153,7 @@ 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 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 sigOpCount; LockPoints lp; TestMemPoolEntryHelper() - : nFee(), nTime(0), nHeight(1), spendsCoinbase(false), sigOpCost(4) {} + : nFee(), nTime(0), nHeight(1), spendsCoinbase(false), sigOpCount(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 &SigOps(unsigned int _sigops) { + sigOpCount = _sigops; 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,7 +207,7 @@ } CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(const CTransactionRef &tx) { - return CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, sigOpCost, + return CTxMemPoolEntry(tx, nFee, nTime, nHeight, spendsCoinbase, sigOpCount, 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 _sigOpCount, LockPoints lp); const CTransaction &GetTx() const { return *this->tx; } CTransactionRef GetSharedTx() const { return this->tx; } @@ -169,20 +169,19 @@ struct update_ancestor_state { update_ancestor_state(int64_t _modifySize, Amount _modifyFee, - int64_t _modifyCount, int64_t _modifySigOpsCost) + int64_t _modifyCount, int64_t _modifySigOps) : modifySize(_modifySize), modifyFee(_modifyFee), - modifyCount(_modifyCount), modifySigOpsCost(_modifySigOpsCost) {} + modifyCount(_modifyCount), modifySigOps(_modifySigOps) {} void operator()(CTxMemPoolEntry &e) { - e.UpdateAncestorState(modifySize, modifyFee, modifyCount, - modifySigOpsCost); + e.UpdateAncestorState(modifySize, modifyFee, modifyCount, modifySigOps); } private: int64_t modifySize; Amount modifyFee; int64_t modifyCount; - int64_t modifySigOpsCost; + int64_t modifySigOps; }; struct update_fee_delta { diff --git a/src/txmempool.cpp b/src/txmempool.cpp --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -27,11 +27,10 @@ CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef &_tx, const Amount _nFee, int64_t _nTime, unsigned int _entryHeight, - bool _spendsCoinbase, int64_t _sigOpsCount, + bool _spendsCoinbase, int64_t _sigOpCount, LockPoints lp) : tx(_tx), nFee(_nFee), nTime(_nTime), entryHeight(_entryHeight), - spendsCoinbase(_spendsCoinbase), sigOpCount(_sigOpsCount), - lockPoints(lp) { + spendsCoinbase(_spendsCoinbase), sigOpCount(_sigOpCount), lockPoints(lp) { nTxSize = tx->GetTotalSize(); nUsageSize = RecursiveDynamicUsage(tx);