fix underflow in pip, closes #10419 (#10423)

This commit is contained in:
Marek Kotewicz 2019-02-27 10:08:04 +01:00 committed by GitHub
parent fefec000fb
commit 94cb3b6e0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -533,6 +533,9 @@ impl LightProtocol {
// the timer approach will skip 1 (possibly 2) in rare occasions.
if peer_info.sent_head == announcement.head_hash ||
peer_info.status.head_num >= announcement.head_num ||
// fix for underflow reported in
// https://github.com/paritytech/parity-ethereum/issues/10419
now < peer_info.last_update ||
now - peer_info.last_update < UPDATE_INTERVAL {
continue
}