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 88a7a5c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions api/explorer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type (
Transactions []ExplorerTransaction `json:"transactions"`
RawBlock types.Block `json:"rawblock"`
HexBlock string `json:"hexblock"`
BlockId string `json:"blockid"`
BlockID string `json:"blockid"`

modules.BlockFacts
}
Expand Down 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())),
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 88a7a5c

Please sign in to comment.