Browse Source

fix namespace alias index

main
ghost 9 months ago
parent
commit
a760ab1988
  1. 37
      src/index.php

37
src/index.php

@ -305,16 +305,45 @@ for ($block = $state + 1; $block <= $blocks; $block++)
false false
); );
// Find all data by namespace // Find natively decoded data in block by namespace
foreach ((array) $kevacoin->kevaFilter( // @TODO complete \Kvazar\Crypto\Kevacoin to decode tx faster // https://github.com/kvazar-network/crawler/issues/1
// @TODO complete \Kvazar\Crypto\Kevacoin to decode tx faster
foreach ((array) $kevacoin->kevaFilter(
$namespace $namespace
) as $record) ) as $record)
{ {
if ( if (
// Get current block transactions only // Filter current block only
$record['height'] === $block $record['height'] === $block
&& &&
// Skip processed transactions for this namespace // Skip processed transaction
!in_array($record['txid'], $transactions)
) {
// Register new transaction
$index->add(
$raw['time'],
$raw['size'],
$block,
$namespace,
$record['txid'],
$asm[0],
$record['key'],
$record['value']
);
// Register processed transaction
$transactions[] = $record['txid'];
}
}
// Find namespace alias (not always return by kevaFilter)
if ($record = $kevacoin->kevaGet($namespace, '_KEVA_NS_'))
{
if (
// Filter current block only
$record['height'] === $block
&&
// Skip processed transaction
!in_array($record['txid'], $transactions) !in_array($record['txid'], $transactions)
) { ) {
// Register new transaction // Register new transaction

Loading…
Cancel
Save