Skip to content
Snippets Groups Projects
Commit 97a87d17 authored by Hans Moog's avatar Hans Moog
Browse files

Fix: fixed erroneous parts in bundle essence calculation

parent edce0044
No related branches found
No related tags found
No related merge requests found
...@@ -206,8 +206,8 @@ func (this *ValueTransaction) GetBundleEssence() (result trinary.Trits) { ...@@ -206,8 +206,8 @@ func (this *ValueTransaction) GetBundleEssence() (result trinary.Trits) {
copy(result[0:], this.trits[ADDRESS_OFFSET:VALUE_END]) copy(result[0:], this.trits[ADDRESS_OFFSET:VALUE_END])
if this.GetValue() < 0 { if this.GetValue() >= 0 {
copy(result[:VALUE_END], this.trits[SIGNATURE_MESSAGE_FRAGMENT_OFFSET:SIGNATURE_MESSAGE_FRAGMENT_END]) copy(result[VALUE_END:], this.trits[SIGNATURE_MESSAGE_FRAGMENT_OFFSET:SIGNATURE_MESSAGE_FRAGMENT_END])
} }
this.signatureMessageFragmentMutex.RUnlock() this.signatureMessageFragmentMutex.RUnlock()
......
package bundleprocessor package bundleprocessor
import ( import (
"github.com/iotadevelopment/go/packages/ternary"
"github.com/iotaledger/goshimmer/packages/errors" "github.com/iotaledger/goshimmer/packages/errors"
"github.com/iotaledger/goshimmer/packages/model/bundle" "github.com/iotaledger/goshimmer/packages/model/bundle"
"github.com/iotaledger/goshimmer/packages/model/transactionmetadata" "github.com/iotaledger/goshimmer/packages/model/transactionmetadata"
...@@ -52,6 +53,15 @@ func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction) ...@@ -52,6 +53,15 @@ func ProcessSolidBundleHead(headTransaction *value_transaction.ValueTransaction)
if currentTransaction.IsTail() { if currentTransaction.IsTail() {
newBundle.SetTransactionHashes(mapTransactionsToTransactionHashes(bundleTransactions)) newBundle.SetTransactionHashes(mapTransactionsToTransactionHashes(bundleTransactions))
if newBundle.IsValueBundle() {
var concatenatedBundleEssences = make(ternary.Trits, len(bundleTransactions)*value_transaction.BUNDLE_ESSENCE_SIZE)
for i, bundleTransaction := range bundleTransactions {
copy(concatenatedBundleEssences[value_transaction.BUNDLE_ESSENCE_SIZE*i:value_transaction.BUNDLE_ESSENCE_SIZE*(i+1)], bundleTransaction.GetBundleEssence())
}
// calc + set bundle hash
}
Events.BundleSolid.Trigger(newBundle, bundleTransactions) Events.BundleSolid.Trigger(newBundle, bundleTransactions)
return newBundle, nil return newBundle, nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment