From 6483f377b58d19f12c1ef1fc4e97c400274f11c1 Mon Sep 17 00:00:00 2001 From: pxgamer Date: Fri, 14 Sep 2018 15:45:51 +0100 Subject: [PATCH] Add Blacklist::checkAddress() method --- include/Blacklist.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/Blacklist.php b/include/Blacklist.php index 0545778..ad7e0d6 100644 --- a/include/Blacklist.php +++ b/include/Blacklist.php @@ -17,6 +17,14 @@ final class Blacklist // phpcs:enable ]; + /** + * The official list of blacklisted addresses + */ + public const ADDRESSES = [ + // phpcs:disable Generic.Files.LineLength + // phpcs:enable + ]; + /** * Check if a public key is blacklisted * @@ -27,4 +35,15 @@ final class Blacklist { return key_exists($publicKey, static::PUBLIC_KEYS); } + + /** + * Check if an address is blacklisted + * + * @param string $address + * @return bool + */ + public static function checkAddress(string $address): bool + { + return key_exists($address, static::ADDRESSES); + } }