Skip to content

Commit

Permalink
validate and correctly format scriptpubkey data for Opreturn
Browse files Browse the repository at this point in the history
  • Loading branch information
webworker01 committed Jun 5, 2022
1 parent bd137b9 commit 7c15411
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Komodo/Opreturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7c15411

Please sign in to comment.