Add Blacklist::checkAddress() method

This commit is contained in:
pxgamer
2018-09-14 15:45:51 +01:00
parent 843d1d0fef
commit 6483f377b5

View File

@@ -17,6 +17,14 @@ final class Blacklist
// phpcs:enable // 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 * Check if a public key is blacklisted
* *
@@ -27,4 +35,15 @@ final class Blacklist
{ {
return key_exists($publicKey, static::PUBLIC_KEYS); 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);
}
} }