mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
This commit is contained in:
16
src/miner.h
16
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,
|
||||
|
Reference in New Issue
Block a user