Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e022f78

Browse files
committedJul 21, 2015
include hash of resolved object in object stat output
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
1 parent d37ecbb commit e022f78

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
 

‎merkledag/node.go

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Node struct {
2323

2424
// NodeStat is a statistics object for a Node. Mostly sizes.
2525
type NodeStat struct {
26+
Hash string
2627
NumLinks int // number of links in link table
2728
BlockSize int // size of the raw, encoded data
2829
LinksSize int // size of the links segment
@@ -201,7 +202,13 @@ func (n *Node) Stat() (*NodeStat, error) {
201202
return nil, err
202203
}
203204

205+
key, err := n.Key()
206+
if err != nil {
207+
return nil, err
208+
}
209+
204210
return &NodeStat{
211+
Hash: key.B58String(),
205212
NumLinks: len(n.Links),
206213
BlockSize: len(enc),
207214
LinksSize: len(enc) - len(n.Data), // includes framing.

0 commit comments

Comments
 (0)
Please sign in to comment.