mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-27 07:48:44 +00:00
fix fmt
This commit is contained in:
parent
1dc8bbf738
commit
1f25116a91
@ -21,7 +21,7 @@ func NewNotifyBlockAddedRequestMessage(id string) *NotifyBlockAddedRequestMessag
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyBlockAddedResponseMessage struct {
|
type NotifyBlockAddedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ func NewNotifyBlockAddedResponseMessage(id string) *NotifyBlockAddedResponseMess
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type BlockAddedNotificationMessage struct {
|
type BlockAddedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Block *RPCBlock
|
Block *RPCBlock
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ func (msg *BlockAddedNotificationMessage) Command() MessageCommand {
|
|||||||
// NewBlockAddedNotificationMessage returns a instance of the message
|
// NewBlockAddedNotificationMessage returns a instance of the message
|
||||||
func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage {
|
func NewBlockAddedNotificationMessage(block *RPCBlock, id string) *BlockAddedNotificationMessage {
|
||||||
return &BlockAddedNotificationMessage{
|
return &BlockAddedNotificationMessage{
|
||||||
Id : id,
|
Id: id,
|
||||||
Block: block,
|
Block: block,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,14 +14,14 @@ func (msg *NotifyFinalityConflictsRequestMessage) Command() MessageCommand {
|
|||||||
|
|
||||||
// NewNotifyFinalityConflictsRequestMessage returns a instance of the message
|
// NewNotifyFinalityConflictsRequestMessage returns a instance of the message
|
||||||
func NewNotifyFinalityConflictsRequestMessage(id string) *NotifyFinalityConflictsRequestMessage {
|
func NewNotifyFinalityConflictsRequestMessage(id string) *NotifyFinalityConflictsRequestMessage {
|
||||||
return &NotifyFinalityConflictsRequestMessage{Id : id}
|
return &NotifyFinalityConflictsRequestMessage{Id: id}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyFinalityConflictsResponseMessage is an appmessage corresponding to
|
// NotifyFinalityConflictsResponseMessage is an appmessage corresponding to
|
||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyFinalityConflictsResponseMessage struct {
|
type NotifyFinalityConflictsResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,14 +32,14 @@ func (msg *NotifyFinalityConflictsResponseMessage) Command() MessageCommand {
|
|||||||
|
|
||||||
// NewNotifyFinalityConflictsResponseMessage returns a instance of the message
|
// NewNotifyFinalityConflictsResponseMessage returns a instance of the message
|
||||||
func NewNotifyFinalityConflictsResponseMessage(id string) *NotifyFinalityConflictsResponseMessage {
|
func NewNotifyFinalityConflictsResponseMessage(id string) *NotifyFinalityConflictsResponseMessage {
|
||||||
return &NotifyFinalityConflictsResponseMessage{Id : id}
|
return &NotifyFinalityConflictsResponseMessage{Id: id}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FinalityConflictNotificationMessage is an appmessage corresponding to
|
// FinalityConflictNotificationMessage is an appmessage corresponding to
|
||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type FinalityConflictNotificationMessage struct {
|
type FinalityConflictNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
ViolatingBlockHash string
|
ViolatingBlockHash string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ func NewFinalityConflictNotificationMessage(violatingBlockHash string, id string
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type FinalityConflictResolvedNotificationMessage struct {
|
type FinalityConflictResolvedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
FinalityBlockHash string
|
FinalityBlockHash string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,7 +71,7 @@ func (msg *FinalityConflictResolvedNotificationMessage) Command() MessageCommand
|
|||||||
// NewFinalityConflictResolvedNotificationMessage returns a instance of the message
|
// NewFinalityConflictResolvedNotificationMessage returns a instance of the message
|
||||||
func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string, id string) *FinalityConflictResolvedNotificationMessage {
|
func NewFinalityConflictResolvedNotificationMessage(finalityBlockHash string, id string) *FinalityConflictResolvedNotificationMessage {
|
||||||
return &FinalityConflictResolvedNotificationMessage{
|
return &FinalityConflictResolvedNotificationMessage{
|
||||||
Id : id,
|
Id: id,
|
||||||
FinalityBlockHash: finalityBlockHash,
|
FinalityBlockHash: finalityBlockHash,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ func NewNotifyNewBlockTemplateRequestMessage(id string) *NotifyNewBlockTemplateR
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyNewBlockTemplateResponseMessage struct {
|
type NotifyNewBlockTemplateResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package appmessage
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyUTXOsChangedRequestMessage struct {
|
type NotifyUTXOsChangedRequestMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Addresses []string
|
Addresses []string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,8 +23,8 @@ func NewNotifyUTXOsChangedRequestMessage(addresses []string, id string) *NotifyU
|
|||||||
// NotifyUTXOsChangedResponseMessage is an appmessage corresponding to
|
// NotifyUTXOsChangedResponseMessage is an appmessage corresponding to
|
||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyUTXOsChangedResponseMessage struct {
|
type NotifyUTXOsChangedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ func NewNotifyUTXOsChangedResponseMessage(id string) *NotifyUTXOsChangedResponse
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type UTXOsChangedNotificationMessage struct {
|
type UTXOsChangedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Added []*UTXOsByAddressesEntry
|
Added []*UTXOsByAddressesEntry
|
||||||
Removed []*UTXOsByAddressesEntry
|
Removed []*UTXOsByAddressesEntry
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,7 +21,7 @@ func NewNotifyVirtualDaaScoreChangedRequestMessage(id string) *NotifyVirtualDaaS
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyVirtualDaaScoreChangedResponseMessage struct {
|
type NotifyVirtualDaaScoreChangedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ func NewNotifyVirtualDaaScoreChangedResponseMessage(id string) *NotifyVirtualDaa
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type VirtualDaaScoreChangedNotificationMessage struct {
|
type VirtualDaaScoreChangedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
VirtualDaaScore uint64
|
VirtualDaaScore uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ func NewVirtualDaaScoreChangedNotificationMessage(
|
|||||||
virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage {
|
virtualDaaScore uint64, id string) *VirtualDaaScoreChangedNotificationMessage {
|
||||||
|
|
||||||
return &VirtualDaaScoreChangedNotificationMessage{
|
return &VirtualDaaScoreChangedNotificationMessage{
|
||||||
Id: id,
|
Id: id,
|
||||||
VirtualDaaScore: virtualDaaScore,
|
VirtualDaaScore: virtualDaaScore,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,14 +14,14 @@ func (msg *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage) Command()
|
|||||||
|
|
||||||
// NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message
|
// NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage returns a instance of the message
|
||||||
func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {
|
func NewNotifyVirtualSelectedParentBlueScoreChangedRequestMessage(id string) *NotifyVirtualSelectedParentBlueScoreChangedRequestMessage {
|
||||||
return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{Id : id}
|
return &NotifyVirtualSelectedParentBlueScoreChangedRequestMessage{Id: id}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to
|
// NotifyVirtualSelectedParentBlueScoreChangedResponseMessage is an appmessage corresponding to
|
||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct {
|
type NotifyVirtualSelectedParentBlueScoreChangedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ func NewNotifyVirtualSelectedParentBlueScoreChangedResponseMessage(id string) *N
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
|
type VirtualSelectedParentBlueScoreChangedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
VirtualSelectedParentBlueScore uint64
|
VirtualSelectedParentBlueScore uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ func NewVirtualSelectedParentBlueScoreChangedNotificationMessage(
|
|||||||
virtualSelectedParentBlueScore uint64, id string) *VirtualSelectedParentBlueScoreChangedNotificationMessage {
|
virtualSelectedParentBlueScore uint64, id string) *VirtualSelectedParentBlueScoreChangedNotificationMessage {
|
||||||
|
|
||||||
return &VirtualSelectedParentBlueScoreChangedNotificationMessage{
|
return &VirtualSelectedParentBlueScoreChangedNotificationMessage{
|
||||||
Id : id,
|
Id: id,
|
||||||
VirtualSelectedParentBlueScore: virtualSelectedParentBlueScore,
|
VirtualSelectedParentBlueScore: virtualSelectedParentBlueScore,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package appmessage
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
|
type NotifyVirtualSelectedParentChainChangedRequestMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
IncludeAcceptedTransactionIDs bool
|
IncludeAcceptedTransactionIDs bool
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
|
|||||||
includeAcceptedTransactionIDs bool, id string) *NotifyVirtualSelectedParentChainChangedRequestMessage {
|
includeAcceptedTransactionIDs bool, id string) *NotifyVirtualSelectedParentChainChangedRequestMessage {
|
||||||
|
|
||||||
return &NotifyVirtualSelectedParentChainChangedRequestMessage{
|
return &NotifyVirtualSelectedParentChainChangedRequestMessage{
|
||||||
Id : id,
|
Id: id,
|
||||||
IncludeAcceptedTransactionIDs: includeAcceptedTransactionIDs,
|
IncludeAcceptedTransactionIDs: includeAcceptedTransactionIDs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -27,7 +27,7 @@ func NewNotifyVirtualSelectedParentChainChangedRequestMessage(
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type NotifyVirtualSelectedParentChainChangedResponseMessage struct {
|
type NotifyVirtualSelectedParentChainChangedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,14 +38,14 @@ func (msg *NotifyVirtualSelectedParentChainChangedResponseMessage) Command() Mes
|
|||||||
|
|
||||||
// NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message
|
// NewNotifyVirtualSelectedParentChainChangedResponseMessage returns a instance of the message
|
||||||
func NewNotifyVirtualSelectedParentChainChangedResponseMessage(id string) *NotifyVirtualSelectedParentChainChangedResponseMessage {
|
func NewNotifyVirtualSelectedParentChainChangedResponseMessage(id string) *NotifyVirtualSelectedParentChainChangedResponseMessage {
|
||||||
return &NotifyVirtualSelectedParentChainChangedResponseMessage{Id : id}
|
return &NotifyVirtualSelectedParentChainChangedResponseMessage{Id: id}
|
||||||
}
|
}
|
||||||
|
|
||||||
// VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to
|
// VirtualSelectedParentChainChangedNotificationMessage is an appmessage corresponding to
|
||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type VirtualSelectedParentChainChangedNotificationMessage struct {
|
type VirtualSelectedParentChainChangedNotificationMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
RemovedChainBlockHashes []string
|
RemovedChainBlockHashes []string
|
||||||
AddedChainBlockHashes []string
|
AddedChainBlockHashes []string
|
||||||
AcceptedTransactionIDs []*AcceptedTransactionIDs
|
AcceptedTransactionIDs []*AcceptedTransactionIDs
|
||||||
@ -61,7 +61,7 @@ func NewVirtualSelectedParentChainChangedNotificationMessage(removedChainBlockHa
|
|||||||
addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs, id string) *VirtualSelectedParentChainChangedNotificationMessage {
|
addedChainBlocks []string, acceptedTransactionIDs []*AcceptedTransactionIDs, id string) *VirtualSelectedParentChainChangedNotificationMessage {
|
||||||
|
|
||||||
return &VirtualSelectedParentChainChangedNotificationMessage{
|
return &VirtualSelectedParentChainChangedNotificationMessage{
|
||||||
Id : id,
|
Id: id,
|
||||||
RemovedChainBlockHashes: removedChainBlockHashes,
|
RemovedChainBlockHashes: removedChainBlockHashes,
|
||||||
AddedChainBlockHashes: addedChainBlocks,
|
AddedChainBlockHashes: addedChainBlocks,
|
||||||
AcceptedTransactionIDs: acceptedTransactionIDs,
|
AcceptedTransactionIDs: acceptedTransactionIDs,
|
||||||
|
|||||||
@ -4,7 +4,7 @@ package appmessage
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type StopNotifyingUTXOsChangedRequestMessage struct {
|
type StopNotifyingUTXOsChangedRequestMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Addresses []string
|
Addresses []string
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16,7 +16,7 @@ func (msg *StopNotifyingUTXOsChangedRequestMessage) Command() MessageCommand {
|
|||||||
// NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message
|
// NewStopNotifyingUTXOsChangedRequestMessage returns a instance of the message
|
||||||
func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *StopNotifyingUTXOsChangedRequestMessage {
|
func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *StopNotifyingUTXOsChangedRequestMessage {
|
||||||
return &StopNotifyingUTXOsChangedRequestMessage{
|
return &StopNotifyingUTXOsChangedRequestMessage{
|
||||||
Id: id,
|
Id: id,
|
||||||
Addresses: addresses,
|
Addresses: addresses,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -25,7 +25,7 @@ func NewStopNotifyingUTXOsChangedRequestMessage(addresses []string, id string) *
|
|||||||
// its respective RPC message
|
// its respective RPC message
|
||||||
type StopNotifyingUTXOsChangedResponseMessage struct {
|
type StopNotifyingUTXOsChangedResponseMessage struct {
|
||||||
baseMessage
|
baseMessage
|
||||||
Id string
|
Id string
|
||||||
Error *RPCError
|
Error *RPCError
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -92,7 +92,7 @@ func (m *Manager) notifyBlockAddedToDAG(block *externalapi.DomainBlock) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
blockAddedNotification := appmessage.NewBlockAddedNotificationMessage(rpcBlock,"")
|
blockAddedNotification := appmessage.NewBlockAddedNotificationMessage(rpcBlock, "")
|
||||||
err = m.context.NotificationManager.NotifyBlockAdded(blockAddedNotification)
|
err = m.context.NotificationManager.NotifyBlockAdded(blockAddedNotification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -33,24 +33,24 @@ type UTXOsChangedNotificationAddress struct {
|
|||||||
type NotificationListener struct {
|
type NotificationListener struct {
|
||||||
params *dagconfig.Params
|
params *dagconfig.Params
|
||||||
|
|
||||||
propagateBlockAddedNotifications bool
|
propagateBlockAddedNotifications bool
|
||||||
propagateBlockAddedNotificationsId string
|
propagateBlockAddedNotificationsId string
|
||||||
propagateVirtualSelectedParentChainChangedNotifications bool
|
propagateVirtualSelectedParentChainChangedNotifications bool
|
||||||
propagateVirtualSelectedParentChainChangedNotificationsId string
|
propagateVirtualSelectedParentChainChangedNotificationsId string
|
||||||
propagateFinalityConflictNotifications bool
|
propagateFinalityConflictNotifications bool
|
||||||
propagateFinalityConflictNotificationsId string
|
propagateFinalityConflictNotificationsId string
|
||||||
propagateFinalityConflictResolvedNotifications bool
|
propagateFinalityConflictResolvedNotifications bool
|
||||||
propagateFinalityConflictResolvedNotificationsId string
|
propagateFinalityConflictResolvedNotificationsId string
|
||||||
propagateUTXOsChangedNotifications bool
|
propagateUTXOsChangedNotifications bool
|
||||||
propagateUTXOsChangedNotificationsId string
|
propagateUTXOsChangedNotificationsId string
|
||||||
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
|
propagateVirtualSelectedParentBlueScoreChangedNotifications bool
|
||||||
propagateVirtualSelectedParentBlueScoreChangedNotificationsId string
|
propagateVirtualSelectedParentBlueScoreChangedNotificationsId string
|
||||||
propagateVirtualDaaScoreChangedNotifications bool
|
propagateVirtualDaaScoreChangedNotifications bool
|
||||||
propagateVirtualDaaScoreChangedNotificationsId string
|
propagateVirtualDaaScoreChangedNotificationsId string
|
||||||
propagatePruningPointUTXOSetOverrideNotifications bool
|
propagatePruningPointUTXOSetOverrideNotifications bool
|
||||||
propagatePruningPointUTXOSetOverrideNotificationsId string
|
propagatePruningPointUTXOSetOverrideNotificationsId string
|
||||||
propagateNewBlockTemplateNotifications bool
|
propagateNewBlockTemplateNotifications bool
|
||||||
propagateNewBlockTemplateNotificationsId string
|
propagateNewBlockTemplateNotificationsId string
|
||||||
|
|
||||||
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
|
propagateUTXOsChangedNotificationAddresses map[utxoindex.ScriptPublicKeyString]*UTXOsChangedNotificationAddress
|
||||||
includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool
|
includeAcceptedTransactionIDsInVirtualSelectedParentChainChangedNotifications bool
|
||||||
@ -176,9 +176,9 @@ func (nm *NotificationManager) NotifyFinalityConflict(notification *appmessage.F
|
|||||||
|
|
||||||
for router, listener := range nm.listeners {
|
for router, listener := range nm.listeners {
|
||||||
if listener.propagateFinalityConflictNotifications {
|
if listener.propagateFinalityConflictNotifications {
|
||||||
|
|
||||||
notification.Id = listener.propagateFinalityConflictNotificationsId
|
notification.Id = listener.propagateFinalityConflictNotificationsId
|
||||||
|
|
||||||
err := router.OutgoingRoute().Enqueue(notification)
|
err := router.OutgoingRoute().Enqueue(notification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -195,9 +195,9 @@ func (nm *NotificationManager) NotifyFinalityConflictResolved(notification *appm
|
|||||||
|
|
||||||
for router, listener := range nm.listeners {
|
for router, listener := range nm.listeners {
|
||||||
if listener.propagateFinalityConflictResolvedNotifications {
|
if listener.propagateFinalityConflictResolvedNotifications {
|
||||||
|
|
||||||
notification.Id = listener.propagateFinalityConflictResolvedNotificationsId
|
notification.Id = listener.propagateFinalityConflictResolvedNotificationsId
|
||||||
|
|
||||||
err := router.OutgoingRoute().Enqueue(notification)
|
err := router.OutgoingRoute().Enqueue(notification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -219,7 +219,7 @@ func (nm *NotificationManager) NotifyUTXOsChanged(utxoChanges *utxoindex.UTXOCha
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
notification.Id = listener.propagateUTXOsChangedNotificationsId
|
notification.Id = listener.propagateUTXOsChangedNotificationsId
|
||||||
|
|
||||||
// Don't send the notification if it's empty
|
// Don't send the notification if it's empty
|
||||||
@ -247,9 +247,9 @@ func (nm *NotificationManager) NotifyVirtualSelectedParentBlueScoreChanged(
|
|||||||
|
|
||||||
for router, listener := range nm.listeners {
|
for router, listener := range nm.listeners {
|
||||||
if listener.propagateVirtualSelectedParentBlueScoreChangedNotifications {
|
if listener.propagateVirtualSelectedParentBlueScoreChangedNotifications {
|
||||||
|
|
||||||
notification.Id = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsId
|
notification.Id = listener.propagateVirtualSelectedParentBlueScoreChangedNotificationsId
|
||||||
|
|
||||||
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -269,9 +269,9 @@ func (nm *NotificationManager) NotifyVirtualDaaScoreChanged(
|
|||||||
|
|
||||||
for router, listener := range nm.listeners {
|
for router, listener := range nm.listeners {
|
||||||
if listener.propagateVirtualDaaScoreChangedNotifications {
|
if listener.propagateVirtualDaaScoreChangedNotifications {
|
||||||
|
|
||||||
notification.Id = listener.propagateVirtualDaaScoreChangedNotificationsId
|
notification.Id = listener.propagateVirtualDaaScoreChangedNotificationsId
|
||||||
|
|
||||||
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
err := router.OutgoingRoute().MaybeEnqueue(notification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -291,9 +291,9 @@ func (nm *NotificationManager) NotifyNewBlockTemplate(
|
|||||||
|
|
||||||
for router, listener := range nm.listeners {
|
for router, listener := range nm.listeners {
|
||||||
if listener.propagateNewBlockTemplateNotifications {
|
if listener.propagateNewBlockTemplateNotifications {
|
||||||
|
|
||||||
notification.Id = listener.propagateNewBlockTemplateNotificationsId
|
notification.Id = listener.propagateNewBlockTemplateNotificationsId
|
||||||
|
|
||||||
err := router.OutgoingRoute().Enqueue(notification)
|
err := router.OutgoingRoute().Enqueue(notification)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -27,7 +27,7 @@ func HandleGetVirtualSelectedParentChainFromBlock(context *rpccontext.Context, _
|
|||||||
}
|
}
|
||||||
|
|
||||||
chainChangedNotification, err := context.ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage(
|
chainChangedNotification, err := context.ConvertVirtualSelectedParentChainChangesToChainChangedNotificationMessage(
|
||||||
virtualSelectedParentChain, getVirtualSelectedParentChainFromBlockRequest.IncludeAcceptedTransactionIDs, rpccontext.DefaultNotificationId)
|
virtualSelectedParentChain, getVirtualSelectedParentChainFromBlockRequest.IncludeAcceptedTransactionIDs, rpccontext.DefaultNotificationId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyBlockAdded handles the respectively named RPC command
|
// HandleNotifyBlockAdded handles the respectively named RPC command
|
||||||
func HandleNotifyBlockAdded(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyBlockAdded(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyBlockAddedRequestMessage := request.(*appmessage.NotifyBlockAddedRequestMessage)
|
notifyBlockAddedRequestMessage := request.(*appmessage.NotifyBlockAddedRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyFinalityConflicts handles the respectively named RPC command
|
// HandleNotifyFinalityConflicts handles the respectively named RPC command
|
||||||
func HandleNotifyFinalityConflicts(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyFinalityConflicts(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyFinalityConflictsRequest := request.(*appmessage.NotifyFinalityConflictsRequestMessage)
|
notifyFinalityConflictsRequest := request.(*appmessage.NotifyFinalityConflictsRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyNewBlockTemplate handles the respectively named RPC command
|
// HandleNotifyNewBlockTemplate handles the respectively named RPC command
|
||||||
func HandleNotifyNewBlockTemplate(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyNewBlockTemplate(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyNewBlockTemplateRequest := request.(*appmessage.NotifyNewBlockTemplateRequestMessage)
|
notifyNewBlockTemplateRequest := request.(*appmessage.NotifyNewBlockTemplateRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyPruningPointUTXOSetOverrideRequest handles the respectively named RPC command
|
// HandleNotifyPruningPointUTXOSetOverrideRequest handles the respectively named RPC command
|
||||||
func HandleNotifyPruningPointUTXOSetOverrideRequest(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyPruningPointUTXOSetOverrideRequest(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyPruningPointUTXOSetOverrideRequest := request.(*appmessage.NotifyPruningPointUTXOSetOverrideRequestMessage)
|
notifyPruningPointUTXOSetOverrideRequest := request.(*appmessage.NotifyPruningPointUTXOSetOverrideRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyUTXOsChanged handles the respectively named RPC command
|
// HandleNotifyUTXOsChanged handles the respectively named RPC command
|
||||||
func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyUTXOsChangedRequest := request.(*appmessage.NotifyUTXOsChangedRequestMessage)
|
notifyUTXOsChangedRequest := request.(*appmessage.NotifyUTXOsChangedRequestMessage)
|
||||||
|
|
||||||
if !context.Config.UTXOIndex {
|
if !context.Config.UTXOIndex {
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyVirtualDaaScoreChanged handles the respectively named RPC command
|
// HandleNotifyVirtualDaaScoreChanged handles the respectively named RPC command
|
||||||
func HandleNotifyVirtualDaaScoreChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyVirtualDaaScoreChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyVirtualDaaScoreChangedRequest := request.(*appmessage.NotifyVirtualDaaScoreChangedRequestMessage)
|
notifyVirtualDaaScoreChangedRequest := request.(*appmessage.NotifyVirtualDaaScoreChangedRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleNotifyVirtualSelectedParentBlueScoreChanged handles the respectively named RPC command
|
// HandleNotifyVirtualSelectedParentBlueScoreChanged handles the respectively named RPC command
|
||||||
func HandleNotifyVirtualSelectedParentBlueScoreChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleNotifyVirtualSelectedParentBlueScoreChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
notifyVirtualSelectedParentBlueScoreChangedRequest := request.(*appmessage.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)
|
notifyVirtualSelectedParentBlueScoreChangedRequest := request.(*appmessage.NotifyVirtualSelectedParentBlueScoreChangedRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,9 +8,9 @@ import (
|
|||||||
|
|
||||||
// HandleStopNotifyingPruningPointUTXOSetOverrideRequest handles the respectively named RPC command
|
// HandleStopNotifyingPruningPointUTXOSetOverrideRequest handles the respectively named RPC command
|
||||||
func HandleStopNotifyingPruningPointUTXOSetOverrideRequest(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleStopNotifyingPruningPointUTXOSetOverrideRequest(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
stopNotifyingPruningPointUTXOSetOverrideRequest := request.(*appmessage.StopNotifyingPruningPointUTXOSetOverrideRequestMessage)
|
stopNotifyingPruningPointUTXOSetOverrideRequest := request.(*appmessage.StopNotifyingPruningPointUTXOSetOverrideRequestMessage)
|
||||||
|
|
||||||
listener, err := context.NotificationManager.Listener(router)
|
listener, err := context.NotificationManager.Listener(router)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import (
|
|||||||
|
|
||||||
// HandleStopNotifyingUTXOsChanged handles the respectively named RPC command
|
// HandleStopNotifyingUTXOsChanged handles the respectively named RPC command
|
||||||
func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
func HandleStopNotifyingUTXOsChanged(context *rpccontext.Context, router *router.Router, request appmessage.Message) (appmessage.Message, error) {
|
||||||
|
|
||||||
stopNotifyingUTXOsChangedRequest := request.(*appmessage.StopNotifyingUTXOsChangedRequestMessage)
|
stopNotifyingUTXOsChangedRequest := request.(*appmessage.StopNotifyingUTXOsChangedRequestMessage)
|
||||||
|
|
||||||
if !context.Config.UTXOIndex {
|
if !context.Config.UTXOIndex {
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForVirtualSelectedParentChainChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterForVirtualSelectedParentChainChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
@ -13,7 +13,7 @@ func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(in
|
|||||||
onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error {
|
onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error {
|
||||||
|
|
||||||
err := c.rpcRouter.outgoingRoute().Enqueue(
|
err := c.rpcRouter.outgoingRoute().Enqueue(
|
||||||
appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationId))
|
appmessage.NewNotifyVirtualSelectedParentChainChangedRequestMessage(includeAcceptedTransactionIDs, rpccontext.DefaultNotificationId))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForFinalityConflictsNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterForFinalityConflictsNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterForNewBlockTemplateNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterPruningPointUTXOSetNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterPruningPointUTXOSetNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForUTXOsChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
// RegisterForUTXOsChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response.
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForVirtualDaaScoreChangedNotifications sends an RPC request respective to the function's
|
// RegisterForVirtualDaaScoreChangedNotifications sends an RPC request respective to the function's
|
||||||
|
|||||||
@ -2,9 +2,9 @@ package rpcclient
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/kaspanet/kaspad/app/appmessage"
|
"github.com/kaspanet/kaspad/app/appmessage"
|
||||||
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
||||||
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
routerpkg "github.com/kaspanet/kaspad/infrastructure/network/netadapter/router"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// RegisterForVirtualSelectedParentBlueScoreChangedNotifications sends an RPC request respective to the function's
|
// RegisterForVirtualSelectedParentBlueScoreChangedNotifications sends an RPC request respective to the function's
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user