Update findblock.php
Try-Catch any exception thrown from `getblockhash` for safety.
This commit is contained in:
parent
15c7c02268
commit
94d67b3013
@ -29,7 +29,11 @@ require_once('shared.inc.php');
|
||||
$aLastBlock = @$block->getLastValid();
|
||||
$strLastBlockHash = $aLastBlock['blockhash'];
|
||||
if (!$strLastBlockHash) {
|
||||
$strLastBlockHash = $bitcoin->getblockhash(1);
|
||||
try {
|
||||
$strLastBlockHash = $bitcoin->getblockhash(1);
|
||||
} catch (Exception $e) {
|
||||
$strLastBlockHash = "";
|
||||
}
|
||||
}
|
||||
|
||||
// Fetch all transactions since our last block
|
||||
|
||||
Loading…
Reference in New Issue
Block a user