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
00049309
Commit
00049309
authored
4 years ago
by
Hans Moog
Browse files
Options
Downloads
Patches
Plain Diff
Fix: fixed missing marshaling of output bools
parent
f34120bd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dapps/valuetransfers/packages/tangle/output.go
+23
-3
23 additions, 3 deletions
dapps/valuetransfers/packages/tangle/output.go
with
23 additions
and
3 deletions
dapps/valuetransfers/packages/tangle/output.go
+
23
−
3
View file @
00049309
...
...
@@ -236,7 +236,7 @@ func (output *Output) ConsumerCount() int {
return
output
.
consumerCount
}
// Preferred returns true if the output
is considered to be the first valid spender of all of its Inputs
.
// Preferred returns true if the output
belongs to a preferred transaction
.
func
(
output
*
Output
)
Preferred
()
(
result
bool
)
{
output
.
preferredMutex
.
RLock
()
defer
output
.
preferredMutex
.
RUnlock
()
...
...
@@ -295,7 +295,7 @@ func (output *Output) setFinalized(finalized bool) (modified bool) {
return
}
// Finalized returns true, if the decision if this output is
lik
ed or not has been finalized by consensus already.
// Finalized returns true, if the decision if this output is
preferr
ed or not has been finalized by consensus already.
func
(
output
*
Output
)
Finalized
()
bool
{
output
.
finalizedMutex
.
RLock
()
defer
output
.
finalizedMutex
.
RUnlock
()
...
...
@@ -428,12 +428,17 @@ func (output *Output) ObjectStorageValue() []byte {
balanceCount
:=
len
(
output
.
balances
)
// initialize helper
marshalUtil
:=
marshalutil
.
New
(
branchmanager
.
BranchIDLength
+
marshalutil
.
BOOL_SIZE
+
marshalutil
.
TIME_SIZE
+
transaction
.
IDLength
+
marshalutil
.
UINT32_SIZE
+
marshalutil
.
UINT32_SIZE
+
balanceCount
*
balance
.
Length
)
marshalUtil
:=
marshalutil
.
New
(
branchmanager
.
BranchIDLength
+
6
*
marshalutil
.
BOOL_SIZE
+
marshalutil
.
TIME_SIZE
+
transaction
.
IDLength
+
marshalutil
.
UINT32_SIZE
+
marshalutil
.
UINT32_SIZE
+
balanceCount
*
balance
.
Length
)
marshalUtil
.
WriteBytes
(
output
.
branchID
.
Bytes
())
marshalUtil
.
WriteBool
(
output
.
solid
)
marshalUtil
.
WriteTime
(
output
.
solidificationTime
)
marshalUtil
.
WriteBytes
(
output
.
firstConsumer
.
Bytes
())
marshalUtil
.
WriteUint32
(
uint32
(
output
.
consumerCount
))
marshalUtil
.
WriteBool
(
output
.
Preferred
())
marshalUtil
.
WriteBool
(
output
.
Finalized
())
marshalUtil
.
WriteBool
(
output
.
Liked
())
marshalUtil
.
WriteBool
(
output
.
Confirmed
())
marshalUtil
.
WriteBool
(
output
.
Rejected
())
marshalUtil
.
WriteUint32
(
uint32
(
balanceCount
))
for
_
,
balanceToMarshal
:=
range
output
.
balances
{
marshalUtil
.
WriteBytes
(
balanceToMarshal
.
Bytes
())
...
...
@@ -462,6 +467,21 @@ func (output *Output) UnmarshalObjectStorageValue(data []byte) (consumedBytes in
if
err
!=
nil
{
return
}
if
output
.
preferred
,
err
=
marshalUtil
.
ReadBool
();
err
!=
nil
{
return
}
if
output
.
finalized
,
err
=
marshalUtil
.
ReadBool
();
err
!=
nil
{
return
}
if
output
.
liked
,
err
=
marshalUtil
.
ReadBool
();
err
!=
nil
{
return
}
if
output
.
confirmed
,
err
=
marshalUtil
.
ReadBool
();
err
!=
nil
{
return
}
if
output
.
rejected
,
err
=
marshalUtil
.
ReadBool
();
err
!=
nil
{
return
}
output
.
consumerCount
=
int
(
consumerCount
)
balanceCount
,
err
:=
marshalUtil
.
ReadUint32
()
if
err
!=
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