diff options
author | Alex Morcos <morcos@chaincode.com> | 2016-05-24 14:23:15 -0400 |
---|---|---|
committer | Alex Morcos <morcos@chaincode.com> | 2016-05-24 15:01:14 -0400 |
commit | a27876474819ffff80614f966fea06d5da2d5c15 (patch) | |
tree | ae4cc097a99dc4f8904596b0d9f4107dbf3ebf27 | |
parent | 4dc94d1036576fe988a066fdabc047350ccddda9 (diff) |
FIX: Account for txs already added to block in addPriorityTxs
-rw-r--r-- | src/miner.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/miner.cpp b/src/miner.cpp index 91e05f9ce4..1eab8f949d 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -74,7 +74,7 @@ int64_t UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParam BlockAssembler::BlockAssembler(const CChainParams& _chainparams) : chainparams(_chainparams) { - // Largest block you're willing to create: + // Largest block you're willing to create: nBlockMaxSize = GetArg("-blockmaxsize", DEFAULT_BLOCK_MAX_SIZE); // Limit to between 1K and MAX_BLOCK_SIZE-1K for sanity: nBlockMaxSize = std::max((unsigned int)1000, std::min((unsigned int)(MAX_BLOCK_SIZE-1000), nBlockMaxSize)); @@ -262,6 +262,11 @@ void BlockAssembler::addScoreTxs() clearedTxs.pop(); } + // If tx already in block, skip (added by addPriorityTxs) + if (inBlock.count(iter)) { + continue; + } + // If tx is dependent on other mempool txs which haven't yet been included // then put it in the waitSet if (isStillDependent(iter)) { |