mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 15:20:24 +01:00
Merge pull request #1220 from TheBlueMatt/2021-12-stale-update-gossip-log
Log gossip rejections due to stale channel_updates at GOSSIP level
This commit is contained in:
commit
3ca63426f9
1 changed files with 2 additions and 2 deletions
|
@ -1170,10 +1170,10 @@ impl NetworkGraph {
|
||||||
// disable this check during tests!
|
// disable this check during tests!
|
||||||
let time = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time must be > 1970").as_secs();
|
let time = SystemTime::now().duration_since(UNIX_EPOCH).expect("Time must be > 1970").as_secs();
|
||||||
if (msg.timestamp as u64) < time - STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS {
|
if (msg.timestamp as u64) < time - STALE_CHANNEL_UPDATE_AGE_LIMIT_SECS {
|
||||||
return Err(LightningError{err: "channel_update is older than two weeks old".to_owned(), action: ErrorAction::IgnoreError});
|
return Err(LightningError{err: "channel_update is older than two weeks old".to_owned(), action: ErrorAction::IgnoreAndLog(Level::Gossip)});
|
||||||
}
|
}
|
||||||
if msg.timestamp as u64 > time + 60 * 60 * 24 {
|
if msg.timestamp as u64 > time + 60 * 60 * 24 {
|
||||||
return Err(LightningError{err: "channel_update has a timestamp more than a day in the future".to_owned(), action: ErrorAction::IgnoreError});
|
return Err(LightningError{err: "channel_update has a timestamp more than a day in the future".to_owned(), action: ErrorAction::IgnoreAndLog(Level::Gossip)});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue