kaspad/server/rpc/handle_get_info.go
Ori Newman 8909679f44
[NOD-818] Remove time adjustment (#658)
* [NOD-818] Remove time adjustment

* [NOD-818] Remove interface ensuring and copyright message

* [NOD-818] Update comment
2020-03-15 17:37:01 +02:00

26 lines
886 B
Go

package rpc
import (
"github.com/kaspanet/kaspad/config"
"github.com/kaspanet/kaspad/rpcmodel"
"github.com/kaspanet/kaspad/version"
)
// handleGetInfo implements the getInfo command. We only return the fields
// that are not related to wallet functionality.
func handleGetInfo(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
ret := &rpcmodel.InfoDAGResult{
Version: version.Version(),
ProtocolVersion: int32(maxProtocolVersion),
Blocks: s.cfg.DAG.BlockCount(),
Connections: s.cfg.ConnMgr.ConnectedCount(),
Proxy: config.ActiveConfig().Proxy,
Difficulty: getDifficultyRatio(s.cfg.DAG.CurrentBits(), s.cfg.DAGParams),
Testnet: config.ActiveConfig().Testnet,
Devnet: config.ActiveConfig().Devnet,
RelayFee: config.ActiveConfig().MinRelayTxFee.ToKAS(),
}
return ret, nil
}