mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-11-28 16:13:56 +00:00
20 lines
623 B
Go
20 lines
623 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"
|
|
)
|
|
|
|
// HandleGetSelectedTipHash handles the respectively named RPC command
|
|
func HandleGetSelectedTipHash(context *rpccontext.Context, _ *router.Router, _ appmessage.Message) (appmessage.Message, error) {
|
|
selectedTip, err := context.Domain.Consensus().GetVirtualSelectedParent()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
response := appmessage.NewGetSelectedTipHashResponseMessage(selectedTip.String())
|
|
|
|
return response, nil
|
|
}
|