From 20e1d575dad3558a4a19fa7944ea463266351238 Mon Sep 17 00:00:00 2001 From: Arkadiy Paronyan Date: Thu, 20 Oct 2016 00:33:00 +0200 Subject: [PATCH] Frontport commits from beta to master (#2743) * Remove count limit for local transactions (#2634) * Fixed stalled sync --- ethcore/src/miner/transaction_queue.rs | 6 +++--- sync/src/chain.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethcore/src/miner/transaction_queue.rs b/ethcore/src/miner/transaction_queue.rs index 9e47a8467..1adbd3a62 100644 --- a/ethcore/src/miner/transaction_queue.rs +++ b/ethcore/src/miner/transaction_queue.rs @@ -361,9 +361,9 @@ impl TransactionSet { let r = gas.overflowing_add(order.gas); if r.1 { return false } gas = r.0; - // Own and retracted transactions are allowed to go above the gas limit, bot not above the count limit. - (gas > self.gas_limit && order.origin != TransactionOrigin::Local && order.origin != TransactionOrigin::RetractedBlock) || - count > self.limit + // Own and retracted transactions are allowed to go above all limits. + order.origin != TransactionOrigin::Local && order.origin != TransactionOrigin::RetractedBlock && + (gas > self.gas_limit || count > self.limit) }) .map(|order| by_hash.get(&order.hash) .expect("All transactions in `self.by_priority` and `self.by_address` are kept in sync with `by_hash`.")) diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 16039dcff..a97ce4ef8 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -1058,7 +1058,7 @@ impl ChainSync { } let have_latest = io.chain().block_status(BlockID::Hash(peer_latest)) != BlockStatus::Unknown; - if !have_latest && higher_difficulty { + if !have_latest && (higher_difficulty || force) { // check if got new blocks to download if let Some(request) = self.new_blocks.request_blocks(io) { self.request_blocks(io, peer_id, request, BlockSet::NewBlocks);