diff --git a/collector/collector.pl b/collector/collector.pl index 441b8b96e38c0c7e48705148089cd1d4f16d08aa..77966456eb62a25a3bad2f007fa060d1badc9a6d 100755 --- a/collector/collector.pl +++ b/collector/collector.pl @@ -165,7 +165,7 @@ sub getTransByHash 'eth_getTransactionByHash', $hash ); - die "Invalid object received:\n".Dumper($json) if not exists $json->{'number'}; + die "Invalid object received when asking for $hash:\n".Dumper($json) if not exists $json->{'blockNumber'}; my $max = 0; my $rcpt = undef; do { @@ -305,8 +305,10 @@ sub allsnaps sub main { $| = 1; - $sql = sql->new(); versioncheck(); + # Give Postgres time to start up. + sleep(3); + $sql = sql->new(); info "Looking for orphaned blocks in the " . "database.\n"; push @blockqueue, $sql->listOrphans();