diff --git a/src/Komodo/Opreturn.php b/src/Komodo/Opreturn.php index acab749..25a797f 100644 --- a/src/Komodo/Opreturn.php +++ b/src/Komodo/Opreturn.php @@ -37,8 +37,14 @@ public function __construct($shortForm = '') {} * @param String hex from script pubkey * @return (Array|false) Notarization data or not */ - function decode($scriptPubKeyBinary) + function decode($scriptPubKeyHex) { + if ( !ctype_xdigit($scriptPubKeyHex)) { + return false; + } + + $scriptPubKeyBinary = pack("H*", $scriptPubKeyHex); + $length_with_mom = 72; $length_no_mom = 36;