mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00

* [NOD-1160] remove activeConfig from config package + update main * [NOD-1160] Update main and addrmanager * [NOD-1160] Update netAdapater * [NOD-1160] Update connmanager * [NOD-1160] Fix connmgr package * [NOD-1160] Fixed DNSSeed functions * [NOD-1160] Fixed protocol package and subpackages * [NOD-1160] Fix p2p package * [NOD-1160] Fix rpc package * [NOD-1160] Fix kaspad a final time * [NOD-1160] Make dnsseed.SeedFromDNS callable outside kaspad * [NOD-1160] Fix tests * [NOD-1160] Pass cfg to kaspad * [NOD-1160] Add comment and remove redundant object * [NOD-1160] Fix typo
25 lines
797 B
Go
25 lines
797 B
Go
package rpc
|
|
|
|
import (
|
|
"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: s.appCfg.Proxy,
|
|
Difficulty: getDifficultyRatio(s.cfg.DAG.CurrentBits(), s.cfg.DAGParams),
|
|
Testnet: s.appCfg.Testnet,
|
|
Devnet: s.appCfg.Devnet,
|
|
RelayFee: s.appCfg.MinRelayTxFee.ToKAS(),
|
|
}
|
|
|
|
return ret, nil
|
|
}
|