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

Fix: fixed bug if objectstorage

parent 17c7689d
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,7 @@ require (
github.com/golang/protobuf v1.3.2 // indirect
github.com/google/open-location-code/go v0.0.0-20190903173953-119bc96a3a51
github.com/gorilla/websocket v1.4.1
github.com/iotaledger/hive.go v0.0.0-20191205213014-6bee840fa69a
github.com/iotaledger/hive.go v0.0.0-20191208004610-567900b261bd
github.com/iotaledger/iota.go v1.0.0-beta.9
github.com/kr/text v0.1.0
github.com/labstack/echo v3.3.10+incompatible
......
......@@ -9,17 +9,17 @@ import (
type ConflictId [conflictSetIdLength]byte
func NewConflictSetId(conflictBytes ...interface{}) (result ConflictId) {
func NewConflictId(conflictBytes ...interface{}) (result ConflictId) {
switch len(conflictBytes) {
case 2:
transferHash, ok := conflictBytes[0].(TransferHash)
if !ok {
panic("expected first parameter of NewConflictSetId to be a TransferHash")
panic("expected first parameter of NewConflictId to be a TransferHash")
}
addressHash, ok := conflictBytes[0].(TransferHash)
if !ok {
panic("expected second parameter of NewConflictSetId to be a AddressHash")
panic("expected second parameter of NewConflictId to be a AddressHash")
}
fullConflictSetIdentifier := make([]byte, transferHashLength+addressHashLength)
......@@ -29,7 +29,7 @@ func NewConflictSetId(conflictBytes ...interface{}) (result ConflictId) {
result = blake2b.Sum256(fullConflictSetIdentifier)
case 1:
default:
panic("invalid parameter count when calling NewConflictSetId")
panic("invalid parameter count when calling NewConflictId")
}
return
......
......@@ -152,9 +152,7 @@ func (ledgerState *LedgerState) BookTransfer(transfer *Transfer) (err error) {
return
}
if !targetReality.PersistenceEnabled() {
targetReality.Persist()
}
targetReality.Persist()
})
return
......
......@@ -233,7 +233,7 @@ func TestAggregateAggregatedRealities(t *testing.T) {
multiSpend(ledgerState, 1, aggregatedOutputs0[0], aggregatedOutputs1[0])
multiSpend(ledgerState, 1, aggregatedOutputs0[1], aggregatedOutputs2[0])
time.Sleep(1000 * time.Millisecond)
time.Sleep(2000 * time.Millisecond)
objectstorage.WaitForWritesToFlush()
......@@ -247,7 +247,7 @@ func TestAggregateAggregatedRealities(t *testing.T) {
multiSpend(ledgerState, 2, outputs0[0], outputs1[0])
time.Sleep(1000 * time.Millisecond)
time.Sleep(2000 * time.Millisecond)
objectstorage.WaitForWritesToFlush()
......
packages/ledgerstate/outputs.png

54 KiB | W: | H:

packages/ledgerstate/outputs.png

54 KiB | W: | H:

packages/ledgerstate/outputs.png
packages/ledgerstate/outputs.png
packages/ledgerstate/outputs.png
packages/ledgerstate/outputs.png
  • 2-up
  • Swipe
  • Onion skin
packages/ledgerstate/outputs1.png

106 KiB | W: | H:

packages/ledgerstate/outputs1.png

106 KiB | W: | H:

packages/ledgerstate/outputs1.png
packages/ledgerstate/outputs1.png
packages/ledgerstate/outputs1.png
packages/ledgerstate/outputs1.png
  • 2-up
  • Swipe
  • Onion skin
packages/ledgerstate/outputs2.png

121 KiB | W: | H:

packages/ledgerstate/outputs2.png

121 KiB | W: | H:

packages/ledgerstate/outputs2.png
packages/ledgerstate/outputs2.png
packages/ledgerstate/outputs2.png
packages/ledgerstate/outputs2.png
  • 2-up
  • Swipe
  • Onion skin
packages/ledgerstate/realities2.png

136 KiB | W: | H:

packages/ledgerstate/realities2.png

136 KiB | W: | H:

packages/ledgerstate/realities2.png
packages/ledgerstate/realities2.png
packages/ledgerstate/realities2.png
packages/ledgerstate/realities2.png
  • 2-up
  • Swipe
  • Onion skin
This diff is collapsed.
......@@ -57,9 +57,20 @@ func (transferOutput *TransferOutput) GetAddressHash() (addressHash AddressHash)
}
func (transferOutput *TransferOutput) SetRealityId(realityId RealityId) {
transferOutput.realityIdMutex.Lock()
transferOutput.realityId = realityId
transferOutput.realityIdMutex.Unlock()
transferOutput.realityIdMutex.RLock()
if transferOutput.realityId != realityId {
transferOutput.realityIdMutex.RUnlock()
transferOutput.realityIdMutex.Lock()
if transferOutput.realityId != realityId {
transferOutput.realityId = realityId
transferOutput.SetModified()
}
transferOutput.realityIdMutex.Unlock()
} else {
transferOutput.realityIdMutex.RUnlock()
}
}
func (transferOutput *TransferOutput) GetBalances() []*ColoredBalance {
......
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