Browse Source

census-service: remove \u0000 character from dump

Signed-off-by: p4u <p4u@dabax.net>
testnet
p4u 5 years ago
parent
commit
ddda6bfa62
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      tree/tree.go

+ 1
- 0
tree/tree.go

@ -118,6 +118,7 @@ func (t *Tree) Dump() ([]string, error) {
err := t.Tree.Walk(nil, func(n *merkletree.Node) { err := t.Tree.Walk(nil, func(n *merkletree.Node) {
if n.Type == merkletree.NodeTypeLeaf { if n.Type == merkletree.NodeTypeLeaf {
data := bytes.Trim(n.Value()[65:], "\x00") data := bytes.Trim(n.Value()[65:], "\x00")
data = bytes.Replace(data, []byte("\u0000"), nil, -1)
response = append(response, fmt.Sprintf("%s", data)) response = append(response, fmt.Sprintf("%s", data))
} }
}) })

Loading…
Cancel
Save