GetBlok-io / miningcore

Miningcore is a high-performance Mining Pool Software for Linux and Windows maintained by GetBlok.io
https://www.getblok.io
MIT License
2 stars 1 forks source link

Ergo PayoutManager not paying shares balance to miners - insufficient funds in pool wallet #5

Open vinnielima opened 2 years ago

vinnielima commented 2 years ago

If a pool accumulates a number of block rewards in quick succession, the payout manager is unable to payout any of the blocks founds even if one has been confirmed and paid to pool's reward wallet.

This is because it is looking at all mined blocks, regardless of which ones have been confirmed, and determining which ones a payment is due based on the 'balances' postgresql table.

Below is an excerpt from the stratum log:

[2021-11-22 11:26:25.9212] [I] [PayoutManager] Processing payments for pool ergo1, block 625023 [2021-11-22 11:26:25.9318] [I] [PayoutManager] Processing payments for pool ergo1, block 625420 [2021-11-22 11:26:25.9436] [I] [PayoutManager] Processing payments for pool ergo1, block 625448 [2021-11-22 11:26:25.9680] [I] [ergo1] [Ergo Payout Handler] Paying 134.97301 ERG to 62 addresses [2021-11-22 11:26:26.0105] [I] [ergo1] [Ergo Payout Handler] Unlocking wallet [2021-11-22 11:26:26.5814] [I] [ergo1] [Ergo Payout Handler] Wallet unlocked [2021-11-22 11:26:26.5971] [I] [ergo1] [Ergo Payout Handler] Current wallet balance is 68.69706 ERG [2021-11-22 11:26:26.5976] [W] [ergo1] [Ergo Payout Handler] Wallet balance currently short of 66.27614 ERG. Will try again. [2021-11-22 11:26:26.5976] [I] [ergo1] [Ergo Payout Handler] Locking wallet [2021-11-22 11:26:26.6078] [I] [ergo1] [Ergo Payout Handler] Wallet locked

As you can see, below only one block is confirmed:

image

Because of this, it is unable to payout the confirmed block until the other two are confirmed and/or sufficient funds are available.

Need to address the validation made that a block is confirmed before attempting payout.