Skip to content

Commit

Permalink
close matcher connections faster
Browse files Browse the repository at this point in the history
  • Loading branch information
deemru committed Jun 25, 2024
1 parent 873ac7e commit 40e1d0d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,11 +1092,13 @@ function w8io_tv_string( $t, $v )
else
if( $address === 'o' && $f !== false )
{
if( strlen( $f ) >= 32 )
if( strlen( $f ) >= 32 && 32 === strlen( wk()->base58Decode( $f ) ) )
{
prolog();
wk()->setNodeAddress( W8IO_MATCHER );
$json = wk()->fetch( '/matcher/transactions/' . $f );
$matcher = clone wk();
$matcher->setNodeAddress( W8IO_MATCHER );
$json = $matcher->fetch( '/matcher/transactions/' . $f );
unset( $matcher );
if( $json === false || false === ( $json = wk()->json_decode( $json ) ) )
echo json_encode( [ 'error' => "fetch( /matcher/transactions/$f ) failed" ], JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES );
else
Expand Down

0 comments on commit 40e1d0d

Please sign in to comment.