OSDN Git Service

add block hash
authormars <mars@bytom.io>
Mon, 22 Jul 2019 10:39:12 +0000 (18:39 +0800)
committermars <mars@bytom.io>
Mon, 22 Jul 2019 10:39:12 +0000 (18:39 +0800)
toolbar/reward/service/node.go

index 1142f7c..af7309a 100644 (file)
@@ -19,6 +19,10 @@ func NewNode(hostPort string) *Node {
        return &Node{hostPort: hostPort}
 }
 
+func (n *Node) GetBlockByHash(hash string) (*types.Block, error) {
+       return n.getRawBlock(&getRawBlockReq{BlockHash: hash})
+}
+
 func (n *Node) GetBlockByHeight(height uint64) (*types.Block, error) {
        return n.getRawBlock(&getRawBlockReq{BlockHeight: height})
 }