-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fixed function hex_to_int does not exists, add schema to wizstats tables, and many other fixes. #64
base: master
Are you sure you want to change the base?
Conversation
…e keyhash, we failted
…without this, will failed.
…shares and get user_id from users table again, wtf!
…ct user_id form shares, @wizkid057 didnot give us the shares table schema, if add user_id field to shares table, the eloipool pool server will not fill this field, so i use this method to fix user_id is null or empty.
…s, which is users.id.
…_query" does not exist LINE 1: ...ect count(*) as check from pg_stat_activity where current_qu... ^ in instant_livedata.php on line 127
|
||
$link = pg_Connect("dbname=$psqldb user=$psqluser password='$psqlpass' host=$psqlhost", PGSQL_CONNECT_FORCE_NEW ); | ||
$link2 = pg_Connect("dbname=$psqldb user=$psqluser password='$psqlpass' host=$psqlhost", PGSQL_CONNECT_FORCE_NEW ); | ||
|
||
### OPTIMIZE THIS TO KNOW WHEN THE LAST BLOCK WAS?! | ||
$sql = "INSERT INTO $psqlschema.stats_blocks (server, orig_id, time, user_id, solution, network_difficulty) select server, id, time, user_id, solution, (pow(10,((29-hex_to_int(substr(encode(solution,'hex'),145,2)))::double precision*2.4082399653118495617099111577959::double precision)+log( (65535::double precision / hex_to_int(substr(encode(solution,'hex'),147,6)))::double precision )::double precision))::double precision as network_difficulty from shares where upstream_result=true and solution NOT IN (select solution from $psqlschema.stats_blocks);"; | ||
$sql = "INSERT INTO $psqlschema.stats_blocks (server, orig_id, time, user_id, solution, network_difficulty) select shares.server, shares.id, shares.time, users.id as user_id, shares.solution, (pow(10,((29-$psqlschema.hex_to_int(substr(encode(shares.solution,'hex'),145,2)))::double precision*2.4082399653118495617099111577959::double precision)+log( (65535::double precision / $psqlschema.hex_to_int(substr(encode(shares.solution,'hex'),147,6)))::double precision )::double precision))::double precision as network_difficulty from shares left join users on shares.username= users.username where upstream_result=true and solution NOT IN (select solution from $psqlschema.stats_blocks);"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_id is a sequence number for users.id in the users table. there is no shares.username.
should be:
left join users on users.id = shares.user_id
IIRC... from the old wiki: http://eligius.st/wiki/index.php/PostgreSQL_Schema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
emm....I looked through all eloipool's code, the shares table has username field. at the shareslogging config settings. if there is no username field in shares table, how does eloipool know to adding user_id into shares table? eloipool only doing the logging things, it just know only the minner's bitcoin address as username.
thank you for give me the wiki page, but it is generated on 2011, maybe things are changed, but eloipool's code still remained.
… blocks_functions.php on line 112
… select id,(pow(10,((29-hex_to_int(substr(encode(solution,'he... ^ HINT: No function matches the given name and argument types. You might need to add explicit type casts. in userstats.php on line 570
… to stats_sharesagg.time(time without time zone)
select users.id as user_id from users table, i didnt know how to select user_id form shares, @wizkid057 didnot give us the shares table schema, if add user_id field to shares table, the eloipool pool server will not fill this field, so i use this method to fix user_id is null or empty.