Frontport commits from beta to master (#2743)

* Remove count limit for local transactions (#2634)

* Fixed stalled sync
This commit is contained in:
Arkadiy Paronyan 2016-10-20 00:33:00 +02:00 committed by GitHub
parent 3b8247b631
commit 20e1d575da
2 changed files with 4 additions and 4 deletions

View File

@ -361,9 +361,9 @@ impl TransactionSet {
let r = gas.overflowing_add(order.gas); let r = gas.overflowing_add(order.gas);
if r.1 { return false } if r.1 { return false }
gas = r.0; gas = r.0;
// Own and retracted transactions are allowed to go above the gas limit, bot not above the count limit. // Own and retracted transactions are allowed to go above all limits.
(gas > self.gas_limit && order.origin != TransactionOrigin::Local && order.origin != TransactionOrigin::RetractedBlock) || order.origin != TransactionOrigin::Local && order.origin != TransactionOrigin::RetractedBlock &&
count > self.limit (gas > self.gas_limit || count > self.limit)
}) })
.map(|order| by_hash.get(&order.hash) .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`.")) .expect("All transactions in `self.by_priority` and `self.by_address` are kept in sync with `by_hash`."))

View File

@ -1058,7 +1058,7 @@ impl ChainSync {
} }
let have_latest = io.chain().block_status(BlockID::Hash(peer_latest)) != BlockStatus::Unknown; 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 // check if got new blocks to download
if let Some(request) = self.new_blocks.request_blocks(io) { if let Some(request) = self.new_blocks.request_blocks(io) {
self.request_blocks(io, peer_id, request, BlockSet::NewBlocks); self.request_blocks(io, peer_id, request, BlockSet::NewBlocks);