Skip to content

Commit

Permalink
remove clone
Browse files Browse the repository at this point in the history
  • Loading branch information
frankcrypto committed Jan 29, 2024
1 parent 0689499 commit b23e554
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions services/miner/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,17 +180,13 @@ func (api *PublicMinerAPI) GetRemoteGBT(powType byte, extraNonce *bool) (interfa
return nil, err
}
resp := <-reply
block, err := api.miner.template.Block.Clone()
if err != nil {
return nil, err
}
txcount := len(block.Transactions)
txcount := len(api.miner.template.Block.Transactions)
if err := api.checkGBTTime(txcount); err != nil {
api.miner.stats.MempoolEmptyWarns++
return nil, err
}
api.miner.stats.LastestMempoolEmptyTimestamp = 0
api.miner.StatsGbtRequest(time.Now().UnixMilli()-start, txcount, block.Header.ParentRoot.String())
api.miner.StatsGbtRequest(time.Now().UnixMilli()-start, txcount, api.miner.template.Block.Header.ParentRoot.String())
return resp.result, resp.err
}

Expand Down

0 comments on commit b23e554

Please sign in to comment.