NetDB: Don't say we stored, and don't flood, if we're shutting down

This commit is contained in:
dg2-new
2015-06-20 10:06:54 +00:00
parent c6896c4418
commit 699d550992
2 changed files with 4 additions and 1 deletions

View File

@ -1,5 +1,6 @@
2015-06-20 dg
* I2PSnark: Auto-start now only starts torrents which were running at shutdown (#766)
* NetDB: Don't say we stored, and don't flood, if we're shutting down
2015-06-19 zzz
* I2CP: Fix simple session lookups, broken in prop
@ -37,6 +38,7 @@ Prop from i2p.i2p.zzz.multisess:
- Improve routing of DatabaseStoreMessage acks
- Send our own RI unsolicited in reply if we aren't floodfill
- Don't ack or flood a store of an unknown type
- Don't say we stored, and don't flood if we're shutting down
* PeerTestJob: Don't generate zero reply token
* Timestamper: Reduce NTP timeouts to shorten startup time
when NTP is blocked

View File

@ -216,6 +216,7 @@ public class HandleFloodfillDatabaseStoreMessageJob extends JobImpl {
// flood it
if (invalidMessage == null &&
getContext().netDb().floodfillEnabled() &&
!getContext().router().gracefulShutdownInProgress() &&
_message.getReplyToken() > 0) {
if (wasNew) {
// DOS prevention
@ -251,7 +252,7 @@ public class HandleFloodfillDatabaseStoreMessageJob extends JobImpl {
TunnelId replyTunnel = _message.getReplyTunnel();
// A store of our own RI, only if we are not FF
DatabaseStoreMessage msg2;
if (getContext().netDb().floodfillEnabled() ||
if ((getContext().netDb().floodfillEnabled() && !getContext().router().gracefulShutdownInProgress()) ||
storedKey.equals(getContext().routerHash())) {
// don't send our RI if the store was our RI (from PeerTestJob)
msg2 = null;