mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-05-20 22:06:42 +00:00

* Fix notifyVirtualSelectedParentBlueScoreChanged to show the selected tip blue score instead of the virtual's * Fix ShouldMine() to fetch selected tip header
20 lines
620 B
Go
20 lines
620 B
Go
package rpchandlers
|
|
|
|
import (
|
|
"github.com/kaspanet/kaspad/app/appmessage"
|
|
"github.com/kaspanet/kaspad/app/rpc/rpccontext"
|
|
"github.com/kaspanet/kaspad/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
|
|
}
|