commit
68d874b15a
@ -39,9 +39,8 @@ if ( $bitcoin->can_connect() === true ){
|
|||||||
|
|
||||||
// Nothing to do so bail out
|
// Nothing to do so bail out
|
||||||
if (empty($aTransactions['transactions'])) {
|
if (empty($aTransactions['transactions'])) {
|
||||||
verbose("No new transactions since last block\n");
|
verbose("No new RPC transactions since last block\n");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Table header
|
// Table header
|
||||||
verbose("Blockhash\t\tHeight\tAmount\tConfirmations\tDiff\t\tTime\t\t\tStatus\n");
|
verbose("Blockhash\t\tHeight\tAmount\tConfirmations\tDiff\t\tTime\t\t\tStatus\n");
|
||||||
|
|
||||||
@ -66,15 +65,14 @@ if (empty($aTransactions['transactions'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
verbose("\n\n");
|
verbose("\n");
|
||||||
// Now with our blocks added we can scan for their upstream shares
|
// Now with our blocks added we can scan for their upstream shares
|
||||||
$aAllBlocks = $block->getAllUnaccounted('ASC');
|
$aAllBlocks = $block->getAllUnaccounted('ASC');
|
||||||
if (empty($aAllBlocks)) {
|
if (empty($aAllBlocks)) {
|
||||||
verbose("No new unaccounted blocks found\n");
|
verbose("No new unaccounted blocks found\n");
|
||||||
}
|
} else {
|
||||||
|
|
||||||
// Loop through our unaccounted blocks
|
// Loop through our unaccounted blocks
|
||||||
verbose("Block ID\tBlock Height\tShare ID\tShares\tFinder\t\t\tStatus\n");
|
verbose("\nBlock ID\tBlock Height\tShare ID\tShares\tFinder\t\t\tStatus\n");
|
||||||
foreach ($aAllBlocks as $iIndex => $aBlock) {
|
foreach ($aAllBlocks as $iIndex => $aBlock) {
|
||||||
if (empty($aBlock['share_id'])) {
|
if (empty($aBlock['share_id'])) {
|
||||||
// Fetch this blocks upstream ID
|
// Fetch this blocks upstream ID
|
||||||
@ -82,9 +80,9 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|||||||
$iCurrentUpstreamId = $share->getUpstreamId();
|
$iCurrentUpstreamId = $share->getUpstreamId();
|
||||||
$iAccountId = $user->getUserId($share->getUpstreamFinder());
|
$iAccountId = $user->getUserId($share->getUpstreamFinder());
|
||||||
} else {
|
} else {
|
||||||
verbose("Unable to fetch blocks upstream share\n");
|
verbose("\nUnable to fetch blocks upstream share. Aborting!\n");
|
||||||
verbose($share->getError() . "\n");
|
verbose($share->getError() . "\n");
|
||||||
continue;
|
exit;
|
||||||
}
|
}
|
||||||
// Fetch share information
|
// Fetch share information
|
||||||
if (!$iPreviousShareId = $block->getLastShareId()) {
|
if (!$iPreviousShareId = $block->getLastShareId()) {
|
||||||
@ -129,5 +127,6 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@ -187,6 +187,7 @@ class Share {
|
|||||||
ORDER BY id ASC LIMIT 1");
|
ORDER BY id ASC LIMIT 1");
|
||||||
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $last) && $stmt->execute() && $result = $stmt->get_result()) {
|
if ($this->checkStmt($stmt) && $stmt->bind_param('i', $last) && $stmt->execute() && $result = $stmt->get_result()) {
|
||||||
$this->oUpstream = $result->fetch_object();
|
$this->oUpstream = $result->fetch_object();
|
||||||
|
if (!empty($this->oUpstream->account) && is_int($this->oUpstream->id))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// Catchall
|
// Catchall
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user