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
ad73f92c
Commit
ad73f92c
authored
Jun 27, 2017
by
Dan Gershony
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Chcking for segwit activation and adding the behaviour to drop nodes when behind
parent
6b0d5f4d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
3 deletions
+23
-3
LightWalletFeature.cs
Breeze/src/Breeze.Wallet/LightWalletFeature.cs
+21
-3
LightWalletSyncManager.cs
Breeze/src/Breeze.Wallet/LightWalletSyncManager.cs
+2
-0
No files found.
Breeze/src/Breeze.Wallet/LightWalletFeature.cs
View file @
ad73f92c
using
Stratis.Bitcoin.Builder.Feature
;
using
Microsoft.Extensions.DependencyInjection
;
using
NBitcoin
;
using
NBitcoin.Protocol
;
using
Stratis.Bitcoin.Builder
;
using
Stratis.Bitcoin.Connection
;
using
Stratis.Bitcoin.Consensus
;
using
Stratis.Bitcoin.Consensus.Deployments
;
using
Stratis.Bitcoin.Wallet
;
using
Stratis.Bitcoin.Wallet.Controllers
;
...
...
@@ -10,17 +15,30 @@ namespace Breeze.Wallet
{
private
readonly
IWalletSyncManager
walletSyncManager
;
private
readonly
IWalletManager
walletManager
;
private
readonly
IConnectionManager
connectionManager
;
private
readonly
ConcurrentChain
chain
;
private
readonly
NodeDeployments
nodeDeployments
;
public
LightWalletFeature
(
IWalletSyncManager
walletSyncManager
,
IWalletManager
walletManager
)
public
LightWalletFeature
(
IWalletSyncManager
walletSyncManager
,
IWalletManager
walletManager
,
IConnectionManager
connectionManager
,
ConcurrentChain
chain
,
NodeDeployments
nodeDeployments
)
{
this
.
walletSyncManager
=
walletSyncManager
;
this
.
walletManager
=
walletManager
;
this
.
connectionManager
=
connectionManager
;
this
.
chain
=
chain
;
this
.
nodeDeployments
=
nodeDeployments
;
}
public
override
void
Start
()
{
this
.
connectionManager
.
Parameters
.
TemplateBehaviors
.
Add
(
new
DropNodesBehaviour
(
this
.
chain
,
this
.
connectionManager
));
this
.
walletManager
.
Initialize
();
this
.
walletSyncManager
.
Initialize
();
var
flags
=
this
.
nodeDeployments
.
GetFlags
(
this
.
walletSyncManager
.
WalletTip
);
if
(
flags
.
ScriptFlags
.
HasFlag
(
ScriptVerify
.
Witness
))
this
.
connectionManager
.
AddDiscoveredNodesRequirement
(
NodeServices
.
NODE_WITNESS
);
}
public
override
void
Stop
()
...
...
@@ -36,8 +54,8 @@ namespace Breeze.Wallet
fullNodeBuilder
.
ConfigureFeature
(
features
=>
{
features
.
AddFeature
<
LightWalletFeature
>()
.
FeatureServices
(
services
=>
.
AddFeature
<
LightWalletFeature
>()
.
FeatureServices
(
services
=>
{
services
.
AddSingleton
<
IWalletSyncManager
,
LightWalletSyncManager
>();
services
.
AddSingleton
<
IWalletManager
,
WalletManager
>();
...
...
Breeze/src/Breeze.Wallet/LightWalletSyncManager.cs
View file @
ad73f92c
...
...
@@ -23,6 +23,8 @@ namespace Breeze.Wallet
private
ChainedBlock
walletTip
;
public
ChainedBlock
WalletTip
=>
this
.
walletTip
;
public
LightWalletSyncManager
(
ILoggerFactory
loggerFactory
,
IWalletManager
walletManager
,
ConcurrentChain
chain
,
Network
network
,
BlockNotification
blockNotification
,
Signals
signals
)
{
...
...
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