diff --git a/explorer/explorer.go b/explorer/explorer.go index f5c700315..db781b371 100644 --- a/explorer/explorer.go +++ b/explorer/explorer.go @@ -31,7 +31,7 @@ import ( ) const ( - maxExplorerRows = 2000 + maxExplorerRows = 400 minExplorerRows = 20 defaultAddressRows int64 = 20 MaxAddressRows int64 = 1000 diff --git a/explorer/explorerroutes.go b/explorer/explorerroutes.go index 10971ce9f..8200e3367 100644 --- a/explorer/explorerroutes.go +++ b/explorer/explorerroutes.go @@ -128,6 +128,17 @@ func (exp *explorerUI) Blocks(w http.ResponseWriter, r *http.Request) { return } + if !exp.liteMode { + for _, s := range summaries { + blockStatus, err := exp.explorerSource.BlockStatus(s.Hash) + if err != nil && err != sql.ErrNoRows { + log.Warnf("Unable to retrieve chain status for block %s: %v", s.Hash, err) + } + s.Valid = blockStatus.IsValid + s.MainChain = blockStatus.IsMainchain + } + } + str, err := exp.templates.execTemplateToString("explorer", struct { Data []*BlockBasic BestBlock int diff --git a/public/css/main.css b/public/css/main.css index 37b6d11e1..7ef47ec1f 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -594,6 +594,13 @@ body.darkBG .progress { color: red; font-size: 14pt; } +.invalidated-tx { + background-color: rgba(151, 125, 163, 0.3); + opacity: 0.5; +} +.grayed { + opacity: 0.5; +} /*Typography*/ .fs14-decimal .dot, diff --git a/views/block.tmpl b/views/block.tmpl index 5071a76e3..ba4857b98 100644 --- a/views/block.tmpl +++ b/views/block.tmpl @@ -6,6 +6,7 @@ {{ template "navbar" . }}
{{with .Data}} + {{$Invalidated := and (gt .Confirmations 1) (not .Valid) }}

@@ -37,7 +38,17 @@ {{if .MainChain}} - + {{end}} @@ -174,7 +185,7 @@ - + - + {{range .Tx}} {{if eq .Coinbase false}} diff --git a/views/explorer.tmpl b/views/explorer.tmpl index e0f2b4d95..756963cbd 100644 --- a/views/explorer.tmpl +++ b/views/explorer.tmpl @@ -52,8 +52,8 @@ {{range .Data}} - - + +
APPROVED{{ if gt .Confirmations 1 }}{{.Valid}}{{else}}pending{{end}} + {{ if gt .Confirmations 1 }} + {{if $Invalidated}} + {{.Valid}} + {{else}} + {{.Valid}} + {{end}} + {{else}} + pending + {{end}} +
BLOCK HASHTotal DCR Size
{{if $.Data.Nonce}} @@ -353,7 +364,7 @@ Fee Size
{{ .Height }}{{.Transactions}}{{if not .Valid}}{{end}}{{ .Height }}{{.Transactions}} {{.Voters}} {{.FreshStake}} {{.Revocations}}