Commit Graph

139 Commits

Author SHA1 Message Date
Sebastian Grewe
6a8979d20b Fixing critical issue with manual- and autopayouts
This is a proposed fix for #128:

* Mark auto_payout running via DB setting, unlock when done
* Just before actually sending money, check for running cron

Please refer to the ticket for details
2013-06-06 23:23:54 +02:00
Sebastian Grewe
7c1d51cc7a Add API call for getuserstatus
Fixes #126, see Github Wiki for documentation
2013-06-06 22:40:51 +02:00
Sebastian Grewe
4691e077e2 Ensure no old blocks shares are counter for new ones
When finding more than a single block between runs it added shares to a
new block from a previous one. Properly fetch the last highest share ID
from the database prior to scanning for shares assigned to a block.

Fixes #124
2013-06-06 22:27:34 +02:00
Sebastian Grewe
d5866207c1 Adding admin only API call: getuserworkers <id>
* Require valid token and admin access
* Grab full worker information for a user
 * Matches the Worker List on the Account page
* See Wiki for full documentation
2013-06-06 17:18:55 +02:00
Sebastian Grewe
aebb97a1d8 use default cashing times 2013-06-06 12:01:06 +02:00
Sebastian Grewe
1bf2e7cf18 Pre-sort SQL data in array for easy time access
This allows us to access the array key as the time. This way the
template can properly render the time axis according to current time.
2013-06-06 11:47:20 +02:00
Sebastian Grewe
232e79f7ad do not pass two arguments to SQL 2013-06-06 11:01:04 +02:00
Sebastian Grewe
52d079eaed do not include archive table for hashrates, better formatting 2013-06-06 10:45:37 +02:00
Sebastian Grewe
7dc0736b77 First version for new user graphs
* Properly calculate hashrate
* Remove number formatting, it breaks the graph
* Not properly in order based on time but displays correct values

Addresses #90
2013-06-05 17:22:47 +02:00
Sebastian Grewe
aff116849c Adding support for public API polling
* Does not require a token
* Returns basic status as taken from default mmcfe

Addresses #111
2013-06-05 11:49:08 +02:00
Sebastian Grewe
11338cedf3 Add new threshold display to template
Forgot to add the template files that adds configurable thresholds
2013-06-05 09:17:10 +02:00
Sebastian Grewe
6c4fb84ee9 Adding min/max threshold configuration
* Check for min/max values set for auto payouts
* Display error messages to the user
* Sanitize values just in case we fall through the validation
* Updated template and class
* New configuration option added! Update your local configs!

Fixes #108
2013-06-05 09:11:25 +02:00
Sebastian Grewe
e37fb70a46 Do not deduct fees from balance when transmitting
Fixes #106, we want to transfer the entire balance and let the RPC
server deduct any fees that might apply.
2013-06-04 20:51:24 +02:00
Sebastian Grewe
c1682e2203 Ignore rejected shares in top list calculations
Fixes #104
2013-06-04 15:58:51 +02:00
Sebastian Grewe
af3252abb2 Find ALL transactions, even unconfirmed
* This ensures that credits are not unlocked and available to the pool
2013-06-04 14:28:34 +02:00
Sebastian Grewe
91d225e340 Adding wallet information in Admin panel
Fixes #63 and adds proper wallet information:

* Wallet balance
* Locked balance for users
* Liquid assets available to pool owner
2013-06-04 14:03:46 +02:00
Sebastian Grewe
020ea2269b Re-adding admin flags to user list for admin panel
Fixes #99
2013-06-04 13:46:56 +02:00
Sebastian Grewe
d85ded7c5c Moving from user to statistics class
* This fetches all users and joins with shares table

Should speed up things a fair bit.
2013-06-04 13:14:25 +02:00
Sebastian Grewe
065f5e6d16 Adding working user admin panel to query user DB
* Users are all fetched from the DB
* Each user is assigned special stats
 * Hashrate
 * Shares
 * Balance
 * Est. Payout
 * Est. Donation
* Display in sortable and paginated table

This is not well optimized. Each user stats are grabbed individually
via the stats and transaction classes. It would probably make sense to
expand the statistics class to list a full user list with all statistics
available instead to cover this in a single SQL query.
2013-06-04 11:34:22 +02:00
Sebastian Grewe
ed0853202b Initial file import for admin panel
* Added isAdmin to user class
 * Run isAdmin on EACH page to ensure admin status hasn't changed
* Added main page with no content
* Added user query page with basic form, no content
2013-06-04 09:15:55 +02:00
Sebastian Grewe
bdcc3f747c Addressing #96, missing difficulty on stats page
* Properly assign template variable
* Removed unneeded additional template
2013-06-04 09:08:30 +02:00
Sebastian Grewe
07d49f83d3 Changing hash- and share rate calculation SQL
* Do not include shares_archive table
 * Main reason: This table is optional
 * Secondary reason: Speeds up the query from 1.3s to 0.005s
* Drawback: Once a block is found it takes 10 minutes for the stats to
  be accuracte again

