diff --git a/cmd/lotus-chainwatch/site/key.html b/cmd/lotus-chainwatch/site/key.html index 40ec02cb6..e6e5297e1 100644 --- a/cmd/lotus-chainwatch/site/key.html +++ b/cmd/lotus-chainwatch/site/key.html @@ -21,7 +21,7 @@ Messages: - {{ range messages "`from` = $1 or `to` = $2" $wallet $wallet $wallet}} + {{ range messages "\"from\" = $1 or \"to\" = $1" $wallet}} {{ if eq .From.String $wallet }} diff --git a/cmd/lotus-chainwatch/templates.go b/cmd/lotus-chainwatch/templates.go index b336953c5..4873bbcb1 100644 --- a/cmd/lotus-chainwatch/templates.go +++ b/cmd/lotus-chainwatch/templates.go @@ -153,10 +153,9 @@ func (h *handler) netPower(slashFilt string) (types.BigInt, error) { if slashFilt != "" { slashFilt = " where " + slashFilt } - return h.queryNum(`select sum(a.power) from ( - select max(miner_heads.power), miner_heads.slashed_at, height as power from miner_heads + return h.queryNum(`select sum(power) from (select distinct on (addr) power, slashed_at from miner_heads inner join blocks b on miner_heads.stateroot = b.parentStateRoot - group by miner_heads.addr) a` + slashFilt) +order by addr, height desc) as p` + slashFilt) } func (h *handler) queryNum(q string, p ...interface{}) (types.BigInt, error) { @@ -214,6 +213,8 @@ func (h *handler) messages(filter string, args ...interface{}) (out []types.Mess filter = " where " + filter } + log.Info("select * from messages "+filter) + rws, err := h.st.db.Query("select * from messages "+filter, args...) if err != nil { return nil, err
DirPeerNonceValueBlockMpool Wait
To{{.To.String}}