Skip to content

Commit

Permalink
multi: use generated block template in rpc handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnldd committed Jan 19, 2019
1 parent 9adebf5 commit bf3fdde
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 379 deletions.
9 changes: 9 additions & 0 deletions mining.go
Original file line number Diff line number Diff line change
Expand Up @@ -2072,6 +2072,15 @@ func newBgBlkTmplGenerator(tg *BlkTmplGenerator, addrs []dcrutil.Address, permit
}
}

// fetchTemplate retrieves a block template from the template pool based on the
// provided key.
func (g *BgBlkTmplGenerator) fetchTemplate(key [merkleRootPairSize]byte) *wire.MsgBlock {
g.templatePoolMtx.Lock()
template := g.templatePool[key]
g.templatePoolMtx.Unlock()
return template
}

// scheduleRegen schedules a template regeneration by the provided duration
// in the future. If there is an existing schedule in play the sheduled time
// reset to updated the provided duration.
Expand Down
Loading

0 comments on commit bf3fdde

Please sign in to comment.