mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-21 06:16:45 +00:00

* fix mempool accessing, rewrite get_mempool_entries_by_addresses * fix counter, add verbose * fmt * addresses as string * Define error in case utxoEntry is missing. * fix error variable to string * stop tests from failing (see in code comment) * access both pools in the same state via parameters * get rid of todo message * fmt - very important! * perf: scriptpublickey in mempool, no txscript. * address reveiw * fmt fix * mixed up isorphan bool, pass tests now * do map preallocation in mempoolbyaddresses * no proallocation for orphanpool sending. Co-authored-by: Ori Newman <orinewman1@gmail.com>
27 lines
823 B
Go
27 lines
823 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"
|
|
"github.com/kaspanet/kaspad/version"
|
|
)
|
|
|
|
// HandleGetInfo handles the respectively named RPC command
|
|
func HandleGetInfo(context *rpccontext.Context, _ *router.Router, _ appmessage.Message) (appmessage.Message, error) {
|
|
isNearlySynced, err := context.Domain.Consensus().IsNearlySynced()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := appmessage.NewGetInfoResponseMessage(
|
|
context.NetAdapter.ID().String(),
|
|
uint64(context.Domain.MiningManager().TransactionCount(true, false)),
|
|
version.Version(),
|
|
context.Config.UTXOIndex,
|
|
context.ProtocolManager.Context().HasPeers() && isNearlySynced,
|
|
)
|
|
|
|
return response, nil
|
|
}
|