This could potentially be reverted but since shares_archive is optional
and the speed increase is rather significant I'd like to keep it this
way.
2013-06-03 15:03:04 +02:00
Sebastian Grewe
c16e12886a Update global.inc.dist.php
* Adjusted default difficulty in `config.inc.dist.php` to `20` which seems to be stratum default.
2013-06-03 12:07:06 +03:00
Sebastian Grewe
96c9a4ae08 Renamed workers table to pool_worker
* This will fix issues with mining pools using the default name
* Back in line with default configurations for most mining pool software
* Fixes #93
2013-06-03 10:59:12 +02:00
Sebastian Grewe
0a404e6f39 Adding new option to configuration file
* `archive_shares`, true or false, to move shares to archive table
2013-06-02 08:45:06 +02:00
Sebastian Grewe
a7bc6fc342 Changed backend logics for block finding and payout
* Findblocks cronjob changes
 * Find & Store upstream share
  * Use last found `share_id` as starting ID or `0`
 * Find & Store upstream finder
  * Use last found `share_id` as starting ID or `0`
* Use stored information when running propotional payout
 * Fetch current checked blocks upstream share from block table
 * Fetch previous upstream share of previous block from block table
 * Calculated payouts in that range of IDs
* Updated `block.class.php` to store share_id in block and fetch highest `share_id`
2013-05-31 14:23:29 +02:00
Sebastian Grewe
8a1dc20ec8 Changing upstream share finding function
* Fetch all blocks unaccounted for in ASC oder (low to high height)
* Use lowest height block to find lowest ID upstream accepted share
* Use this share as the finding share for a block
* Set share as last found upstream share for further blocks
 * This only applies if shares are not deleted at all which they should!
2013-05-31 12:11:56 +02:00
Sebastian Grewe
b2725fbce5 Getting rid of various PHP notice warnings
* Assigned empty defaults on templates
* Added some variable checking
2013-05-31 11:56:56 +02:00
Sebastian Grewe
b5ab1a02fb Adding more in-line documentation and some cleanup 2013-05-30 09:55:21 +02:00
Sebastian Grewe
61658b76f4 changed error message for RPC errors 2013-05-29 21:18:24 +02:00
Sebastian Grewe
69b2c2f517 Properly abort API calls if api_key is invalid
* Fixes an issue where any api_key would be validated
* Now returns user ID upon success, aborts script processing with error
  on fail
2013-05-29 12:41:53 +02:00
Sebastian Grewe
cdfb074076 Re-adding LTC/usd to website ministats header
* Use tickerupdate.php cron to update setting value
* Added new configuration variables for ticket updates
* Added some missing configuration vars for some URLs
2013-05-29 10:56:08 +02:00
Sebastian Grewe
2548d4b03d add API key back to account details
Fixes #73.
2013-05-28 15:35:28 +02:00
Sebastian Grewe
a2eb5cc7b3 Register first user as admin
This commit fixes #50 and is needed for the admin panel
2013-05-28 14:33:03 +02:00
Sebastian Grewe
510ce89338 Use new BitcoinWrapper class, remove memcache calls 2013-05-28 11:50:37 +02:00
Sebastian Grewe
f4a4235562 remove generic api page 2013-05-28 10:55:29 +02:00
Sebastian Grewe
d4331ed8dc Adding more actions for API page
* getblockcount
* getblocksfound (with limit support)
* getcurrentworkers
* getdifficulty
* getestimatedtime
* getpoolhashrate
* getpoolsharerate
* gettimesincelastblock
2013-05-28 10:50:16 +02:00
Sebastian Grewe
1e54a1a2d6 initial commit of a working API page 2013-05-28 10:13:26 +02:00
Sebastian Grewe
376bae1e2d Moved setCache method into StatsCacheClass
* Allow calling method via memcache wrapping call
* Make it available to all classes using StatsCache
2013-05-28 10:09:57 +02:00
Sebastian Grewe
75bee6ed60 fetch account balance across all users
* Used later for admin panel to show total amount of credits locked for
  users
* Used later for liquid asset calculations
2013-05-27 15:51:20 +02:00
Sebastian Grewe
658039fecf Merge pull request #69 from TheSerapher/issue-66
addressing #66 with higher timerange for upstream shares
2013-05-27 05:56:19 -07:00
Sebastian Grewe
e1f92218a3 addressing #66 with higher timerange for upstream shares 2013-05-27 14:55:13 +02:00
Sebastian Grewe
d44c236f2b Adding support for orphan blocks
* Adjusted blockupdate cronjob
 * Fetch block information via `gettransaction`
* Adjusted block class
 * Only getAllUnconfirmed where confirmations > -1
* Adjusted transaction class
 * added setOrphan method to mark orphaned transactions
* If block is orphaned
 * Mark all related transactions as Orphan_*type*
 * Set confirmations of block to -1 so it is ignored and marked as orphan
* Change transaction template, added listing for orphan transactions
* Add orphan status to block listings template
2013-05-27 14:44:40 +02:00
Sebastian Grewe
93d0ec06a6 adding proper headers for HTML mail 2013-05-25 12:25:41 +02:00
Sebastian Grewe
787942b6f9 working version of password reset with one time token 2013-05-25 12:08:51 +02:00
Sebastian Grewe
841d986726 initial work on password reset, not working fully yet 2013-05-25 10:58:53 +02:00
Sebastian Grewe
30a46979b9 adding configurable block explorer and chain info URLs 2013-05-24 16:16:53 +02:00
Sebastian Grewe
7b8aec1699 Merge pull request #57 from TheSerapher/block-stats
adding block status page for past 30 blocks, no graphs yet
2013-05-24 06:57:43 -07:00
Sebastian Grewe
b771920210 adding block status page for past 30 blocks, no graphs yet 2013-05-24 15:57:14 +02:00
Sebastian Grewe
93fa758ab6 increase timerange for upstream share to cope with slower db writes 2013-05-24 15:31:29 +02:00