Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
COLLET Ismael
Goshimmer_without_tipselection
Commits
97a87d17
Commit
97a87d17
authored
5 years ago
by
Hans Moog
Browse files
Options
Downloads
Patches
Plain Diff
Fix: fixed erroneous parts in bundle essence calculation
parent
edce0044
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/model/value_transaction/value_transaction.go
+2
-2
2 additions, 2 deletions
packages/model/value_transaction/value_transaction.go
plugins/bundleprocessor/bundleprocessor.go
+10
-0
10 additions, 0 deletions
plugins/bundleprocessor/bundleprocessor.go
with
12 additions
and
2 deletions
packages/model/value_transaction/value_transaction.go
+
2
−
2
View file @
97a87d17
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
plugins/bundleprocessor/bundleprocessor.go
+
10
−
0
View file @
97a87d17
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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment