mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-09-14 13:30:11 +00:00
25 lines
794 B
Go
25 lines
794 B
Go
package rpc
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/network/rpc/model"
|
|
"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 := &model.InfoDAGResult{
|
|
Version: version.Version(),
|
|
ProtocolVersion: int32(maxProtocolVersion),
|
|
Blocks: s.dag.BlockCount(),
|
|
Connections: int32(s.connectionManager.ConnectionCount()),
|
|
Proxy: s.cfg.Proxy,
|
|
Difficulty: getDifficultyRatio(s.dag.CurrentBits(), s.dag.Params),
|
|
Testnet: s.cfg.Testnet,
|
|
Devnet: s.cfg.Devnet,
|
|
RelayFee: s.cfg.MinRelayTxFee.ToKAS(),
|
|
}
|
|
|
|
return ret, nil
|
|
}
|