You may have noticed some strangeness in the block payouts the last couple days.
Two days ago I noticed the pool wallet had lost 50 LTC, and discovered another simplecoin bug where it was paying for orphans. (not a good thing for a PPLNS zero fee pool!) I tried to fix it and ended up instead breaking things worse. It started paying out all blocks found instantly.
So it was doing that most of the day yesterday, not a huge deal.
Tried to fix it last night though, and broke it in the opposite direction. I did an SQL query with
txid = '' that should have been
txid IS NULL. So for the last 8 hours or so it wasn't paying out at all.
This morning I fixed that. The first cron run after I fixed it paid out all the blocks properly and things are good so far.
I think we should be stable from here on out.
Cheers.
I wondered what was going on, saw a bunch of stuff all go completed at once. Was that part of what was going on?
Yeah, that was the part where it was paying all blocks found instantly. heh. That wasn't a huge issue because we didn't get any orphans during that time.
Simplecoin has a few fundamental logic flaws in how it was connecting up generate and immature blocks with the database of winning shares. To assign a transaction id to a winning share block it was looping through the transaction log oldest to newest and connecting up to the newest winning share from the database. It also didn't have any checking to see if a winning share already had a transaction id before overwriting it. What this meant was that if there was more than one generate block in the time between cron runs, it would assign the wrong transaction ids to the wrong winning share blocks. Since it tracks the confirms by transaction id, this was resulting in orphan blocks getting paid out occasionally, confirm counts being wrong, etc.
I fixed it by reversing the iteration on the transaction log to loop newest to oldest, and inserted checking for if a winning share block already had a transaction id assigned. Cleaned it up nicely.
This particular bug doesn't surprise me much. It's only an issue when you're solving blocks rapidly. Not really something that you have to deal with in BTC very often.
Hope that all makes sense!
Cheers.