4 log "github.com/sirupsen/logrus"
6 "github.com/bytom/protocol/bc/legacy"
9 // Get the parameters of mining
10 func (bcr *BlockchainReactor) getWork() *WorkResp {
12 if block := bcr.mining.GetCurrentBlock(); block == nil {
15 resp.Header = block.BlockHeader
21 // Submit work for mining
22 func (bcr *BlockchainReactor) submitWork(header legacy.BlockHeader) Response {
23 log.Infof("mining:---submitWork header:%v", header)
24 bcr.mining.NotifySpawnBlock(header)
25 return NewSuccessResponse(nil)
28 type WorkResp struct {
29 Header legacy.BlockHeader `json:"header"`