Commit Graph

113 Commits

Author SHA1 Message Date
Sebastian Grewe
e8f8b2f5f4 Changed getLockedBalance and added SQL
* New SQL file for upgrade includes next changes
* Properly calculate getLockedBalance based on shares

Further addresses #70
2013-06-10 18:56:06 +02:00
Sebastian Grewe
4745a2f6f8 Adding support for PPS payout method
This commit changed a few things in the backend and classes code:

* Any <type>_PPS transaction does NOT need to be confirmed
* Queries updated for added <type>_PPS transactions
* Template updated to properly display these transactions

Cronjob

* Added pps_payput cron to run payouts based on worker submitted shares
* **IMPORTANT**: Can NOT be run with proportional_payout!

Addresses #70
2013-06-10 18:49:57 +02:00
Sebastian Grewe
b1d698e686 Allow users to change their email address
* Added email to account page
* No confirmation required as of yet

Fixes #142
2013-06-10 10:54:57 +02:00
Sebastian Grewe
9e74175ca3 Make email mandatory during registration
Partially addresses #142
2013-06-10 10:45:46 +02:00
Sebastian Grewe
4e284895a8 Adding support for block finder bonus
* Added new configuration option `block_bonus`, see `global.inc.dist.php`, default 0
* Added new transaction types: `Bonus` and `Orphan_Bonus`
* Changes transaction table structure, added upgrade SQL
* Changed findblock cron to credit bonus to finder
* Modified transactions class to reflect changes

Fixes #148
2013-06-10 10:11:56 +02:00
Sebastian Grewe
6eeff19ff5 Fixing issue with notification cron
* Updated getAllActive to search by type
2013-06-09 16:44:32 +02:00
Sebastian Grewe
4ea8b6c695 Adding new notification system for new blocks
* Modified findblocks cron
* Modified notifications cron for new structure
* Improved notification class
* Added new template for new_block type
* Moved idle_worker type template
* Added new_block type to notification settings
2013-06-09 14:26:18 +02:00
Sebastian Grewe
88ade9cfa3 Adding support for various notifications
* Adding new SQL upgrade for notifications
* Added support for per user notification settings
* Added account_id to notifications table
* Added new notification_settings table
* Added new account page: notifications

Addresses #144
2013-06-09 13:10:58 +02:00
Sebastian Grewe
d20efb3caa Merge pull request #141 from TheSerapher/issue-139
Issue 139
2013-06-07 11:10:56 -07:00
Sebastian Grewe
02eb400de9 proper whitespacing 2013-06-07 20:09:54 +02:00
Sebastian Grewe
efdbff8e53 Do not include unconfirmed transactions in balance view
This will fix #139 showing wrong liquid asset counts. Since
that was confusing I ensured confirmations are included in the calculations.
2013-06-07 20:07:55 +02:00
Sebastian Grewe
4da9fd2369 Working notification system
* Added things to mail templates
* Modified user password reset call for new mail template
* Added BASEPATH to smarty code to ensure templates are compiled in the
  proper directory
* Updated mail and notification class
* Updated notification cron
* Added notification cron to run-cron list
2013-06-07 15:36:35 +02:00
Sebastian Grewe
69a3761be5 Adding notification reset once worker is active
Go through all active notifications (active means they are not notified
again) and check if their state has changed. If so, mark as inactive and
allow for re-notification of the same type and data.
2013-06-07 15:36:35 +02:00
Sebastian Grewe
9ac2dadd97 Progress on notifications
* Added main mail class
* notification class extends mail class
* Added mail template for IDLE workers
* Added notification table to SQL structure

This works already but once notified the status is not reset as soon as
a worker is active again. Need to think of a system to do that
automatically.

Addresses #116
2013-06-07 15:36:35 +02:00
Sebastian Grewe
c69fbe4fc4 Add worker montioring to template and worker class
* Add configurable monitoring for workers into template
* Store monitoring status in DB

First commit for #116
2013-06-07 15:36:35 +02:00
Sebastian Grewe
671a2d01ca Properly display both shares and hashrates
* As proposed in #132 thi allows for both shares and hashsrates

Fixes #132.
2013-06-07 09:02:58 +02:00
Sebastian Grewe
4b05846a78 Re-Adding shares for admin user panel
* Re-enables estimations
* Still fixes #130 which had issues with hashrates, those are still
  fixed
2013-06-07 08:42:07 +02:00
Sebastian Grewe
f63485a539 Fixing admin panel user display
* Fixes #130. Removed total shares in favor of the hashrate.
* Fixes hashrate display.
* Added pagination template file to include pagination on other pages in
the future.
2013-06-07 08:33:14 +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
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
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
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
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
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
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
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
b5ab1a02fb Adding more in-line documentation and some cleanup 2013-05-30 09:55:21 +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
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