package blockchain
import (
- "blockchain/blockchain/rpc"
"context"
"fmt"
"net/http"
"github.com/bytom/blockchain/asset"
"github.com/bytom/blockchain/pin"
"github.com/bytom/blockchain/pseudohsm"
+ "github.com/bytom/blockchain/rpc"
ctypes "github.com/bytom/blockchain/rpc/types"
"github.com/bytom/blockchain/txfeed"
+ "github.com/bytom/protocol/bc"
"github.com/bytom/encoding/json"
"github.com/bytom/errors"
"github.com/bytom/mining/cpuminer"
m.Handle("/reset-password", jsonHandler(bcr.pseudohsmResetPassword))
m.Handle("/update-alias", jsonHandler(bcr.pseudohsmUpdateAlias))
m.Handle("/net-info", jsonHandler(bcr.getNetInfo))
+ m.Handle("/get-best-block-hash", jsonHandler(bcr.getBestBlockHash))
latencyHandler := http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
if l := latency(m, req); l != nil {
return rpc.NetInfo(bcR.sw)
}
+func (bcR *BlockchainReactor) getBestBlockHash() *bc.Hash {
+ return bcR.chain.BestBlockHash()
+}
+
// BroadcastStatusRequest broadcasts `BlockStore` height.
func (bcR *BlockchainReactor) BroadcastStatusResponse() {
block, _ := bcR.chain.State()