mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-10 16:16:47 +00:00

* [NOD-275] Moved getBlockTemplate and related functionality to a separate file. * [NOD-275] Started moving handlers to separate files. * [NOD-275] Fixed merge errors. * [NOD-275] Moved all handlers out of rpcserver.go. * [NOD-275] Moved non-shared functions out of rpcserver.go. * [NOD-275] Moved handleGetAllManualNodesInfo to a separate file. * [NOD-275] Moved handlers out of rpcwebsocket.go to separate files. * [NOD-275] Fixed import error. * [NOD-275] Renamed all handler files to include underscores. * [NOD-275] Moved common rpc helper functions to common.go.
18 lines
494 B
Go
18 lines
494 B
Go
package rpc
|
|
|
|
import (
|
|
"github.com/daglabs/btcd/btcjson"
|
|
"time"
|
|
)
|
|
|
|
// handleGetNetTotals implements the getNetTotals command.
|
|
func handleGetNetTotals(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
|
totalBytesRecv, totalBytesSent := s.cfg.ConnMgr.NetTotals()
|
|
reply := &btcjson.GetNetTotalsResult{
|
|
TotalBytesRecv: totalBytesRecv,
|
|
TotalBytesSent: totalBytesSent,
|
|
TimeMillis: time.Now().UTC().UnixNano() / int64(time.Millisecond),
|
|
}
|
|
return reply, nil
|
|
}
|