Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
Breeze
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DeStream-public
Breeze
Commits
0f834536
Commit
0f834536
authored
Jun 13, 2017
by
Jeremy Bokobza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed existing sessions to be more explicit
parent
ea61224c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
TumblingState.cs
Breeze/src/Breeze.TumbleBit.Client/TumblingState.cs
+10
-10
No files found.
Breeze/src/Breeze.TumbleBit.Client/TumblingState.cs
View file @
0f834536
...
...
@@ -59,28 +59,28 @@ namespace Breeze.TumbleBit.Client
// get a list of cycles we expect to have at this height
var
cycles
=
this
.
TumblerParameters
.
CycleGenerator
.
GetCycles
(
this
.
LastBlockReceivedHeight
);
var
state
s
=
cycles
.
SelectMany
(
c
=>
this
.
Sessions
.
Where
(
s
=>
s
.
StartCycle
==
c
.
Start
)).
ToList
();
foreach
(
var
state
in
state
s
)
var
existingSession
s
=
cycles
.
SelectMany
(
c
=>
this
.
Sessions
.
Where
(
s
=>
s
.
StartCycle
==
c
.
Start
)).
ToList
();
foreach
(
var
existingSession
in
existingSession
s
)
{
try
{
// create a new session to be updated
var
session
=
new
Session
();
if
(
state
.
NegotiationClientState
!=
null
)
if
(
existingSession
.
NegotiationClientState
!=
null
)
{
session
.
StartCycle
=
state
.
NegotiationClientState
.
CycleStart
;
session
.
ClientChannelNegotiation
=
new
ClientChannelNegotiation
(
this
.
TumblerParameters
,
state
.
NegotiationClientState
);
session
.
StartCycle
=
existingSession
.
NegotiationClientState
.
CycleStart
;
session
.
ClientChannelNegotiation
=
new
ClientChannelNegotiation
(
this
.
TumblerParameters
,
existingSession
.
NegotiationClientState
);
}
if
(
state
.
PromiseClientState
!=
null
)
session
.
PromiseClientSession
=
new
PromiseClientSession
(
this
.
TumblerParameters
.
CreatePromiseParamaters
(),
state
.
PromiseClientState
);
if
(
state
.
SolverClientState
!=
null
)
session
.
SolverClientSession
=
new
SolverClientSession
(
this
.
TumblerParameters
.
CreateSolverParamaters
(),
state
.
SolverClientState
);
if
(
existingSession
.
PromiseClientState
!=
null
)
session
.
PromiseClientSession
=
new
PromiseClientSession
(
this
.
TumblerParameters
.
CreatePromiseParamaters
(),
existingSession
.
PromiseClientState
);
if
(
existingSession
.
SolverClientState
!=
null
)
session
.
SolverClientSession
=
new
SolverClientSession
(
this
.
TumblerParameters
.
CreateSolverParamaters
(),
existingSession
.
SolverClientState
);
// update the session
session
.
Update
();
// replace the updated session in the list of existing sessions
int
index
=
this
.
Sessions
.
IndexOf
(
state
);
int
index
=
this
.
Sessions
.
IndexOf
(
existingSession
);
if
(
index
!=
-
1
)
{
this
.
Sessions
[
index
]
=
session
;
...
...
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