Commit f798bbf2 authored by David Vorick's avatar David Vorick

/consensus/status returns more sane types

parent 58796af1
......@@ -7,7 +7,7 @@ whitepaper.aux
whitepaper.log
whitepaper.pdf
*_test
*.wallet
*.wallet*
walletDir*
*.swp
info.log
......@@ -2,6 +2,8 @@ package main
import (
"net/http"
"github.com/NebulousLabs/Sia/consensus"
)
// consensusStatusHandler handles the API call asking for the consensus status.
......@@ -9,12 +11,12 @@ func (d *daemon) consensusStatusHandler(w http.ResponseWriter, req *http.Request
currentBlock := d.state.CurrentBlock().ID()
target := d.state.CurrentTarget()
writeJSON(w, struct {
Height int
CurrentBlock string
Target string
Height consensus.BlockHeight
CurrentBlock consensus.BlockID
Target consensus.Target
}{
int(d.state.Height()),
string(currentBlock[:]),
string(target[:]),
d.state.Height(),
currentBlock,
target,
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment