Skip to content

Commit

Permalink
Do not add Address.init to banned or whitelisted
Browse files Browse the repository at this point in the history
Currently rpc is using Address.init for the address as is unknown. It is
better we do not add to `whitelisted` or `banned`.
  • Loading branch information
hewison-chris authored and Geod24 committed Nov 11, 2021
1 parent bea6fa5 commit 2392ff5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/agora/common/BanManager.d
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ public class BanManager

public void banUntil (Address address, TimePoint banned_until) @safe nothrow
{
if (this.isWhitelisted(address))
return; // Whitelisted address
if (address is Address.init || this.isWhitelisted(address))
return; // no address or Whitelisted address

log.info("BanManager: Address {} banned until {}", address, banned_until);
try
Expand Down Expand Up @@ -304,6 +304,9 @@ public class BanManager

public void whitelist (Address address) @safe nothrow
{
if (address is Address.init)
return;

this.whitelisted.put(address);
this.storeWhitelisted(address);
}
Expand Down

0 comments on commit 2392ff5

Please sign in to comment.