Skip to content

Commit cca0179

Browse files
authored
Merge pull request #2605 from shtse8/master
Update findblock.php
2 parents 79c09bd + 94d67b3 commit cca0179

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cronjobs/findblock.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@
2828
// Fetch our last block found from the DB as a starting point
2929
$aLastBlock = @$block->getLastValid();
3030
$strLastBlockHash = $aLastBlock['blockhash'];
31-
if (!$strLastBlockHash) $strLastBlockHash = '';
31+
if (!$strLastBlockHash) {
32+
try {
33+
$strLastBlockHash = $bitcoin->getblockhash(1);
34+
} catch (Exception $e) {
35+
$strLastBlockHash = "";
36+
}
37+
}
3238

3339
// Fetch all transactions since our last block
3440
if ( $bitcoin->can_connect() === true ){

0 commit comments

Comments
 (0)