From 943451795ebbaa6f1d83e62690a0b44721ca0a5b Mon Sep 17 00:00:00 2001 From: muXxer Date: Thu, 10 Aug 2023 20:03:29 +0200 Subject: [PATCH] Fix missing treasury balance in db-hash tool (#1906) --- CHANGELOG.md | 6 ++++++ core/app/app.go | 2 +- pkg/toolset/database_hash.go | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10bb5c247..5a7bb706d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/core/app/app.go b/core/app/app.go index 6a45bf164..9a6db4990 100644 --- a/core/app/app.go +++ b/core/app/app.go @@ -21,7 +21,7 @@ var ( Name = "HORNET" // Version of the app. - Version = "1.2.6" + Version = "1.2.7" ) var ( diff --git a/pkg/toolset/database_hash.go b/pkg/toolset/database_hash.go index edcb4d3fb..2555661c6 100644 --- a/pkg/toolset/database_hash.go +++ b/pkg/toolset/database_hash.go @@ -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 { @@ -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