mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-25 16:26:48 +00:00

* Add the mempool size to getInfo RPC command * Add mempool.Len() * Rename mempool.Len() to mempool.TransactionCount() Co-authored-by: Svarog <feanorr@gmail.com>
18 lines
552 B
Go
18 lines
552 B
Go
package rpchandlers
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/app/appmessage"
|
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
"github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
|
)
|
|
|
|
// HandleGetInfo handles the respectively named RPC command
|
|
func HandleGetInfo(context *rpccontext.Context, _ *router.Router, _ appmessage.Message) (appmessage.Message, error) {
|
|
response := appmessage.NewGetInfoResponseMessage(
|
|
context.NetAdapter.ID().String(),
|
|
uint64(context.Domain.MiningManager().TransactionCount()),
|
|
)
|
|
|
|
return response, nil
|
|
}
|