... and a possibly useful tool that I posted elsewhere on the forum long ago but use myself for this and have updated in the past also.
It's the PHP code to convert a share difficulty to an approximate of the block hash:
difftoblock.php
#
function basecvt($str, $frombase=10, $tobase=16)
{
$str = trim($str);
if (intval($frombase) != 10)
{
$len = strlen($str);
$q = 0;
for ($i=0; $i<$len; $i++)
{
$r = base_convert($str[$i], $frombase, 10);
$q = bcadd(bcmul($q, $frombase), $r);
}
}
else
$q = $str;
if (intval($tobase) != 10)
{
$s = '';
while (bccomp($q, '0', 0) > 0)
{
$r = intval(bcmod($q, $tobase));
$s = base_convert($r, 10, $tobase) . $s;
$q = bcdiv($q, $tobase, 0);
}
}
else
$s = $q;
return $s;
}
#
function bctrim($num0)
{
if (strpos($num0, '.') === false)
return $num0;
else
return rtrim(rtrim($num0, '0'), '.');
}
#
$diff = str_replace(',', '', $argv[1]);
#
bcscale(1000);
#
$d1_sp = '00000000 FFFF0000 00000000 00000000 00000000 00000000 00000000 00000000';
$d1_16 = str_replace(' ', '', $d1_sp);
$d1_0 = basecvt($d1_16, 16, 10);
$d1_10 = bctrim($d1_0);
#
$blk0 = bcdiv($d1_10, $diff);
$blk10 = bctrim($blk0);
$blk16 = basecvt($blk10, 10, 16);
#
echo "diff=$diff\n";
echo "d1_16=$d1_16\n";
echo "blk10=$blk10\n";
echo "blk16=$blk16\n";
#
?>
It works like this:
php difftoblock.php 13,515,318,406,575.7
diff=13515318406575.7
d1_16=00000000FFFF0000000000000000000000000000000000000000000000000000
blk10=1994739190006393264211328987798730314111045124329010603.4118662030266775963456011609545381073605519916888689998048069750235059778050017483678112979756202597418432893164811479721865017459961002819477374188976756222446490354830161705531355123156955600591459765919442787026276796065071739050920751191689306882241755009962835324766554057278633589982821943902554137642807938368820659058105948301714646674725398837885180334465403321512266213331074098927544026464234001707213680957296203848893959638481620204022452776577543099321955289028826624308987405471068407670210379333941374893084405700389927434927907741052149912144384095509889985511226758984370371988163870776246813018969189185447847286620387026721495590395226016002561381504112927420444983609219293071249930342105875437563823497137260623462227520906901497102168738067263663510220693569146087249958245458016702391689090364528152624948312485492563873977733867807702954704854580469764421917353429927189806407208134290652114518068541438397536536285324879830325653866928329107454796350791816760757796910377261
blk16=14d377f075e75428ad14f23640ebd7ba03217a409375ab
The blk16 value is sorta the block hash so you search any source of block hashes you have for the first 6 or so characters with eight zeros on the front like so:
0000000014d377
For the linux gurus among, searching the bitcoind debug.log file would be:
grep 0000000014d377 debug.log
And my result of that on one of the node bitcoinds is:
2017-10-15 16:46:33.487916 UpdateTip: new best=00000000000000000014d377f075e7632439a087256b4dea039235fa2d90769c height=489987 version=0x20000000 log2_work=87.285942 tx=262350214 date='2017-10-15 16:46:07' progress=1.000000 cache=66.3MiB(37539tx)
So that shows block height=489987 for that diff value
and checking on blocktrail shows that is our block:
https://www.blocktrail.com/BTC/block/489987