Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Fix rebroadcast panic beta #4085

Merged
merged 7 commits into from
Jan 9, 2017
Merged

Fix rebroadcast panic beta #4085

merged 7 commits into from
Jan 9, 2017

Conversation

keorn
Copy link

@keorn keorn commented Jan 8, 2017

No description provided.

@keorn keorn added A0-pleasereview 🤓 Pull request needs code review. B0-patch M4-core ⛓ Core client code / Rust. labels Jan 8, 2017
@gavofyork gavofyork added A8-looksgood 🦄 Pull request is reviewed well. A8-backport 🕸 Pull request is already reviewed well in another branch. and removed A0-pleasereview 🤓 Pull request needs code review. A8-looksgood 🦄 Pull request is reviewed well. labels Jan 8, 2017
@rphmeier rphmeier removed the B0-patch label Jan 8, 2017
peer_info.last_sent_transactions.clear()
});
}
if !is_syncing && !enacted.is_empty() && self.peers.is_empty() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be !self.peers.is_empty() ?

// Select random peer to re-broadcast transactions to.
let peer = random::new().get_rng(0, self.peers.len());
trace!(target: "sync", "Re-broadcasting transactions to random peer.");
self.peers.get_mut(peer).map(|mut peer_info|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think PeerIds are not bound to self.peers.len(), it could be arbitrary usize, so most of the time this will not clear any peer.

@arkpar arkpar merged commit c0fcfaa into beta Jan 9, 2017
@arkpar arkpar deleted the fix-rebroadcast-beta branch January 10, 2017 11:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-backport 🕸 Pull request is already reviewed well in another branch. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants