Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
7b2e6752
Commit
7b2e6752
authored
Feb 27, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
master: fix/simplify generation of TID
The 'min_tid < new_tid' assertion failed when jumping to the past.
parent
ca2f7061
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
22 deletions
+9
-22
neo/master/transactions.py
neo/master/transactions.py
+9
-22
No files found.
neo/master/transactions.py
View file @
7b2e6752
...
@@ -235,28 +235,15 @@ class TransactionManager(EventQueue):
...
@@ -235,28 +235,15 @@ class TransactionManager(EventQueue):
min_tid
=
self
.
_last_tid
min_tid
=
self
.
_last_tid
if
tid
<=
min_tid
:
if
tid
<=
min_tid
:
tid
=
addTID
(
min_tid
,
1
)
tid
=
addTID
(
min_tid
,
1
)
# We know we won't have room to adjust by decreasing.
try_decrease
=
False
else
:
try_decrease
=
True
if
ttid
is
not
None
:
if
ttid
is
not
None
:
assert
isinstance
(
ttid
,
basestring
),
repr
(
ttid
)
remainder
=
u64
(
ttid
)
%
divisor
assert
isinstance
(
divisor
,
(
int
,
long
)),
repr
(
divisor
)
delta_remainder
=
remainder
-
u64
(
tid
)
%
divisor
ref_remainder
=
u64
(
ttid
)
%
divisor
if
delta_remainder
:
remainder
=
u64
(
tid
)
%
divisor
tid
=
addTID
(
tid
,
delta_remainder
)
if
ref_remainder
!=
remainder
:
if
tid
<=
min_tid
:
if
try_decrease
:
tid
=
addTID
(
tid
,
divisor
)
new_tid
=
addTID
(
tid
,
ref_remainder
-
divisor
-
remainder
)
assert
u64
(
tid
)
%
divisor
==
remainder
,
(
dump
(
tid
),
remainder
)
assert
u64
(
new_tid
)
%
divisor
==
ref_remainder
,
(
dump
(
new_tid
),
assert
min_tid
<
tid
,
(
dump
(
min_tid
),
dump
(
tid
))
ref_remainder
)
if
new_tid
<=
min_tid
:
new_tid
=
addTID
(
new_tid
,
divisor
)
else
:
if
ref_remainder
>
remainder
:
ref_remainder
+=
divisor
new_tid
=
addTID
(
tid
,
ref_remainder
-
remainder
)
assert
min_tid
<
new_tid
,
(
dump
(
min_tid
),
dump
(
tid
),
dump
(
new_tid
))
tid
=
new_tid
self
.
_last_tid
=
tid
self
.
_last_tid
=
tid
return
self
.
_last_tid
return
self
.
_last_tid
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment