Skip to content

Commit

Permalink
Merge pull request #217 from dusk-network/fix-percentage
Browse files Browse the repository at this point in the history
Fix sync percentage, update dusk-wallet import
  • Loading branch information
jules authored Dec 23, 2019
2 parents 9df0908 + 3086983 commit a25911b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/dusk-network/dusk-blockchain
require (
github.com/bwesterb/go-ristretto v1.1.1
github.com/dusk-network/dusk-crypto v0.1.0
github.com/dusk-network/dusk-wallet v1.1.0
github.com/dusk-network/dusk-wallet v1.1.1
github.com/dusk-network/dusk-zkproof v0.0.0-20190727103229-8b0c008561ee
github.com/go-chi/render v1.0.1
github.com/golang/protobuf v1.3.2 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ github.com/dusk-network/bn256 v0.5.0-lattices h1:3PWpy5mxJI7UNPdfjHzI3Mw2MhbZbHt
github.com/dusk-network/bn256 v0.5.0-lattices/go.mod h1:KGkfDyf8GXeworEpuKRRfPGQa/CzezrYUGaaABueUhg=
github.com/dusk-network/dusk-crypto v0.1.0 h1:HUwtbA00D2WH8xBd1xvKSIUlJtu4ulBSte+yyKO8tZg=
github.com/dusk-network/dusk-crypto v0.1.0/go.mod h1:Hgr/7jihizg4T/om70iCt4p0uon2asf/9AAzeegu9CU=
github.com/dusk-network/dusk-wallet v1.1.0 h1:2xcSEA0YhLs0a45FDCIkuPAUNZFXCEN/6UFbNbRym6A=
github.com/dusk-network/dusk-wallet v1.1.0/go.mod h1:MqjZmkfz5ISQ2LSLjpDjyX+o449Ps5luMFINxYan6eM=
github.com/dusk-network/dusk-wallet v1.1.1 h1:3Ze3RavEvEHNOBSr+ks7b49uC2gi/rCv2Q03cEAlkr8=
github.com/dusk-network/dusk-wallet v1.1.1/go.mod h1:MqjZmkfz5ISQ2LSLjpDjyX+o449Ps5luMFINxYan6eM=
github.com/dusk-network/dusk-zkproof v0.0.0-20190727103229-8b0c008561ee h1:etA5E8o7AM8hxSvMiqxxRIaQ5Ke7zWZRM65ZkqsnAVU=
github.com/dusk-network/dusk-zkproof v0.0.0-20190727103229-8b0c008561ee/go.mod h1:PpPxJzdlQ023fALM5AGWeFrIaIU2igVmxr3QiRaf+ks=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
Expand Down
7 changes: 7 additions & 0 deletions pkg/core/chain/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -741,6 +741,13 @@ func (c *Chain) provideSyncProgress(r rpcbus.Request) {

progressPercentage := (float64(prevBlockHeight) / float64(c.highestSeen)) * 100

// Avoiding strange output when the chain can be ahead of the highest
// seen block, as in most cases, consensus terminates before we see
// the new block from other peers.
if progressPercentage > 100 {
progressPercentage = 100
}

r.RespChan <- rpcbus.Response{*bytes.NewBufferString(fmt.Sprintf("%.2f", progressPercentage)), nil}
}

Expand Down

0 comments on commit a25911b

Please sign in to comment.