Skip to content

Commit

Permalink
Use blockHash for AcceptedWorkID, not powHash.
Browse files Browse the repository at this point in the history
blockHash is used to construct the AcceptedWorkID when retrieving
AcceptedWork from the database, not the powHash.

Because of this bug, dcrpool was failing to register when a block mined
by the pool had been confirmed, thus it was never sending the coinbase
from that block to the mining participants.
  • Loading branch information
jholdstock committed Oct 18, 2023
1 parent eae107e commit 89c637f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pool/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ func (c *Client) handleSubmitWorkRequest(ctx context.Context, req *Request, allo
return errs.PoolError(errs.WorkRejected, desc)
}

// Create accepted work if the work submission is accepted
// by the mining node.
work := NewAcceptedWork(powHash.String(), header.PrevBlock.String(),
// Create accepted work if the work submission is accepted by the mining
// node.
work := NewAcceptedWork(header.BlockHash().String(), header.PrevBlock.String(),
header.Height, c.FetchAccountID(), miner)
err = c.cfg.db.persistAcceptedWork(work)
if err != nil {
Expand Down

0 comments on commit 89c637f

Please sign in to comment.