11<?php
22namespace App \Console \Commands ;
33
4+ use DateTime ;
5+ use DateTimeZone ;
6+ use Exception ;
7+ use InvalidArgumentException ;
8+ use PDO ;
9+ use RedisException ;
10+ use Throwable ;
11+
412use App \Models \Address ;
513use App \Models \Block ;
6-
714use App \Models \Claim ;
815use App \Models \ClaimStream ;
916use App \Models \Input ;
1017use App \Models \Output ;
1118use App \Models \Transaction ;
12- use Carbon \Carbon ;
13- use DateTime ;
14- use DateTimeZone ;
15- use Exception ;
19+
1620use Illuminate \Console \Command ;
1721use Illuminate \Support \Facades \Cache ;
18-
1922use Illuminate \Support \Facades \DB ;
2023use Illuminate \Support \Facades \Redis ;
21- use InvalidArgumentException ;
24+
2225use Mdanter \Ecc \EccFactory ;
23- use PDO ;
24- use RedisException ;
25- use Throwable ;
2626
2727class BlockCommand extends Command{
2828
@@ -47,16 +47,13 @@ class BlockCommand extends Command{
4747 */
4848 protected $ signature = 'explorer:block {function?} ' ;
4949
50- public function __construct (){
51- parent ::__construct ();
52- self ::$ redis = Redis::connection ()->client ();
53- self ::$ rpcurl = config ('lbry.rpc_url ' );
54- }
55-
5650 /**
5751 * Execute the console command.
5852 */
5953 public function handle (): void {
54+ self ::$ redis = Redis::connection ()->client ();
55+ self ::$ rpcurl = config ('lbry.rpc_url ' );
56+
6057 $ function = $ this ->argument ('function ' );
6158 if ($ function ){
6259 $ this ->$ function ();
@@ -1131,7 +1128,6 @@ public function parsenewblocks(): void{
11311128 self ::lock ('parsenewblocks ' );
11321129
11331130 echo "Parsing new blocks... \n" ;
1134- self ::$ redis = Redis::connection ()->client ();
11351131 try {
11361132 // Get the best block hash
11371133 $ req = ['method ' => 'getbestblockhash ' , 'params ' => [],'id ' =>rand ()];
0 commit comments