mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-10 16:16:47 +00:00
18 lines
497 B
Go
18 lines
497 B
Go
package rpc
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/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
|
|
}
|