Merge pull request #3796 from ethcore/tx-broadcast

Avoid broadcasting transactions to peers that send them
This commit is contained in:
Gav Wood
2016-12-12 04:13:56 +01:00
committed by GitHub
15 changed files with 119 additions and 72 deletions

View File

@@ -105,13 +105,13 @@ impl SyncProvider for TestSyncProvider {
first_seen: 10,
propagated_to: map![
128.into() => 16
]
],
},
5.into() => TransactionStats {
first_seen: 16,
propagated_to: map![
16.into() => 1
]
],
}
]
}

View File

@@ -157,7 +157,7 @@ impl From<SyncTransactionStats> for TransactionStats {
propagated_to: s.propagated_to
.into_iter()
.map(|(id, count)| (id.into(), count))
.collect()
.collect(),
}
}
}
@@ -208,7 +208,7 @@ mod tests {
first_seen: 100,
propagated_to: map![
10.into() => 50
]
],
};
let serialized = serde_json::to_string(&stats).unwrap();