From f6cb2a4191852ab7d506e3e27e0217c0c7b698b0 Mon Sep 17 00:00:00 2001 From: kvazar-network Date: Mon, 21 Apr 2025 16:40:51 +0300 Subject: [PATCH] fix state update issue, define global path constants, reorganize state getter --- src/index.php | 60 ++++++++++++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/src/index.php b/src/index.php index 36a913c..8d73697 100644 --- a/src/index.php +++ b/src/index.php @@ -1,13 +1,16 @@ index->driver) @@ -123,7 +133,7 @@ if (isset($argv[1])) ); file_put_contents( - __DIR__ . '/../.state', + STATE, 0 ); @@ -161,7 +171,7 @@ while (true) if ($blocks = $kevacoin->getBlockCount()) { // Begin block index - for ($block = $state + 1; $block <= $blocks; $block++) + for ($block = state() + 1; $block <= $blocks; $block++) { // Debug progress printf( @@ -405,7 +415,7 @@ while (true) // Update current block state file_put_contents( - __DIR__ . '/../.state', + STATE, $block ); }