Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.

Commit

Permalink
get rid of extra variable
Browse files Browse the repository at this point in the history
  • Loading branch information
petabytestorage committed Oct 15, 2017
1 parent 0b81134 commit 7414741
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions api/explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,20 +194,18 @@ func (api *API) buildExplorerBlock(height types.BlockHeight, block types.Block,
panic("incorrect request to buildExplorerBlock - block does not exist")
}

var hexBlock string
if hexBlockEnable {
hexBlock = hex.EncodeToString(encoding.Marshal(block))
}

return ExplorerBlock{
b := ExplorerBlock{
MinerPayoutIDs: mpoids,
Transactions: etxns,
RawBlock: block,
HexBlock: hexBlock,
BlockId: hex.EncodeToString(encoding.Marshal(block.ID())),

BlockFacts: facts,
}
if hexBlockEnable {
b.HexBlock = hex.EncodeToString(encoding.Marshal(block))
}
return b
}

// explorerHandler handles API calls to /explorer/blocks/:height.
Expand Down

0 comments on commit 7414741

Please sign in to comment.