adding support for user donations, added all required changes into this commit
This commit is contained in:
parent
6ae51aa63d
commit
e4732f55ca
@ -45,7 +45,7 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|||||||
}
|
}
|
||||||
$aAccountShares = $share->getSharesForAccounts($share->getLastUpstreamId(), $iCurrentUpstreamId);
|
$aAccountShares = $share->getSharesForAccounts($share->getLastUpstreamId(), $iCurrentUpstreamId);
|
||||||
$iRoundShares = $share->getRoundShares($share->getLastUpstreamId(), $iCurrentUpstreamId);
|
$iRoundShares = $share->getRoundShares($share->getLastUpstreamId(), $iCurrentUpstreamId);
|
||||||
verbose("ID\tHeight\tTime\t\tShares\tFinder\t\tShare ID\tPrev Share\tStatus\n");
|
verbose("ID\tHeight\tTime\t\tShares\tFinder\t\tShare ID\tPrev Share\t\tStatus\n");
|
||||||
verbose($aBlock['id'] . "\t" . $aBlock['height'] . "\t" . $aBlock['time'] . "\t" . $iRoundShares . "\t" . $share->getUpstreamFinder() . "\t" . $share->getUpstreamId() . "\t\t" . $share->getLastUpstreamId());
|
verbose($aBlock['id'] . "\t" . $aBlock['height'] . "\t" . $aBlock['time'] . "\t" . $iRoundShares . "\t" . $share->getUpstreamFinder() . "\t" . $share->getUpstreamId() . "\t\t" . $share->getLastUpstreamId());
|
||||||
if (empty($aAccountShares)) {
|
if (empty($aAccountShares)) {
|
||||||
verbose("\nNo shares found for this block\n\n");
|
verbose("\nNo shares found for this block\n\n");
|
||||||
@ -58,24 +58,37 @@ foreach ($aAllBlocks as $iIndex => $aBlock) {
|
|||||||
if (!$block->setShares($aBlock['id'], $iRoundShares))
|
if (!$block->setShares($aBlock['id'], $iRoundShares))
|
||||||
$strStatus = "Shares Failed";
|
$strStatus = "Shares Failed";
|
||||||
verbose("\t\t$strStatus\n\n");
|
verbose("\t\t$strStatus\n\n");
|
||||||
verbose("ID\tUsername\tValid\tInvalid\tPercentage\tPayout\t\tStatus\n");
|
verbose("ID\tUsername\tValid\tInvalid\tPercentage\tPayout\t\tDonation\t\tStatus\n");
|
||||||
foreach ($aAccountShares as $key => $aData) {
|
foreach ($aAccountShares as $key => $aData) {
|
||||||
|
// Payout based on shares, PPS system
|
||||||
$aData['percentage'] = number_format(round(( 100 / $iRoundShares ) * $aData['valid'], 8), 8);
|
$aData['percentage'] = number_format(round(( 100 / $iRoundShares ) * $aData['valid'], 8), 8);
|
||||||
$aData['payout'] = number_format(round(( $aData['percentage'] / 100 ) * $config['reward'], 8), 8);
|
$aData['payout'] = number_format(round(( $aData['percentage'] / 100 ) * $config['reward'], 8), 8);
|
||||||
|
|
||||||
|
// Calculate donation amount for Donation transaction
|
||||||
|
$aData['donation'] = $user->getDonatePercent($user->getUserId($aData['username'])) / 100 * $aData['payout'];
|
||||||
|
|
||||||
|
// Verbose output of this users calculations
|
||||||
verbose($aData['id'] . "\t" .
|
verbose($aData['id'] . "\t" .
|
||||||
$aData['username'] . "\t" .
|
$aData['username'] . "\t" .
|
||||||
$aData['valid'] . "\t" .
|
$aData['valid'] . "\t" .
|
||||||
$aData['invalid'] . "\t" .
|
$aData['invalid'] . "\t" .
|
||||||
$aData['percentage'] . "\t" .
|
$aData['percentage'] . "\t" .
|
||||||
$aData['payout'] . "\t");
|
$aData['payout'] . "\t" .
|
||||||
|
$aData['donation'] . "\t");
|
||||||
|
|
||||||
// Do all database updates for block, statistics and payouts
|
|
||||||
$strStatus = "OK";
|
$strStatus = "OK";
|
||||||
|
// Update user share statistics
|
||||||
if (!$statistics->updateShareStatistics($aData, $aBlock['id']))
|
if (!$statistics->updateShareStatistics($aData, $aBlock['id']))
|
||||||
$strStatus = "Stats Failed";
|
$strStatus = "Stats Failed";
|
||||||
|
// Add new credit transaction
|
||||||
if (!$transaction->addTransaction($aData['id'], $aData['payout'], 'Credit', $aBlock['id']))
|
if (!$transaction->addTransaction($aData['id'], $aData['payout'], 'Credit', $aBlock['id']))
|
||||||
$strStatus = "Transaction Failed";
|
$strStatus = "Transaction Failed";
|
||||||
verbose("$strStatus\n");
|
// Add new donation debit
|
||||||
|
if ($aData['donation'] > 0) {
|
||||||
|
if (!$transaction->addTransaction($aData['id'], $aData['donation'], 'Donation', $aBlock['id']))
|
||||||
|
$strStatus = "Donation Failed";
|
||||||
|
}
|
||||||
|
verbose("\t\t$strStatus\n");
|
||||||
}
|
}
|
||||||
verbose("------------------------------------------------------------------------\n\n");
|
verbose("------------------------------------------------------------------------\n\n");
|
||||||
|
|
||||||
|
|||||||
@ -9,10 +9,11 @@ class Transaction {
|
|||||||
private $table = 'transactions';
|
private $table = 'transactions';
|
||||||
private $tableBlocks = 'blocks';
|
private $tableBlocks = 'blocks';
|
||||||
|
|
||||||
public function __construct($debug, $mysqli, $config) {
|
public function __construct($debug, $mysqli, $config, $block) {
|
||||||
$this->debug = $debug;
|
$this->debug = $debug;
|
||||||
$this->mysqli = $mysqli;
|
$this->mysqli = $mysqli;
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
|
$this->block = $block;
|
||||||
$this->debug->append("Instantiated Transaction class", 2);
|
$this->debug->append("Instantiated Transaction class", 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,23 +76,33 @@ class Transaction {
|
|||||||
|
|
||||||
public function getBalance($account_id) {
|
public function getBalance($account_id) {
|
||||||
$stmt = $this->mysqli->prepare("
|
$stmt = $this->mysqli->prepare("
|
||||||
SELECT IFNULL(c.credit, 0) - IFNULL(d.debit,0) AS balance
|
SELECT IFNULL(t1.credit, 0) - IFNULL(t2.debit, 0) - IFNULL(t3.other, 0) AS balance
|
||||||
FROM (
|
FROM
|
||||||
SELECT t.account_id, sum(t.amount) AS credit
|
(
|
||||||
|
SELECT sum(t.amount) AS credit
|
||||||
FROM $this->table AS t
|
FROM $this->table AS t
|
||||||
LEFT JOIN $this->tableBlocks AS b ON t.block_id = b.id
|
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
||||||
WHERE type = 'Credit'
|
WHERE t.type = 'Credit'
|
||||||
AND b.confirmations > ?
|
AND b.confirmations >= ?
|
||||||
AND t.account_id = ? ) AS c
|
AND t.account_id = ?
|
||||||
LEFT JOIN (
|
) AS t1,
|
||||||
SELECT t.account_id, sum(amount) AS debit
|
(
|
||||||
|
SELECT sum(t.amount) AS debit
|
||||||
FROM $this->table AS t
|
FROM $this->table AS t
|
||||||
WHERE type IN ('Debit_MP','Debit_AP')
|
WHERE t.type IN ('Debit_MP', 'Debit_AP')
|
||||||
AND t.account_id = ? ) AS d
|
AND t.account_id = ?
|
||||||
ON c.account_id = d.account_id
|
) AS t2,
|
||||||
|
(
|
||||||
|
SELECT sum(t.amount) AS other
|
||||||
|
FROM $this->table AS t
|
||||||
|
LEFT JOIN " . $this->block->getTableName() . " AS b ON t.block_id = b.id
|
||||||
|
WHERE t.type IN ('Donation')
|
||||||
|
AND b.confirmations >= ?
|
||||||
|
AND t.account_id = ?
|
||||||
|
) AS t3
|
||||||
");
|
");
|
||||||
if ($this->checkStmt($stmt)) {
|
if ($this->checkStmt($stmt)) {
|
||||||
$stmt->bind_param("iii", $this->config['confirmations'], $account_id, $account_id);
|
$stmt->bind_param("iiiii", $this->config['confirmations'], $account_id, $account_id, $this->config['confirmations'], $account_id);
|
||||||
if (!$stmt->execute()) {
|
if (!$stmt->execute()) {
|
||||||
$this->debug->append("Unable to execute statement: " . $stmt->error);
|
$this->debug->append("Unable to execute statement: " . $stmt->error);
|
||||||
$this->setErrorMessage("Fetching balance failed");
|
$this->setErrorMessage("Fetching balance failed");
|
||||||
@ -104,4 +115,4 @@ class Transaction {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$transaction = new Transaction($debug, $mysqli, $config);
|
$transaction = new Transaction($debug, $mysqli, $config, $block);
|
||||||
|
|||||||
@ -115,7 +115,19 @@ class User {
|
|||||||
* @return data string Coin Address
|
* @return data string Coin Address
|
||||||
**/
|
**/
|
||||||
public function getCoinAddress($userID) {
|
public function getCoinAddress($userID) {
|
||||||
return $this->getSingle($userID, 'coin_address', 'id', 's');
|
return $this->getSingle($userID, 'coin_address', 'id');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fetch users donation value
|
||||||
|
* @param userID int UserID
|
||||||
|
* @return data string Coin Address
|
||||||
|
**/
|
||||||
|
public function getDonatePercent($userID) {
|
||||||
|
$dPercent = $this->getSingle($userID, 'donate_percent', 'id');
|
||||||
|
if ($dPercent > 100) $dPercent = 100;
|
||||||
|
if ($dPercent < 0) $dPercent = 0;
|
||||||
|
return $dPercent;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,11 +1,6 @@
|
|||||||
{include file="global/block_header.tpl" BLOCK_HEADER="Transaction Log" BUTTONS=array(Confirmed,Unconfirmed)}
|
{include file="global/block_header.tpl" BLOCK_HEADER="Transaction Log" BUTTONS=array(Confirmed,Unconfirmed)}
|
||||||
<div class="block_content tab_content" id="Confirmed" style="clear:;">
|
<div class="block_content tab_content" id="Confirmed" style="clear:;">
|
||||||
<center>
|
<center>
|
||||||
<p>
|
|
||||||
<font color="" size="1">
|
|
||||||
<b>ATP</b> = Auto Threshold Payment, <b>MP</b> = Manual Payment, <b>Don_Fee</b> = donation amount + pool fees (if applicable)
|
|
||||||
</font>
|
|
||||||
</p>
|
|
||||||
<table cellpadding="1" cellspacing="1" width="98%" class="sortable">
|
<table cellpadding="1" cellspacing="1" width="98%" class="sortable">
|
||||||
<thead style="font-size:13px;">
|
<thead style="font-size:13px;">
|
||||||
<tr>
|
<tr>
|
||||||
@ -19,7 +14,12 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody style="font-size:12px;">
|
<tbody style="font-size:12px;">
|
||||||
{section transaction $TRANSACTIONS}
|
{section transaction $TRANSACTIONS}
|
||||||
{if (($TRANSACTIONS[transaction].type == 'Credit' and $TRANSACTIONS[transaction].confirmations >= $GLOBAL.confirmations) or $TRANSACTIONS[transaction].type != 'Credit')}
|
{if (
|
||||||
|
($TRANSACTIONS[transaction].type == 'Credit' and $TRANSACTIONS[transaction].confirmations >= $GLOBAL.confirmations)
|
||||||
|
or ($TRANSACTIONS[transaction].type == 'Donation' and $TRANSACTIONS[transaction].confirmations >= $GLOBAL.confirmations)
|
||||||
|
or $TRANSACTIONS[transaction].type == 'Debit_AP'
|
||||||
|
or $TRANSACTIONS[transaction].type == 'Debit_MP'
|
||||||
|
)}
|
||||||
<tr class="{cycle values="odd,even"}">
|
<tr class="{cycle values="odd,even"}">
|
||||||
<td>{$TRANSACTIONS[transaction].id}</td>
|
<td>{$TRANSACTIONS[transaction].id}</td>
|
||||||
<td>{$TRANSACTIONS[transaction].timestamp}</td>
|
<td>{$TRANSACTIONS[transaction].timestamp}</td>
|
||||||
@ -32,11 +32,15 @@
|
|||||||
{/section}
|
{/section}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p>
|
||||||
|
<font color="" size="1">
|
||||||
|
<b>Credit_AP</b> = Auto Threshold Payment, <b>Credit_MP</b> = Manual Payment, <b>Donation</b> = Donation, <b>Fee</b> = Pool Fees (if applicable)
|
||||||
|
</font>
|
||||||
|
</p>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
<div class="block_content tab_content" id="Unconfirmed" style="">
|
<div class="block_content tab_content" id="Unconfirmed" style="">
|
||||||
<center>
|
<center>
|
||||||
<p><font color="" sizeze="1">Listed below are your estimated rewards and donations/fees for all blocks awaiting 120 confirmations.</font></p>
|
|
||||||
<table cellpadding="1" cellspacing="1" width="98%" class="sortable">
|
<table cellpadding="1" cellspacing="1" width="98%" class="sortable">
|
||||||
<thead style="font-size:13px;">
|
<thead style="font-size:13px;">
|
||||||
<tr>
|
<tr>
|
||||||
@ -50,7 +54,10 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody style="font-size:12px;">
|
<tbody style="font-size:12px;">
|
||||||
{section transaction $TRANSACTIONS}
|
{section transaction $TRANSACTIONS}
|
||||||
{if $TRANSACTIONS[transaction].type == 'Credit' && $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations}
|
{if (
|
||||||
|
$TRANSACTIONS[transaction].type == 'Credit' && $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations
|
||||||
|
or ($TRANSACTIONS[transaction].type == 'Donation' and $TRANSACTIONS[transaction].confirmations < $GLOBAL.confirmations)
|
||||||
|
)}
|
||||||
<tr class="{cycle values="odd,even"}">
|
<tr class="{cycle values="odd,even"}">
|
||||||
<td>{$TRANSACTIONS[transaction].id}</td>
|
<td>{$TRANSACTIONS[transaction].id}</td>
|
||||||
<td>{$TRANSACTIONS[transaction].timestamp}</td>
|
<td>{$TRANSACTIONS[transaction].timestamp}</td>
|
||||||
@ -59,15 +66,20 @@
|
|||||||
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
<td>{if $TRANSACTIONS[transaction].height == 0}n/a{else}{$TRANSACTIONS[transaction].height}{/if}</td>
|
||||||
<td><font color="{if $TRANSACTIONS[transaction].type == Credit}green{else}red{/if}">{$TRANSACTIONS[transaction].amount}</td>
|
<td><font color="{if $TRANSACTIONS[transaction].type == Credit}green{else}red{/if}">{$TRANSACTIONS[transaction].amount}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{assign var="sum" value="`$sum+$TRANSACTIONS[transaction].amount`"}
|
{if $TRANSACTIONS[transaction].type == Credit}
|
||||||
|
{assign var="credits" value="`$credits+$TRANSACTIONS[transaction].amount`"}
|
||||||
|
{else}
|
||||||
|
{assign var="debits" value="`$debits+$TRANSACTIONS[transaction].amount`"}
|
||||||
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{/section}
|
{/section}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5"><b>Unconfirmed Totals:</b></td>
|
<td colspan="5"><b>Unconfirmed Totals:</b></td>
|
||||||
<td><b>{$sum}</b></td>
|
<td><b>{$credits - $debits}</b></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p><font color="" sizeze="1">Listed are your estimated rewards and donations/fees for all blocks awaiting {$GLOBAL.confirmations} confirmations.</font></p>
|
||||||
</center>
|
</center>
|
||||||
</div>
|
</div>
|
||||||
{include file="global/block_footer.tpl"}
|
{include file="global/block_footer.tpl"}
|
||||||
|
|||||||
@ -1,25 +1,61 @@
|
|||||||
<div class="block" style="clear:none; margin-top:15px; margin-left:13px;">
|
<div class="block" style="clear:none; margin-top:15px; margin-left:13px;">
|
||||||
<div class="block_head">
|
<div class="block_head">
|
||||||
<div class="bheadl"></div>
|
<div class="bheadl"></div>
|
||||||
<div class="bheadr"></div>
|
<div class="bheadr"></div>
|
||||||
<h1>Dashboard</h1>
|
<h1>Dashboard</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="block_content" style="padding-top:10px;">
|
<div class="block_content" style="padding-top:10px;">
|
||||||
<p>
|
<table class="sidebar">
|
||||||
<b><u>Your Current Hashrate</u></b><br/>
|
<tr><td colspan="2"><b>Your Current Hashrate</b></td></tr>
|
||||||
<i><b>{$GLOBAL.userdata.hashrate} KH/s</b></i><br/><br/>
|
<tr><td colspan="2">{$GLOBAL.userdata.hashrate} KH/s</td></tr>
|
||||||
<u><b>Unpaid Shares</b></u><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares between the last 120 confirms block until now.'></span><br/>
|
<tr>
|
||||||
Your Valid: <b><i>{$GLOBAL.userdata.shares.valid}</i><font size='1px'></font></b><br/>
|
<td colspan="2"><b><u>Unpaid Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares between the last 120 confirms block until now.'></span><td>
|
||||||
Pool Valid: <b><i>{$GLOBAL.roundshares.valid}</i> <font size='1px'></font></b><br/><br>
|
</tr>
|
||||||
<u><b>Round Shares </b></u><span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span><br/>
|
<tr>
|
||||||
Pool Valid: <b><i>{$GLOBAL.roundshares.valid}</i></b><br>
|
<td><b>Your Valid<b></td>
|
||||||
Pool Inalid: <b><i>{$GLOBAL.roundshares.invalid}</i></b><br>
|
<td><i>{$GLOBAL.userdata.shares.valid}</i><font size='1px'></font></b></td>
|
||||||
Your Invalid: <b><i>{$GLOBAL.userdata.shares.invalid}</i><font size='1px'></font></b><br/><br>
|
</tr>
|
||||||
<u><b>Round Estimate</b></u><font size='1'></font></u><br>
|
<tr>
|
||||||
<b><i>{math equation="round(( x / y ) * z, 8)" x=$GLOBAL.userdata.shares.valid y=$GLOBAL.roundshares.valid z=$GLOBAL.reward}</i> <font size='1px'>LTC</font></b><br><br>
|
<td><b>Pool Valid</td>
|
||||||
<u><b>Account Balance</b></u><br><b><i>{$GLOBAL.userdata.balance|default:"0"}</i><font size='1px'> LTC</font></b><br/><br>
|
<td><i>{$GLOBAL.roundshares.valid}</i> <font size='1px'></font></b></td>
|
||||||
</p>
|
</tr>
|
||||||
</div>
|
<tr>
|
||||||
<div class="bendl"></div>
|
<td colspan="2"><b><u>Round Shares</u></b> <span id='tt'><img src='{$PATH}/images/questionmark.png' height='15px' width='15px' title='Submitted shares since last found block (ie. round shares)'></span></td>
|
||||||
<div class="bendr"></div>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Pool Valid</b></td>
|
||||||
|
<td><i>{$GLOBAL.roundshares.valid}</i></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Pool Invalid</b></td>
|
||||||
|
<td><i>{$GLOBAL.roundshares.invalid}</i></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Your Invalid</b></td>
|
||||||
|
<td><i>{$GLOBAL.userdata.shares.invalid}</i><font size='1px'></font></td>
|
||||||
|
</tr>
|
||||||
|
{math assign="block" equation="round(( x / y ) * z, 3)" x=$GLOBAL.userdata.shares.valid y=$GLOBAL.roundshares.valid z=$GLOBAL.reward}
|
||||||
|
{math assign="donation" equation="round(((d / 100) * est), 3)" d=$GLOBAL.userdata.donate_percent est=$block}
|
||||||
|
<tr>
|
||||||
|
<td colspan="2"><b><u>Round Estimate</u></b></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Block</b></td>
|
||||||
|
<td>{$block} LTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Donation</b></td>
|
||||||
|
<td>{$donation} LTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>Payout</b></td>
|
||||||
|
<td>{math equation="block - donation" block=$block donation=$donation} LTC</td>
|
||||||
|
</tr>
|
||||||
|
<tr><td colspan="2"> </td></tr>
|
||||||
|
<tr><td colspan="2"><b><u>Account Balance</u></b></td></tr>
|
||||||
|
<tr><td colspan="2"><b>{$GLOBAL.userdata.balance|default:"0"} LTC</td></tr>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="bendl"></div>
|
||||||
|
<div class="bendr"></div>
|
||||||
|
</div>
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
-- phpMyAdmin SQL Dump
|
-- phpMyAdmin SQL Dump
|
||||||
-- version 3.5.1
|
-- version 3.5.8.1deb1
|
||||||
-- http://www.phpmyadmin.net
|
-- http://www.phpmyadmin.net
|
||||||
--
|
--
|
||||||
-- Host: localhost
|
-- Host: localhost
|
||||||
-- Generation Time: May 16, 2013 at 09:25 PM
|
-- Generation Time: May 20, 2013 at 07:35 PM
|
||||||
-- Server version: 5.5.31-log
|
-- Server version: 5.5.31-0ubuntu0.13.04.1
|
||||||
-- PHP Version: 5.4.15
|
-- PHP Version: 5.4.9-4ubuntu2
|
||||||
|
|
||||||
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
|
||||||
SET time_zone = "+00:00";
|
SET time_zone = "+00:00";
|
||||||
@ -17,7 +17,7 @@ SET time_zone = "+00:00";
|
|||||||
/*!40101 SET NAMES utf8 */;
|
/*!40101 SET NAMES utf8 */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Database: `mmcfe_ng_db`
|
-- Database: `mmcfe_ng`
|
||||||
--
|
--
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
@ -63,7 +63,7 @@ CREATE TABLE IF NOT EXISTS `blocks` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `height` (`height`,`blockhash`),
|
UNIQUE KEY `height` (`height`,`blockhash`),
|
||||||
KEY `time` (`time`)
|
KEY `time` (`time`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Discovered blocks persisted from Litecoin Service';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Discovered blocks persisted from Litecoin Service';
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `shares_archive` (
|
|||||||
`time` datetime DEFAULT NULL,
|
`time` datetime DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE KEY `share_id` (`share_id`)
|
UNIQUE KEY `share_id` (`share_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Archive shares for potential later debugging purposes';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Archive shares for potential later debugging purposes';
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ CREATE TABLE IF NOT EXISTS `statistics_shares` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `account_id` (`account_id`),
|
KEY `account_id` (`account_id`),
|
||||||
KEY `block_id` (`block_id`)
|
KEY `block_id` (`block_id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ CREATE TABLE IF NOT EXISTS `statistics_shares` (
|
|||||||
CREATE TABLE IF NOT EXISTS `transactions` (
|
CREATE TABLE IF NOT EXISTS `transactions` (
|
||||||
`id` int(255) NOT NULL AUTO_INCREMENT,
|
`id` int(255) NOT NULL AUTO_INCREMENT,
|
||||||
`account_id` int(255) unsigned NOT NULL,
|
`account_id` int(255) unsigned NOT NULL,
|
||||||
`type` enum('Credit','Debit_MP','Debit_AP') DEFAULT NULL,
|
`type` enum('Credit','Debit_MP','Debit_AP','Fee','Donation') DEFAULT NULL,
|
||||||
`coin_address` varchar(255) DEFAULT NULL,
|
`coin_address` varchar(255) DEFAULT NULL,
|
||||||
`amount` double DEFAULT '0',
|
`amount` double DEFAULT '0',
|
||||||
`fee_amount` float DEFAULT '0',
|
`fee_amount` float DEFAULT '0',
|
||||||
@ -153,7 +153,7 @@ CREATE TABLE IF NOT EXISTS `transactions` (
|
|||||||
KEY `block_id` (`block_id`),
|
KEY `block_id` (`block_id`),
|
||||||
KEY `account_id` (`account_id`),
|
KEY `account_id` (`account_id`),
|
||||||
KEY `type` (`type`)
|
KEY `type` (`type`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user