Skip to content

Commit

Permalink
Merge pull request #218 from dusk-network/small-fixes
Browse files Browse the repository at this point in the history
Small fixes to bugs found during final tests
  • Loading branch information
jules authored Dec 24, 2019
2 parents a25911b + fbf70d5 commit 284da22
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 4 additions & 0 deletions pkg/core/consensus/maintainer/maintainer.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/dusk-network/dusk-blockchain/pkg/util/nativeutils/eventbus"
"github.com/dusk-network/dusk-blockchain/pkg/util/nativeutils/rpcbus"
"github.com/dusk-network/dusk-wallet/transactions"
"github.com/dusk-network/dusk-wallet/wallet"
log "github.com/sirupsen/logrus"
)

Expand Down Expand Up @@ -169,5 +170,8 @@ func (m *StakeAutomaton) getTxSettings() (uint64, uint64) {
lockTime = transactions.MaxLockTime
}

// Convert amount from atomic units to whole units of DUSK
amount = amount * wallet.DUSK

return amount, lockTime
}
2 changes: 1 addition & 1 deletion pkg/core/transactor/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (t *Transactor) handleGetTxHistory(r rpcbus.Request) error {
// Time
s.WriteString(time.Unix(record.Timestamp, 0).Format(time.UnixDate) + " / ")
// Amount
s.WriteString(fmt.Sprintf("%.8f DUSK ", float64(record.Amount)/float64(wallet.DUSK)) + " / ")
s.WriteString(fmt.Sprintf("%.8f DUSK", float64(record.Amount)/float64(wallet.DUSK)) + " / ")
// Unlock height
s.WriteString("Unlocks at " + strconv.FormatUint(record.UnlockHeight, 10) + " / ")
// Recipient
Expand Down
5 changes: 1 addition & 4 deletions pkg/p2p/peer/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ func (m *messageRouter) route(topic topics.Topic, b *bytes.Buffer) {
case topics.MemPool:
err = m.dataBroker.SendTxsItems()
case topics.Inv:
// We only accept an advertisement once
if m.dupeMap.CanFwd(b) {
err = m.dataRequestor.RequestMissingItems(b)
}
err = m.dataRequestor.RequestMissingItems(b)
case topics.Block:
err = m.synchronizer.Synchronize(b, m.peerInfo)
case topics.Ping:
Expand Down

0 comments on commit 284da22

Please sign in to comment.