mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-12 17:16:43 +00:00
19 lines
529 B
Go
19 lines
529 B
Go
package rpc
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/btcjson"
|
|
"github.com/kaspanet/kaspad/config"
|
|
)
|
|
|
|
// handleGetHashesPerSec implements the getHashesPerSec command.
|
|
func handleGetHashesPerSec(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
|
if config.ActiveConfig().SubnetworkID != nil {
|
|
return nil, &btcjson.RPCError{
|
|
Code: btcjson.ErrRPCInvalidRequest.Code,
|
|
Message: "`getHashesPerSec` is not supported on partial nodes.",
|
|
}
|
|
}
|
|
|
|
return int64(s.cfg.CPUMiner.HashesPerSecond()), nil
|
|
}
|