diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-01-03 18:54:50 +0100 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-06-22 15:43:00 +0200 |
commit | 2b1f6f9ccf36f1e0a2c9d99154e1642f796d7c2b (patch) | |
tree | 30b17fa55ea6c9ae0055c0c16d2e271a0c799d16 /src/miner.h | |
parent | 7c4bf779e8b74e474551982a24f5acc265293abd (diff) |
BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
Diffstat (limited to 'src/miner.h')
-rw-r--r-- | src/miner.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/miner.h b/src/miner.h index 8bfc1493db..b303a8fa3c 100644 --- a/src/miner.h +++ b/src/miner.h @@ -28,7 +28,7 @@ struct CBlockTemplate { CBlock block; std::vector<CAmount> vTxFees; - std::vector<int64_t> vTxSigOps; + std::vector<int64_t> vTxSigOpsCost; std::vector<unsigned char> vchCoinbaseCommitment; }; @@ -40,13 +40,13 @@ struct CTxMemPoolModifiedEntry { iter = entry; nSizeWithAncestors = entry->GetSizeWithAncestors(); nModFeesWithAncestors = entry->GetModFeesWithAncestors(); - nSigOpCountWithAncestors = entry->GetSigOpCountWithAncestors(); + nSigOpCostWithAncestors = entry->GetSigOpCostWithAncestors(); } CTxMemPool::txiter iter; uint64_t nSizeWithAncestors; CAmount nModFeesWithAncestors; - unsigned int nSigOpCountWithAncestors; + int64_t nSigOpCostWithAncestors; }; /** Comparator for CTxMemPool::txiter objects. @@ -124,7 +124,7 @@ struct update_for_parent_inclusion { e.nModFeesWithAncestors -= iter->GetFee(); e.nSizeWithAncestors -= iter->GetTxSize(); - e.nSigOpCountWithAncestors -= iter->GetSigOpCount(); + e.nSigOpCostWithAncestors -= iter->GetSigOpCost(); } CTxMemPool::txiter iter; @@ -141,12 +141,14 @@ private: // Configuration parameters for the block size bool fIncludeWitness; - unsigned int nBlockMaxSize, nBlockMinSize; + unsigned int nBlockMaxCost, nBlockMaxSize, nBlockMinSize; + bool fNeedSizeAccounting; // Information on the current status of the block + uint64_t nBlockCost; uint64_t nBlockSize; uint64_t nBlockTx; - unsigned int nBlockSigOps; + uint64_t nBlockSigOpsCost; CAmount nFees; CTxMemPool::setEntries inBlock; @@ -189,7 +191,7 @@ private: /** 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, unsigned int packageSigOps); + bool TestPackage(uint64_t packageSize, int64_t packageSigOpsCost); /** Test if a set of transactions are all final */ bool TestPackageFinality(const CTxMemPool::setEntries& package); /** Return true if given transaction from mapTx has already been evaluated, |