mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-25 23:15:55 +00:00
golint: Id -> ID
This commit is contained in:
parent
07978077ac
commit
34813d3b16
@ -3,7 +3,7 @@ package appmessage
|
||||
// NotifyBlockAddedRequestMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyBlockAddedRequestMessage struct {
|
||||
Id string
|
||||
ID string
|
||||
baseMessage
|
||||
}
|
||||
|
||||
@ -14,14 +14,14 @@ func (msg *NotifyBlockAddedRequestMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyBlockAddedRequestMessage returns a instance of the message
|
||||
func NewNotifyBlockAddedRequestMessage(id string) *NotifyBlockAddedRequestMessage {
|
||||
return &NotifyBlockAddedRequestMessage{Id: id}
|
||||
return &NotifyBlockAddedRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyBlockAddedResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyBlockAddedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -32,14 +32,14 @@ func (msg *NotifyBlockAddedResponseMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyBlockAddedResponseMessage returns a instance of the message
|
||||
func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMessage {
|
||||
return &NotifyBlockAddedResponseMessage{Id: id}
|
||||
return &NotifyBlockAddedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// BlockAddedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type BlockAddedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Block *RPCBlock
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ func (msg *BlockAddedNotificationMessage) Command() MessageCommand {
|
||||
// NewBlockAddedNotificationMessage returns a instance of the message
|
||||
func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage {
|
||||
return &BlockAddedNotificationMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
Block: block,
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyFinalityConflictsRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -14,14 +14,14 @@ func (msg *NotifyFinalityConflictsRequestMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyFinalityConflictsRequestMessage returns a instance of the message
|
||||
func NewNotifyFinalityConflictsRequestMessage(id string) *NotifyFinalityConflictsRequestMessage {
|
||||
return &NotifyFinalityConflictsRequestMessage{Id: id}
|
||||
return &NotifyFinalityConflictsRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyFinalityConflictsResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyFinalityConflictsResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -32,14 +32,14 @@ func (msg *NotifyFinalityConflictsResponseMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyFinalityConflictsResponseMessage returns a instance of the message
|
||||
func NewNotifyFinalityConflictsResponseMessage(id string) *NotifyFinalityConflictsResponseMessage {
|
||||
return &NotifyFinalityConflictsResponseMessage{Id: id}
|
||||
return &NotifyFinalityConflictsResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// FinalityConflictNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type FinalityConflictNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
ViolatingBlockHash string
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ func (msg *FinalityConflictNotificationMessage) Command() MessageCommand {
|
||||
// NewFinalityConflictNotificationMessage returns a instance of the message
|
||||
func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string) *FinalityConflictNotificationMessage {
|
||||
return &FinalityConflictNotificationMessage{
|
||||
ID: id,
|
||||
ViolatingBlockHash: violatingBlockHash,
|
||||
}
|
||||
}
|
||||
@ -59,7 +60,7 @@ func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string
|
||||
// its respective RPC message
|
||||
type FinalityConflictResolvedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
FinalityBlockHash string
|
||||
}
|
||||
|
||||
@ -71,7 +72,7 @@ func (msg *FinalityConflictResolvedNotificationMessage) Command() MessageCommand
|
||||
// NewFinalityConflictResolvedNotificationMessage returns a instance of the message
|
||||
func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string, id string) *FinalityConflictResolvedNotificationMessage {
|
||||
return &FinalityConflictResolvedNotificationMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
FinalityBlockHash: finalityBlockHash,
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyNewBlockTemplateRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -14,14 +14,14 @@ func (msg *NotifyNewBlockTemplateRequestMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyNewBlockTemplateRequestMessage returns an instance of the message
|
||||
func NewNotifyNewBlockTemplateRequestMessage(id string) *NotifyNewBlockTemplateRequestMessage {
|
||||
return &NotifyNewBlockTemplateRequestMessage{Id: id}
|
||||
return &NotifyNewBlockTemplateRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyNewBlockTemplateResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyNewBlockTemplateResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -32,14 +32,14 @@ func (msg *NotifyNewBlockTemplateResponseMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyNewBlockTemplateResponseMessage returns an instance of the message
|
||||
func NewNotifyNewBlockTemplateResponseMessage(id string) *NotifyNewBlockTemplateResponseMessage {
|
||||
return &NotifyNewBlockTemplateResponseMessage{Id: id}
|
||||
return &NotifyNewBlockTemplateResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// NewBlockTemplateNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NewBlockTemplateNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -49,5 +49,5 @@ func (msg *NewBlockTemplateNotificationMessage) Command() MessageCommand {
|
||||
|
||||
// NewNewBlockTemplateNotificationMessage returns an instance of the message
|
||||
func NewNewBlockTemplateNotificationMessage(id string) *NewBlockTemplateNotificationMessage {
|
||||
return &NewBlockTemplateNotificationMessage{Id: id}
|
||||
return &NewBlockTemplateNotificationMessage{ID: id}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyPruningPointUTXOSetOverrideRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -14,13 +14,14 @@ func (msg *NotifyPruningPointUTXOSetOverrideRequestMessage) Command() MessageCom
|
||||
|
||||
// NewNotifyPruningPointUTXOSetOverrideRequestMessage returns a instance of the message
|
||||
func NewNotifyPruningPointUTXOSetOverrideRequestMessage(id string) *NotifyPruningPointUTXOSetOverrideRequestMessage {
|
||||
return &NotifyPruningPointUTXOSetOverrideRequestMessage{}
|
||||
return &NotifyPruningPointUTXOSetOverrideRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
baseMessage
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -31,13 +32,14 @@ func (msg *NotifyPruningPointUTXOSetOverrideResponseMessage) Command() MessageCo
|
||||
|
||||
// NewNotifyPruningPointUTXOSetOverrideResponseMessage returns a instance of the message
|
||||
func NewNotifyPruningPointUTXOSetOverrideResponseMessage(id string) *NotifyPruningPointUTXOSetOverrideResponseMessage {
|
||||
return &NotifyPruningPointUTXOSetOverrideResponseMessage{}
|
||||
return &NotifyPruningPointUTXOSetOverrideResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// PruningPointUTXOSetOverrideNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type PruningPointUTXOSetOverrideNotificationMessage struct {
|
||||
baseMessage
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -47,14 +49,14 @@ func (msg *PruningPointUTXOSetOverrideNotificationMessage) Command() MessageComm
|
||||
|
||||
// NewPruningPointUTXOSetOverrideNotificationMessage returns a instance of the message
|
||||
func NewPruningPointUTXOSetOverrideNotificationMessage(id string) *PruningPointUTXOSetOverrideNotificationMessage {
|
||||
return &PruningPointUTXOSetOverrideNotificationMessage{}
|
||||
return &PruningPointUTXOSetOverrideNotificationMessage{ID: id}
|
||||
}
|
||||
|
||||
// StopNotifyingPruningPointUTXOSetOverrideRequestMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type StopNotifyingPruningPointUTXOSetOverrideRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -64,13 +66,14 @@ func (msg *StopNotifyingPruningPointUTXOSetOverrideRequestMessage) Command() Mes
|
||||
|
||||
// NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage returns a instance of the message
|
||||
func NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideRequestMessage {
|
||||
return &StopNotifyingPruningPointUTXOSetOverrideRequestMessage{Id: id}
|
||||
return &StopNotifyingPruningPointUTXOSetOverrideRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// StopNotifyingPruningPointUTXOSetOverrideResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type StopNotifyingPruningPointUTXOSetOverrideResponseMessage struct {
|
||||
baseMessage
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -81,5 +84,5 @@ func (msg *StopNotifyingPruningPointUTXOSetOverrideResponseMessage) Command() Me
|
||||
|
||||
// NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage returns a instance of the message
|
||||
func NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(id string) *StopNotifyingPruningPointUTXOSetOverrideResponseMessage {
|
||||
return &StopNotifyingPruningPointUTXOSetOverrideResponseMessage{}
|
||||
return &StopNotifyingPruningPointUTXOSetOverrideResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyUTXOsChangedRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Addresses []string
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ func (msg *NotifyUTXOsChangedRequestMessage) Command() MessageCommand {
|
||||
// NewNotifyUTXOsChangedRequestMessage returns a instance of the message
|
||||
func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyUTXOsChangedRequestMessage {
|
||||
return &NotifyUTXOsChangedRequestMessage{
|
||||
ID: id,
|
||||
Addresses: addresses,
|
||||
}
|
||||
}
|
||||
@ -24,7 +25,7 @@ func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyU
|
||||
// its respective RPC message
|
||||
type NotifyUTXOsChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -35,14 +36,14 @@ func (msg *NotifyUTXOsChangedResponseMessage) Command() MessageCommand {
|
||||
|
||||
// NewNotifyUTXOsChangedResponseMessage returns a instance of the message
|
||||
func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponseMessage {
|
||||
return &NotifyUTXOsChangedResponseMessage{Id: id}
|
||||
return &NotifyUTXOsChangedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// UTXOsChangedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type UTXOsChangedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Added []*UTXOsByAddressesEntry
|
||||
Removed []*UTXOsByAddressesEntry
|
||||
}
|
||||
@ -61,5 +62,5 @@ func (msg *UTXOsChangedNotificationMessage) Command() MessageCommand {
|
||||
|
||||
// NewUTXOsChangedNotificationMessage returns a instance of the message
|
||||
func NewUTXOsChangedNotificationMessage(id string) *UTXOsChangedNotificationMessage {
|
||||
return &UTXOsChangedNotificationMessage{Id: id}
|
||||
return &UTXOsChangedNotificationMessage{ID: id}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyVirtualDaaScoreChangedRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -14,14 +14,14 @@ func (msg *NotifyVirtualDaaScoreChangedRequestMessage) Command() MessageCommand
|
||||
|
||||
// NewNotifyVirtualDaaScoreChangedRequestMessage returns a instance of the message
|
||||
func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaScoreChangedRequestMessage {
|
||||
return &NotifyVirtualDaaScoreChangedRequestMessage{Id: id}
|
||||
return &NotifyVirtualDaaScoreChangedRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyVirtualDaaScoreChangedResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyVirtualDaaScoreChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -32,14 +32,14 @@ func (msg *NotifyVirtualDaaScoreChangedResponseMessage) Command() MessageCommand
|
||||
|
||||
// NewNotifyVirtualDaaScoreChangedResponseMessage returns a instance of the message
|
||||
func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaaScoreChangedResponseMessage {
|
||||
return &NotifyVirtualDaaScoreChangedResponseMessage{Id: id}
|
||||
return &NotifyVirtualDaaScoreChangedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// VirtualDaaScoreChangedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type VirtualDaaScoreChangedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
VirtualDaaScore uint64
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ func NewVirtualDaaScoreChangedNotificationMessage(
|
||||
virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage {
|
||||
|
||||
return &VirtualDaaScoreChangedNotificationMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
VirtualDaaScore: virtualDaaScore,
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyVirtualSelectedParentBlueScoreChangedRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
}
|
||||
|
||||
// Command returns the protocol command string for the message
|
||||
@ -14,14 +14,14 @@ func (msg *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) Command()
|
||||
|
||||
// NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message
|
||||
func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {
|
||||
return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{Id: id}
|
||||
return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{ID: id}
|
||||
}
|
||||
|
||||
// NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -32,14 +32,14 @@ func (msg *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage) Command()
|
||||
|
||||
// NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage returns a instance of the message
|
||||
func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedResponseMessage {
|
||||
return &NotifyVirtualSelectedParentBlueScoreChangedResponseMessage{}
|
||||
return &NotifyVirtualSelectedParentBlueScoreChangedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// VirtualSelectedParentBlueScoreChangedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
VirtualSelectedParentBlueScore uint64
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ func NewVirtualSelectedParentBlueScoreChangedNotificationMessage(
|
||||
virtualSelectedParentBlueScore uint64, id string) *VirtualSelectedParentBlueScoreChangedNotificationMessage {
|
||||
|
||||
return &VirtualSelectedParentBlueScoreChangedNotificationMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
VirtualSelectedParentBlueScore: virtualSelectedParentBlueScore,
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
IncludeAcceptedTransactionIDs bool
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
|
||||
includeAcceptedTransactionIDs bool, id string) *NotifyVirtualSelectedParentChainChangedRequestMessage {
|
||||
|
||||
return &NotifyVirtualSelectedParentChainChangedRequestMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
IncludeAcceptedTransactionIDs: includeAcceptedTransactionIDs,
|
||||
}
|
||||
}
|
||||
@ -27,7 +27,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
|
||||
// its respective RPC message
|
||||
type NotifyVirtualSelectedParentChainChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -38,14 +38,14 @@ func (msg *NotifyVirtualSelectedParentChainChangedResponseMessage) Command() Mes
|
||||
|
||||
// NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message
|
||||
func NewNotifyVirtualSelectedParentChainChangedResponseMessage(id string) *NotifyVirtualSelectedParentChainChangedResponseMessage {
|
||||
return &NotifyVirtualSelectedParentChainChangedResponseMessage{Id: id}
|
||||
return &NotifyVirtualSelectedParentChainChangedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
// VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to
|
||||
// its respective RPC message
|
||||
type VirtualSelectedParentChainChangedNotificationMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
RemovedChainBlockHashes []string
|
||||
AddedChainBlockHashes []string
|
||||
AcceptedTransactionIDs []*AcceptedTransactionIDs
|
||||
@ -61,7 +61,7 @@ func NewVirtualSelectedParentChainChangedNotificationMessage(removedChainBlockHa
|
||||
addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs, id string) *VirtualSelectedParentChainChangedNotificationMessage {
|
||||
|
||||
return &VirtualSelectedParentChainChangedNotificationMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
RemovedChainBlockHashes: removedChainBlockHashes,
|
||||
AddedChainBlockHashes: addedChainBlocks,
|
||||
AcceptedTransactionIDs: acceptedTransactionIDs,
|
||||
|
||||
@ -4,7 +4,7 @@ package appmessage
|
||||
// its respective RPC message
|
||||
type StopNotifyingUTXOsChangedRequestMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Addresses []string
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ func (msg *StopNotifyingUTXOsChangedRequestMessage) Command() MessageCommand {
|
||||
// NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message
|
||||
func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *StopNotifyingUTXOsChangedRequestMessage {
|
||||
return &StopNotifyingUTXOsChangedRequestMessage{
|
||||
Id: id,
|
||||
ID: id,
|
||||
Addresses: addresses,
|
||||
}
|
||||
}
|
||||
@ -25,7 +25,7 @@ func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *
|
||||
// its respective RPC message
|
||||
type StopNotifyingUTXOsChangedResponseMessage struct {
|
||||
baseMessage
|
||||
Id string
|
||||
ID string
|
||||
Error *RPCError
|
||||
}
|
||||
|
||||
@ -36,5 +36,5 @@ func (msg *StopNotifyingUTXOsChangedResponseMessage) Command() MessageCommand {
|
||||
|
||||
// NewStopNotifyingUTXOsChangedResponseMessage returns a instance of the message
|
||||
func NewStopNotifyingUTXOsChangedResponseMessage(id string) *StopNotifyingUTXOsChangedResponseMessage {
|
||||
return &StopNotifyingUTXOsChangedResponseMessage{Id: id}
|
||||
return &StopNotifyingUTXOsChangedResponseMessage{ID: id}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ func (m *Manager) NotifyFinalityConflict(violatingBlockHash string) error {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflict")
|
||||
defer onEnd()
|
||||
|
||||
notification := appmessage.NewFinalityConflictNotificationMessage(violatingBlockHash, rpccontext.DefaultNotificationId)
|
||||
notification := appmessage.NewFinalityConflictNotificationMessage(violatingBlockHash, rpccontext.DefaultNotificationID)
|
||||
return m.context.NotificationManager.NotifyFinalityConflict(notification)
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ func (m *Manager) NotifyFinalityConflictResolved(finalityBlockHash string) error
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyFinalityConflictResolved")
|
||||
defer onEnd()
|
||||
|
||||
notification := appmessage.NewFinalityConflictResolvedNotificationMessage(finalityBlockHash, rpccontext.DefaultNotificationId)
|
||||
notification := appmessage.NewFinalityConflictResolvedNotificationMessage(finalityBlockHash, rpccontext.DefaultNotificationID)
|
||||
return m.context.NotificationManager.NotifyFinalityConflictResolved(notification)
|
||||
}
|
||||
|
||||
@ -207,7 +207,7 @@ func (m *Manager) notifyVirtualSelectedParentBlueScoreChanged(virtualSelectedPar
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualSelectedParentBlueScoreChanged")
|
||||
defer onEnd()
|
||||
|
||||
notification := appmessage.NewVirtualSelectedParentBlueScoreChangedNotificationMessage(virtualSelectedParentBlueScore, rpccontext.DefaultNotificationId)
|
||||
notification := appmessage.NewVirtualSelectedParentBlueScoreChangedNotificationMessage(virtualSelectedParentBlueScore, rpccontext.DefaultNotificationID)
|
||||
return m.context.NotificationManager.NotifyVirtualSelectedParentBlueScoreChanged(notification)
|
||||
}
|
||||
|
||||
@ -215,7 +215,7 @@ func (m *Manager) notifyVirtualDaaScoreChanged(virtualDAAScore uint64) error {
|
||||
onEnd := logger.LogAndMeasureExecutionTime(log, "RPCManager.NotifyVirtualDaaScoreChanged")
|
||||
defer onEnd()
|
||||
|
||||
notification := appmessage.NewVirtualDaaScoreChangedNotificationMessage(virtualDAAScore, rpccontext.DefaultNotificationId)
|
||||
notification := appmessage.NewVirtualDaaScoreChangedNotificationMessage(virtualDAAScore, rpccontext.DefaultNotificationID)
|
||||
return m.context.NotificationManager.NotifyVirtualDaaScoreChanged(notification)
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ func (ctx *Context) ConvertVirtualSelectedParentChainChangesToChainChangedNotifi
|
||||
}
|
||||
|
||||
return appmessage.NewVirtualSelectedParentChainChangedNotificationMessage(
|
||||
removedChainBlockHashes, addedChainBlocks, acceptedTransactionIDs, DefaultNotificationId), nil
|
||||
removedChainBlockHashes, addedChainBlocks, acceptedTransactionIDs, DefaultNotificationID), nil
|
||||
}
|
||||
|
||||
func (ctx *Context) getAndConvertAcceptedTransactionIDs(selectedParentChainChanges *externalapi.SelectedChainPath) (
|
||||
|
||||
@ -13,7 +13,8 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const DefaultNotificationId = "" //empty string corrosponds to defualt grpc string value, and hence id value when not supplied
|
||||
// DefaultNotificationID corrosponds to defualt grpc string value, and hence id value when not supplied, or as placeholder
|
||||
const DefaultNotificationID = ""
|
||||
|
||||
// NotificationManager manages notifications for the RPC
|
||||
type NotificationManager struct {
|
||||
@ -33,24 +34,25 @@ type UTXOsChangedNotificationAddress struct {
|
||||
type NotificationListener struct {
|
||||
params *dagconfig.Params
|
||||
|
||||
propagateBlockAddedNotifications bool
|
||||
propagateBlockAddedNotificationsId string
|
||||
propagateVirtualSelectedParentChainChangedNotifications bool
|
||||
propagateVirtualSelectedParentChainChangedNotificationsId string
|
||||
propagateFinalityConflictNotifications bool
|
||||
propagateFinalityConflictNotificationsId string
|
||||
propagateFinalityConflictResolvedNotifications bool
|
||||
propagateFinalityConflictResolvedNotificationsId string
|
||||
propagateUTXOsChangedNotifications bool
|
||||
propagateUTXOsChangedNotificationsId string
|
||||
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
|
||||
propagateVirtualSelectedParentBlueScoreChangedNotificationsId string
|
||||
propagateVirtualDaaScoreChangedNotifications bool
|
||||
propagateVirtualDaaScoreChangedNotificationsId string
|
||||
propagatePruningPointUTXOSetOverrideNotifications bool
|
||||
propagatePruningPointUTXOSetOverrideNotificationsId string
|
||||
propagateNewBlockTemplateNotifications bool
|
||||
propagateNewBlockTemplateNotificationsId string
|
||||
propagateBlockAddedNotifications bool
|
||||
propagateVirtualSelectedParentChainChangedNotifications bool
|
||||
propagateFinalityConflictNotifications bool
|
||||
propagateFinalityConflictResolvedNotifications bool
|
||||
propagateUTXOsChangedNotifications bool
|
||||
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
|
||||
propagateVirtualDaaScoreChangedNotifications bool
|
||||
propagatePruningPointUTXOSetOverrideNotifications bool
|
||||
propagateNewBlockTemplateNotifications bool
|
||||
|
||||
propagateBlockAddedNotificationsID string
|
||||
propagateVirtualSelectedParentChainChangedNotificationsID string
|
||||
propagateFinalityConflictNotificationsID string
|
||||
propagateFinalityConflictResolvedNotificationsID string
|
||||
propagateUTXOsChangedNotificationsID string
|
||||
propagateVirtualSelectedParentBlueScoreChangedNotificationsID string
|
||||
propagateVirtualDaaScoreChangedNotificationsID string
|
||||
propagatePruningPointUTXOSetOverrideNotificationsID string
|
||||
propagateNewBlockTemplateNotificationsID string
|
||||
|
||||
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
|
||||
includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool
|
||||
@ -114,7 +116,7 @@ func (nm *NotificationManager) NotifyBlockAdded(notification *appmessage.BlockAd
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateBlockAddedNotifications {
|
||||
|
||||
notification.Id = listener.propagateBlockAddedNotificationsId
|
||||
notification.ID = listener.propagateBlockAddedNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
||||
if err != nil {
|
||||
@ -141,7 +143,7 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentChainChanged(
|
||||
if listener.propagateVirtualSelectedParentChainChangedNotifications {
|
||||
var err error
|
||||
|
||||
notification.Id = listener.propagateVirtualSelectedParentChainChangedNotificationsId
|
||||
notification.ID = listener.propagateVirtualSelectedParentChainChangedNotificationsID
|
||||
|
||||
if listener.includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications {
|
||||
err = router.OutgoingRoute().MaybeEnqueue(notification)
|
||||
@ -177,7 +179,7 @@ func (nm *NotificationManager) NotifyFinalityConflict(notification *appmessage.F
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateFinalityConflictNotifications {
|
||||
|
||||
notification.Id = listener.propagateFinalityConflictNotificationsId
|
||||
notification.ID = listener.propagateFinalityConflictNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().Enqueue(notification)
|
||||
if err != nil {
|
||||
@ -196,7 +198,7 @@ func (nm *NotificationManager) NotifyFinalityConflictResolved(notification *appm
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateFinalityConflictResolvedNotifications {
|
||||
|
||||
notification.Id = listener.propagateFinalityConflictResolvedNotificationsId
|
||||
notification.ID = listener.propagateFinalityConflictResolvedNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().Enqueue(notification)
|
||||
if err != nil {
|
||||
@ -220,7 +222,7 @@ func (nm *NotificationManager) NotifyUTXOsChanged(utxoChanges *utxoindex.UTXOCha
|
||||
return err
|
||||
}
|
||||
|
||||
notification.Id = listener.propagateUTXOsChangedNotificationsId
|
||||
notification.ID = listener.propagateUTXOsChangedNotificationsID
|
||||
|
||||
// Don't send the notification if it's empty
|
||||
if len(notification.Added) == 0 && len(notification.Removed) == 0 {
|
||||
@ -248,7 +250,7 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged(
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateVirtualSelectedParentBlueScoreChangedNotifications {
|
||||
|
||||
notification.Id = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsId
|
||||
notification.ID = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
||||
if err != nil {
|
||||
@ -270,7 +272,7 @@ func (nm *NotificationManager) NotifyVirtualDaaScoreChanged(
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateVirtualDaaScoreChangedNotifications {
|
||||
|
||||
notification.Id = listener.propagateVirtualDaaScoreChangedNotificationsId
|
||||
notification.ID = listener.propagateVirtualDaaScoreChangedNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
||||
if err != nil {
|
||||
@ -292,7 +294,7 @@ func (nm *NotificationManager) NotifyNewBlockTemplate(
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagateNewBlockTemplateNotifications {
|
||||
|
||||
notification.Id = listener.propagateNewBlockTemplateNotificationsId
|
||||
notification.ID = listener.propagateNewBlockTemplateNotificationsID
|
||||
|
||||
err := router.OutgoingRoute().Enqueue(notification)
|
||||
if err != nil {
|
||||
@ -311,7 +313,7 @@ func (nm *NotificationManager) NotifyPruningPointUTXOSetOverride() error {
|
||||
|
||||
for router, listener := range nm.listeners {
|
||||
if listener.propagatePruningPointUTXOSetOverrideNotifications {
|
||||
err := router.OutgoingRoute().Enqueue(appmessage.NewPruningPointUTXOSetOverrideNotificationMessage(listener.propagatePruningPointUTXOSetOverrideNotificationsId))
|
||||
err := router.OutgoingRoute().Enqueue(appmessage.NewPruningPointUTXOSetOverrideNotificationMessage(listener.propagatePruningPointUTXOSetOverrideNotificationsID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -344,7 +346,7 @@ func (nl *NotificationListener) IncludeAcceptedTransactionIDsInVirtualSelectedPa
|
||||
// PropagateBlockAddedNotifications instructs the listener to send block added notifications
|
||||
// to the remote listener
|
||||
func (nl *NotificationListener) PropagateBlockAddedNotifications(id string) {
|
||||
nl.propagateBlockAddedNotificationsId = id
|
||||
nl.propagateBlockAddedNotificationsID = id
|
||||
nl.propagateBlockAddedNotifications = true
|
||||
}
|
||||
|
||||
@ -358,14 +360,14 @@ func (nl *NotificationListener) PropagateVirtualSelectedParentChainChangedNotifi
|
||||
// PropagateFinalityConflictNotifications instructs the listener to send finality conflict notifications
|
||||
// to the remote listener
|
||||
func (nl *NotificationListener) PropagateFinalityConflictNotifications(id string) {
|
||||
nl.propagateFinalityConflictNotificationsId = id
|
||||
nl.propagateFinalityConflictNotificationsID = id
|
||||
nl.propagateFinalityConflictNotifications = true
|
||||
}
|
||||
|
||||
// PropagateFinalityConflictResolvedNotifications instructs the listener to send finality conflict resolved notifications
|
||||
// to the remote listener
|
||||
func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications(id string) {
|
||||
nl.propagateFinalityConflictResolvedNotificationsId = id
|
||||
nl.propagateFinalityConflictResolvedNotificationsID = id
|
||||
nl.propagateFinalityConflictResolvedNotifications = true
|
||||
}
|
||||
|
||||
@ -375,7 +377,7 @@ func (nl *NotificationListener) PropagateFinalityConflictResolvedNotifications(i
|
||||
// are ignored.
|
||||
func (nl *NotificationListener) PropagateUTXOsChangedNotifications(addresses []*UTXOsChangedNotificationAddress, id string) {
|
||||
if !nl.propagateUTXOsChangedNotifications {
|
||||
nl.propagateUTXOsChangedNotificationsId = id
|
||||
nl.propagateUTXOsChangedNotificationsID = id
|
||||
nl.propagateUTXOsChangedNotifications = true
|
||||
nl.propagateUTXOsChangedNotificationAddresses =
|
||||
make(map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress, len(addresses))
|
||||
@ -478,34 +480,34 @@ func (nl *NotificationListener) scriptPubKeyStringToAddressString(scriptPublicKe
|
||||
// PropagateVirtualSelectedParentBlueScoreChangedNotifications instructs the listener to send
|
||||
// virtual selected parent blue score notifications to the remote listener
|
||||
func (nl *NotificationListener) PropagateVirtualSelectedParentBlueScoreChangedNotifications(id string) {
|
||||
nl.propagateVirtualDaaScoreChangedNotificationsId = id
|
||||
nl.propagateVirtualDaaScoreChangedNotificationsID = id
|
||||
nl.propagateVirtualSelectedParentBlueScoreChangedNotifications = true
|
||||
}
|
||||
|
||||
// PropagateVirtualDaaScoreChangedNotifications instructs the listener to send
|
||||
// virtual DAA score notifications to the remote listener
|
||||
func (nl *NotificationListener) PropagateVirtualDaaScoreChangedNotifications(id string) {
|
||||
nl.propagateVirtualDaaScoreChangedNotificationsId = id
|
||||
nl.propagateVirtualDaaScoreChangedNotificationsID = id
|
||||
nl.propagateVirtualDaaScoreChangedNotifications = true
|
||||
}
|
||||
|
||||
// PropagateNewBlockTemplateNotifications instructs the listener to send
|
||||
// new block template notifications to the remote listener
|
||||
func (nl *NotificationListener) PropagateNewBlockTemplateNotifications(id string) {
|
||||
nl.propagateNewBlockTemplateNotificationsId = id
|
||||
nl.propagateNewBlockTemplateNotificationsID = id
|
||||
nl.propagateNewBlockTemplateNotifications = true
|
||||
}
|
||||
|
||||
// PropagatePruningPointUTXOSetOverrideNotifications instructs the listener to send pruning point UTXO set override notifications
|
||||
// to the remote listener.
|
||||
func (nl *NotificationListener) PropagatePruningPointUTXOSetOverrideNotifications(id string) {
|
||||
nl.propagatePruningPointUTXOSetOverrideNotificationsId = id
|
||||
nl.propagatePruningPointUTXOSetOverrideNotificationsID = id
|
||||
nl.propagatePruningPointUTXOSetOverrideNotifications = true
|
||||
}
|
||||
|
||||
// StopPropagatingPruningPointUTXOSetOverrideNotifications instructs the listener to stop sending pruning
|
||||
// point UTXO set override notifications to the remote listener.
|
||||
func (nl *NotificationListener) StopPropagatingPruningPointUTXOSetOverrideNotifications(id string) {
|
||||
nl.propagatePruningPointUTXOSetOverrideNotificationsId = id
|
||||
nl.propagatePruningPointUTXOSetOverrideNotificationsID = id
|
||||
nl.propagatePruningPointUTXOSetOverrideNotifications = false
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleNotifyBlockAdded(context *rpccontext.Context, router *router.Router,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateBlockAddedNotifications(notifyBlockAddedRequestMessage.Id)
|
||||
listener.PropagateBlockAddedNotifications(notifyBlockAddedRequestMessage.ID)
|
||||
|
||||
response := appmessage.NewNotifyBlockAddedResponseMessage(notifyBlockAddedRequestMessage.Id)
|
||||
response := appmessage.NewNotifyBlockAddedResponseMessage(notifyBlockAddedRequestMessage.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,9 +15,9 @@ func HandleNotifyFinalityConflicts(context *rpccontext.Context, router *router.R
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateFinalityConflictNotifications(notifyFinalityConflictsRequest.Id)
|
||||
listener.PropagateFinalityConflictResolvedNotifications(notifyFinalityConflictsRequest.Id)
|
||||
listener.PropagateFinalityConflictNotifications(notifyFinalityConflictsRequest.ID)
|
||||
listener.PropagateFinalityConflictResolvedNotifications(notifyFinalityConflictsRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyFinalityConflictsResponseMessage(notifyFinalityConflictsRequest.Id)
|
||||
response := appmessage.NewNotifyFinalityConflictsResponseMessage(notifyFinalityConflictsRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleNotifyNewBlockTemplate(context *rpccontext.Context, router *router.Ro
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateNewBlockTemplateNotifications(notifyNewBlockTemplateRequest.Id)
|
||||
listener.PropagateNewBlockTemplateNotifications(notifyNewBlockTemplateRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyNewBlockTemplateResponseMessage(notifyNewBlockTemplateRequest.Id)
|
||||
response := appmessage.NewNotifyNewBlockTemplateResponseMessage(notifyNewBlockTemplateRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleNotifyPruningPointUTXOSetOverrideRequest(context *rpccontext.Context,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagatePruningPointUTXOSetOverrideNotifications(notifyPruningPointUTXOSetOverrideRequest.Id)
|
||||
listener.PropagatePruningPointUTXOSetOverrideNotifications(notifyPruningPointUTXOSetOverrideRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyPruningPointUTXOSetOverrideResponseMessage(notifyPruningPointUTXOSetOverrideRequest.Id)
|
||||
response := appmessage.NewNotifyPruningPointUTXOSetOverrideResponseMessage(notifyPruningPointUTXOSetOverrideRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -12,14 +12,14 @@ func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router
|
||||
notifyUTXOsChangedRequest := request.(*appmessage.NotifyUTXOsChangedRequestMessage)
|
||||
|
||||
if !context.Config.UTXOIndex {
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id)
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
|
||||
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex")
|
||||
return errorMessage, nil
|
||||
}
|
||||
|
||||
addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(notifyUTXOsChangedRequest.Addresses)
|
||||
if err != nil {
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id)
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
|
||||
errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err)
|
||||
return errorMessage, nil
|
||||
}
|
||||
@ -28,8 +28,8 @@ func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateUTXOsChangedNotifications(addresses, notifyUTXOsChangedRequest.Id)
|
||||
listener.PropagateUTXOsChangedNotifications(addresses, notifyUTXOsChangedRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.Id)
|
||||
response := appmessage.NewNotifyUTXOsChangedResponseMessage(notifyUTXOsChangedRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleNotifyVirtualDaaScoreChanged(context *rpccontext.Context, router *rou
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateVirtualDaaScoreChangedNotifications(notifyVirtualDaaScoreChangedRequest.Id)
|
||||
listener.PropagateVirtualDaaScoreChangedNotifications(notifyVirtualDaaScoreChangedRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyVirtualDaaScoreChangedResponseMessage(notifyVirtualDaaScoreChangedRequest.Id)
|
||||
response := appmessage.NewNotifyVirtualDaaScoreChangedResponseMessage(notifyVirtualDaaScoreChangedRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleNotifyVirtualSelectedParentBlueScoreChanged(context *rpccontext.Conte
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.PropagateVirtualSelectedParentBlueScoreChangedNotifications(notifyVirtualSelectedParentBlueScoreChangedRequest.Id)
|
||||
listener.PropagateVirtualSelectedParentBlueScoreChangedNotifications(notifyVirtualSelectedParentBlueScoreChangedRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(notifyVirtualSelectedParentBlueScoreChangedRequest.Id)
|
||||
response := appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(notifyVirtualSelectedParentBlueScoreChangedRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -18,8 +18,8 @@ func HandleNotifyVirtualSelectedParentChainChanged(context *rpccontext.Context,
|
||||
}
|
||||
listener.PropagateVirtualSelectedParentChainChangedNotifications(
|
||||
notifyVirtualSelectedParentChainChangedRequest.IncludeAcceptedTransactionIDs,
|
||||
notifyVirtualSelectedParentChainChangedRequest.Id)
|
||||
notifyVirtualSelectedParentChainChangedRequest.ID)
|
||||
|
||||
response := appmessage.NewNotifyVirtualSelectedParentChainChangedResponseMessage(notifyVirtualSelectedParentChainChangedRequest.Id)
|
||||
response := appmessage.NewNotifyVirtualSelectedParentChainChangedResponseMessage(notifyVirtualSelectedParentChainChangedRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -15,8 +15,8 @@ func HandleStopNotifyingPruningPointUTXOSetOverrideRequest(context *rpccontext.C
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listener.StopPropagatingPruningPointUTXOSetOverrideNotifications(stopNotifyingPruningPointUTXOSetOverrideRequest.Id)
|
||||
listener.StopPropagatingPruningPointUTXOSetOverrideNotifications(stopNotifyingPruningPointUTXOSetOverrideRequest.ID)
|
||||
|
||||
response := appmessage.NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(stopNotifyingPruningPointUTXOSetOverrideRequest.Id)
|
||||
response := appmessage.NewStopNotifyingPruningPointUTXOSetOverrideResponseMessage(stopNotifyingPruningPointUTXOSetOverrideRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -12,14 +12,14 @@ func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router
|
||||
stopNotifyingUTXOsChangedRequest := request.(*appmessage.StopNotifyingUTXOsChangedRequestMessage)
|
||||
|
||||
if !context.Config.UTXOIndex {
|
||||
errorMessage := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id)
|
||||
errorMessage := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
|
||||
errorMessage.Error = appmessage.RPCErrorf("Method unavailable when kaspad is run without --utxoindex")
|
||||
return errorMessage, nil
|
||||
}
|
||||
|
||||
addresses, err := context.ConvertAddressStringsToUTXOsChangedNotificationAddresses(stopNotifyingUTXOsChangedRequest.Addresses)
|
||||
if err != nil {
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id)
|
||||
errorMessage := appmessage.NewNotifyUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
|
||||
errorMessage.Error = appmessage.RPCErrorf("Parsing error: %s", err)
|
||||
return errorMessage, nil
|
||||
}
|
||||
@ -30,6 +30,6 @@ func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router
|
||||
}
|
||||
listener.StopPropagatingUTXOsChangedNotifications(addresses)
|
||||
|
||||
response := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.Id)
|
||||
response := appmessage.NewStopNotifyingUTXOsChangedResponseMessage(stopNotifyingUTXOsChangedRequest.ID)
|
||||
return response, nil
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
// RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||
// Additionally, it starts listening for the appropriate notification using the given handler function
|
||||
func (c *RPCClient) RegisterForBlockAddedNotifications(onBlockAdded func(notification *appmessage.BlockAddedNotificationMessage)) error {
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyBlockAddedRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyBlockAddedRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(in
|
||||
onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(
|
||||
appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationId))
|
||||
appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ func (c *RPCClient) RegisterForFinalityConflictsNotifications(
|
||||
onFinalityConflict func(notification *appmessage.FinalityConflictNotificationMessage),
|
||||
onFinalityConflictResolved func(notification *appmessage.FinalityConflictResolvedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyFinalityConflictsRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyFinalityConflictsRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@ import (
|
||||
// RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||
// Additionally, it starts listening for the appropriate notification using the given handler function
|
||||
func (c *RPCClient) RegisterForNewBlockTemplateNotifications(onNewBlockTemplate func(notification *appmessage.NewBlockTemplateNotificationMessage)) error {
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyNewBlockTemplateRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyNewBlockTemplateRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ import (
|
||||
// Additionally, it starts listening for the appropriate notification using the given handler function
|
||||
func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOSetNotifications func()) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -43,7 +43,7 @@ func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOS
|
||||
// Additionally, it stops listening for the appropriate notification using the given handler function
|
||||
func (c *RPCClient) UnregisterPruningPointUTXOSetNotifications() error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewStopNotifyingPruningPointUTXOSetOverrideRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ import (
|
||||
func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string,
|
||||
onUTXOsChanged func(notification *appmessage.UTXOsChangedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyUTXOsChangedRequestMessage(addresses, rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyUTXOsChangedRequestMessage(addresses, rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications(
|
||||
onVirtualDaaScoreChanged func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualDaaScoreChangedRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualDaaScoreChangedRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import (
|
||||
func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications(
|
||||
onVirtualSelectedParentBlueScoreChanged func(notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage)) error {
|
||||
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(rpccontext.DefaultNotificationId))
|
||||
err := c.rpcRouter.outgoingRoute().Enqueue(appmessage.NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(rpccontext.DefaultNotificationID))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user