Removes redundant mut in sync
This commit is contained in:
@@ -459,7 +459,7 @@ impl ChainSync {
|
||||
|
||||
/// Updates transactions were received by a peer
|
||||
pub fn transactions_received(&mut self, hashes: Vec<H256>, peer_id: PeerId) {
|
||||
if let Some(mut peer_info) = self.peers.get_mut(&peer_id) {
|
||||
if let Some(peer_info) = self.peers.get_mut(&peer_id) {
|
||||
peer_info.last_sent_transactions.extend(&hashes);
|
||||
}
|
||||
}
|
||||
@@ -730,7 +730,7 @@ impl ChainSync {
|
||||
}
|
||||
|
||||
let result = {
|
||||
let mut downloader = match block_set {
|
||||
let downloader = match block_set {
|
||||
BlockSet::NewBlocks => &mut self.new_blocks,
|
||||
BlockSet::OldBlocks => {
|
||||
match self.old_blocks {
|
||||
@@ -795,7 +795,7 @@ impl ChainSync {
|
||||
else
|
||||
{
|
||||
let result = {
|
||||
let mut downloader = match block_set {
|
||||
let downloader = match block_set {
|
||||
BlockSet::NewBlocks => &mut self.new_blocks,
|
||||
BlockSet::OldBlocks => match self.old_blocks {
|
||||
None => {
|
||||
@@ -849,7 +849,7 @@ impl ChainSync {
|
||||
else
|
||||
{
|
||||
let result = {
|
||||
let mut downloader = match block_set {
|
||||
let downloader = match block_set {
|
||||
BlockSet::NewBlocks => &mut self.new_blocks,
|
||||
BlockSet::OldBlocks => match self.old_blocks {
|
||||
None => {
|
||||
@@ -2186,7 +2186,7 @@ impl ChainSync {
|
||||
// Select random peer to re-broadcast transactions to.
|
||||
let peer = random::new().gen_range(0, self.peers.len());
|
||||
trace!(target: "sync", "Re-broadcasting transactions to a random peer.");
|
||||
self.peers.values_mut().nth(peer).map(|mut peer_info|
|
||||
self.peers.values_mut().nth(peer).map(|peer_info|
|
||||
peer_info.last_sent_transactions.clear()
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user