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
065a6810
Commit
065a6810
authored
Jun 12, 2017
by
Dan Gershony
Committed by
GitHub
Jun 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #97 from bokobza/master
Added call to walletManager Initialize in the lightwallet feature
parents
9145a6ef
6e82396e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
LightWalletFeature.cs
Breeze/src/Breeze.Wallet/LightWalletFeature.cs
+4
-1
LightWalletSyncManager.cs
Breeze/src/Breeze.Wallet/LightWalletSyncManager.cs
+11
-0
No files found.
Breeze/src/Breeze.Wallet/LightWalletFeature.cs
View file @
065a6810
...
@@ -9,15 +9,18 @@ namespace Breeze.Wallet
...
@@ -9,15 +9,18 @@ namespace Breeze.Wallet
public
class
LightWalletFeature
:
FullNodeFeature
public
class
LightWalletFeature
:
FullNodeFeature
{
{
private
readonly
IWalletSyncManager
walletSyncManager
;
private
readonly
IWalletSyncManager
walletSyncManager
;
private
readonly
IWalletManager
walletManager
;
public
LightWalletFeature
(
IWalletSyncManager
walletSyncManager
)
public
LightWalletFeature
(
IWalletSyncManager
walletSyncManager
,
IWalletManager
walletManager
)
{
{
this
.
walletSyncManager
=
walletSyncManager
;
this
.
walletSyncManager
=
walletSyncManager
;
this
.
walletManager
=
walletManager
;
}
}
public
override
void
Start
()
public
override
void
Start
()
{
{
this
.
walletSyncManager
.
Initialize
();
this
.
walletSyncManager
.
Initialize
();
this
.
walletManager
.
Initialize
();
}
}
public
override
void
Stop
()
public
override
void
Stop
()
...
...
Breeze/src/Breeze.Wallet/LightWalletSyncManager.cs
View file @
065a6810
...
@@ -103,11 +103,22 @@ namespace Breeze.Wallet
...
@@ -103,11 +103,22 @@ namespace Breeze.Wallet
this
.
blockNotification
.
SyncFrom
(
this
.
chain
.
GetBlock
(
height
).
HashBlock
);
this
.
blockNotification
.
SyncFrom
(
this
.
chain
.
GetBlock
(
height
).
HashBlock
);
}
}
/// <inheritdoc />
public
void
ProcessBlock
(
Block
block
)
public
void
ProcessBlock
(
Block
block
)
{
{
var
chainedBlock
=
this
.
chain
.
GetBlock
(
block
.
GetHash
());
// if the newly received block is too far forward, ignore it (for example when we start receiving blocks before the wallets start their syncing)
if
(
chainedBlock
.
Height
>
this
.
walletManager
.
LastBlockHeight
()
+
1
)
{
this
.
logger
.
LogDebug
(
$"block received with height:
{
chainedBlock
.
Height
}
and hash:
{
block
.
Header
.
GetHash
()}
is too far in advance. Ignoring."
);
return
;
}
this
.
walletManager
.
ProcessBlock
(
block
);
this
.
walletManager
.
ProcessBlock
(
block
);
}
}
/// <inheritdoc />
public
void
ProcessTransaction
(
Transaction
transaction
)
public
void
ProcessTransaction
(
Transaction
transaction
)
{
{
this
.
walletManager
.
ProcessTransaction
(
transaction
);
this
.
walletManager
.
ProcessTransaction
(
transaction
);
...
...
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