aboutsummaryrefslogtreecommitdiff
path: root/src/miner.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-03-30 20:53:31 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2017-03-30 20:55:29 +0200
commitcde9b1a864c1743b0a20f914028e53df12a70906 (patch)
treed8fdd5f99df3050518b8d59f1ab7258b50107964 /src/miner.h
parent8ac80412867118172dc4172494304e19969e9489 (diff)
parent011124a2b278c5a60bad5f1b0b4abbf7ebc95aa0 (diff)
downloadbitcoin-cde9b1a864c1743b0a20f914028e53df12a70906.tar.xz
Merge #9959: Mining: Prevent slowdown in CreateNewBlock on large mempools
011124a Update benchmarking with package statistics (Suhas Daftuar) 42cd8c8 Add benchmarking for CreateNewBlock (Suhas Daftuar) eed816a Mining: return early when block is almost full (Suhas Daftuar) Tree-SHA512: c0d8f71e4e0441acf3f4ca12f8705e413b59b323659346a447145653def71710537fb4c6d80cad8e36d68b0aabf19c92e9eab7135a8897b053ed58720856cdda
Diffstat (limited to 'src/miner.h')
-rw-r--r--src/miner.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/miner.h b/src/miner.h
index a159b05534..1f3c9d652f 100644
--- a/src/miner.h
+++ b/src/miner.h
@@ -180,8 +180,10 @@ private:
void AddToBlock(CTxMemPool::txiter iter);
// Methods for how to add transactions to a block.
- /** Add transactions based on feerate including unconfirmed ancestors */
- void addPackageTxs();
+ /** Add transactions based on feerate including unconfirmed ancestors
+ * Increments nPackagesSelected / nDescendantsUpdated with corresponding
+ * statistics from the package selection (for logging statistics). */
+ void addPackageTxs(int &nPackagesSelected, int &nDescendantsUpdated);
// helper functions for addPackageTxs()
/** Remove confirmed (inBlock) entries from given set */
@@ -199,8 +201,9 @@ private:
/** Sort the package in an order that is valid to appear in a block */
void SortForBlock(const CTxMemPool::setEntries& package, CTxMemPool::txiter entry, std::vector<CTxMemPool::txiter>& sortedEntries);
/** Add descendants of given transactions to mapModifiedTx with ancestor
- * state updated assuming given transactions are inBlock. */
- void UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set &mapModifiedTx);
+ * state updated assuming given transactions are inBlock. Returns number
+ * of updated descendants. */
+ int UpdatePackagesForAdded(const CTxMemPool::setEntries& alreadyAdded, indexed_modified_transaction_set &mapModifiedTx);
};
/** Modify the extranonce in a block */