Refactor peer flag removal logic

This commit is contained in:
netkas 2024-10-31 19:09:13 -04:00
parent 8e1f6351e2
commit e328a8c5e0
2 changed files with 17 additions and 10 deletions

View file

@ -104,6 +104,15 @@ class RegisteredPeerRecord implements SerializableInterface
return in_array($flag, $this->flags, true);
}
public function removeFlag(PeerFlags $flag): void
{
$key = array_search($flag, $this->flags, true);
if($key !== false)
{
unset($this->flags[$key]);
}
}
/**
* Checks if the current instance is enabled.
*