kaspad/app/rpc/rpchandlers/notify_new_block_template.go
2023-08-23 15:18:10 +09:00

20 lines
658 B
Go

package rpchandlers
import (
"github.com/c4ei/YunSeokYeol/app/appmessage"
"github.com/c4ei/YunSeokYeol/app/rpc/rpccontext"
"github.com/c4ei/YunSeokYeol/infrastructure/network/netadapter/router"
)
// HandleNotifyNewBlockTemplate handles the respectively named RPC command
func HandleNotifyNewBlockTemplate(context *rpccontext.Context, router *router.Router, _ appmessage.Message) (appmessage.Message, error) {
listener, err := context.NotificationManager.Listener(router)
if err != nil {
return nil, err
}
listener.PropagateNewBlockTemplateNotifications()
response := appmessage.NewNotifyNewBlockTemplateResponseMessage()
return response, nil
}