mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00

* include utxoIndex and isNearlySynced in GetInfo * fmt fixing * add missing IsNearlySynced * change `isNearlySynced` -> `isSynced` & `isUtxoIndexSet` ->`isUtxoIndexed` * Add a check for `HasPeers` to make `isSynced` identical to `GetBlockTemplate.isSynced` Co-authored-by: msutton <mikisiton2@gmail.com>
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package appmessage
|
|
|
|
// GetInfoRequestMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetInfoRequestMessage struct {
|
|
baseMessage
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetInfoRequestMessage) Command() MessageCommand {
|
|
return CmdGetInfoRequestMessage
|
|
}
|
|
|
|
// NewGetInfoRequestMessage returns a instance of the message
|
|
func NewGetInfoRequestMessage() *GetInfoRequestMessage {
|
|
return &GetInfoRequestMessage{}
|
|
}
|
|
|
|
// GetInfoResponseMessage is an appmessage corresponding to
|
|
// its respective RPC message
|
|
type GetInfoResponseMessage struct {
|
|
baseMessage
|
|
P2PID string
|
|
MempoolSize uint64
|
|
ServerVersion string
|
|
IsUtxoIndexed bool
|
|
IsSynced bool
|
|
|
|
Error *RPCError
|
|
}
|
|
|
|
// Command returns the protocol command string for the message
|
|
func (msg *GetInfoResponseMessage) Command() MessageCommand {
|
|
return CmdGetInfoResponseMessage
|
|
}
|
|
|
|
// NewGetInfoResponseMessage returns a instance of the message
|
|
func NewGetInfoResponseMessage(p2pID string, mempoolSize uint64, serverVersion string, isUtxoIndexed bool, isSynced bool) *GetInfoResponseMessage {
|
|
return &GetInfoResponseMessage{
|
|
P2PID: p2pID,
|
|
MempoolSize: mempoolSize,
|
|
ServerVersion: serverVersion,
|
|
IsUtxoIndexed: isUtxoIndexed,
|
|
IsSynced: isSynced,
|
|
}
|
|
}
|