rpc/jsonrpc/types: Add invalidate/reconsiderblock.

This adds the command types for the upcoming invalidateblock and
reconsiderblock RPC commands.
This commit is contained in:
Dave Collins 2020-12-29 20:40:46 -06:00
parent fd92d7c85a
commit 970a56e644
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2

View File

@ -859,6 +859,19 @@ func NewHelpCmd(command *string) *HelpCmd {
}
}
// InvalidateBlockCmd defines the invalidateblock JSON-RPC command.
type InvalidateBlockCmd struct {
BlockHash string
}
// NewInvalidateBlockCmd returns a new instance which can be used to issue an
// invalidateblock JSON-RPC command.
func NewInvalidateBlockCmd(hash string) *InvalidateBlockCmd {
return &InvalidateBlockCmd{
BlockHash: hash,
}
}
// LiveTicketsCmd is a type handling custom marshaling and
// unmarshaling of livetickets JSON RPC commands.
type LiveTicketsCmd struct{}
@ -908,6 +921,19 @@ func NewPingCmd() *PingCmd {
return &PingCmd{}
}
// ReconsiderBlockCmd defines the reconsiderblock JSON-RPC command.
type ReconsiderBlockCmd struct {
BlockHash string
}
// NewReconsiderBlockCmd returns a new instance which can be used to issue a
// reconsiderblock JSON-RPC command.
func NewReconsiderBlockCmd(hash string) *ReconsiderBlockCmd {
return &ReconsiderBlockCmd{
BlockHash: hash,
}
}
// SearchRawTransactionsCmd defines the searchrawtransactions JSON-RPC command.
type SearchRawTransactionsCmd struct {
Address string
@ -1179,10 +1205,12 @@ func init() {
dcrjson.MustRegister(Method("getvoteinfo"), (*GetVoteInfoCmd)(nil), flags)
dcrjson.MustRegister(Method("getwork"), (*GetWorkCmd)(nil), flags)
dcrjson.MustRegister(Method("help"), (*HelpCmd)(nil), flags)
dcrjson.MustRegister(Method("invalidateblock"), (*InvalidateBlockCmd)(nil), flags)
dcrjson.MustRegister(Method("livetickets"), (*LiveTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("missedtickets"), (*MissedTicketsCmd)(nil), flags)
dcrjson.MustRegister(Method("node"), (*NodeCmd)(nil), flags)
dcrjson.MustRegister(Method("ping"), (*PingCmd)(nil), flags)
dcrjson.MustRegister(Method("reconsiderblock"), (*ReconsiderBlockCmd)(nil), flags)
dcrjson.MustRegister(Method("regentemplate"), (*RegenTemplateCmd)(nil), flags)
dcrjson.MustRegister(Method("searchrawtransactions"), (*SearchRawTransactionsCmd)(nil), flags)
dcrjson.MustRegister(Method("sendrawtransaction"), (*SendRawTransactionCmd)(nil), flags)