From 89c637f346bbc48c8ff38410399ca12f460ef9c6 Mon Sep 17 00:00:00 2001 From: jholdstock Date: Wed, 18 Oct 2023 07:33:04 +0100 Subject: [PATCH] Use blockHash for AcceptedWorkID, not powHash. 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. --- pool/client.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pool/client.go b/pool/client.go index 63e4c268..65c70b1b 100644 --- a/pool/client.go +++ b/pool/client.go @@ -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 {