Skip to content

Commit a278764

Browse files
committed
FIX: Account for txs already added to block in addPriorityTxs
1 parent 4dc94d1 commit a278764

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/miner.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam
7474
BlockAssembler::BlockAssembler(const CChainParams& _chainparams)
7575
: chainparams(_chainparams)
7676
{
77-
// Largest block you're willing to create:
77+
// Largest block you're willing to create:
7878
nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE);
7979
// Limit to between 1K and MAX_BLOCK_SIZE-1K for sanity:
8080
nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize));
@@ -262,6 +262,11 @@ void BlockAssembler::addScoreTxs()
262262
clearedTxs.pop();
263263
}
264264

265+
// If tx already in block, skip (added by addPriorityTxs)
266+
if (inBlock.count(iter)) {
267+
continue;
268+
}
269+
265270
// If tx is dependent on other mempool txs which haven't yet been included
266271
// then put it in the waitSet
267272
if (isStillDependent(iter)) {

0 commit comments

Comments
 (0)