Skip to content

Commit

Permalink
Fix missing treasury balance in db-hash tool
Browse files Browse the repository at this point in the history
  • Loading branch information
muXxer committed Aug 10, 2023
1 parent 18d826d commit d7aa5e5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.2.7] - 10.08.2023

### Fix
- Fix missing treasury balance in db-hash tool (#1906)


## [1.2.6] - 09.08.2023

### Added
Expand Down
2 changes: 1 addition & 1 deletion core/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var (
Name = "HORNET"

// Version of the app.
Version = "1.2.6"
Version = "1.2.7"
)

var (
Expand Down
3 changes: 2 additions & 1 deletion pkg/toolset/database_hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func calculateDatabaseLedgerHash(dbStorage *storage.Storage, outputJSON bool) er
return fmt.Errorf("unable to serialize ledger index: %w", err)
}

var ledgerTokenSupply uint64
if treasuryOutput != nil {
// write current treasury output
if _, err := lsHash.Write(treasuryOutput.MilestoneID[:]); err != nil {
Expand All @@ -100,9 +101,9 @@ func calculateDatabaseLedgerHash(dbStorage *storage.Storage, outputJSON bool) er
if err := binary.Write(lsHash, binary.LittleEndian, treasuryOutput.Amount); err != nil {
return fmt.Errorf("unable to serialize treasury output amount: %w", err)
}
ledgerTokenSupply += treasuryOutput.Amount
}

var ledgerTokenSupply uint64
// write all unspent outputs in lexicographical order
for _, output := range outputs {
ledgerTokenSupply += output.Amount
Expand Down

0 comments on commit d7aa5e5

Please sign in to comment.