mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-14 10:06:40 +00:00
21 lines
494 B
Go
21 lines
494 B
Go
package rpc
|
|
|
|
import "github.com/kaspanet/kaspad/btcjson"
|
|
|
|
// handleGetMempoolInfo implements the getMempoolInfo command.
|
|
func handleGetMempoolInfo(s *Server, cmd interface{}, closeChan <-chan struct{}) (interface{}, error) {
|
|
mempoolTxns := s.cfg.TxMemPool.TxDescs()
|
|
|
|
var numBytes int64
|
|
for _, txD := range mempoolTxns {
|
|
numBytes += int64(txD.Tx.MsgTx().SerializeSize())
|
|
}
|
|
|
|
ret := &btcjson.GetMempoolInfoResult{
|
|
Size: int64(len(mempoolTxns)),
|
|
Bytes: numBytes,
|
|
}
|
|
|
|
return ret, nil
|
|
}
|