@@ -68,6 +68,10 @@ public Node()
6868 networkClientManagerStatic = new NetworkClientManagerStatic ( Config . maxRelaySectorNodesToConnectTo ) ;
6969 NetworkClientManager . init ( networkClientManagerStatic ) ;
7070
71+ // Prepare the stream processor
72+ StreamCapabilities caps = StreamCapabilities . Incoming | StreamCapabilities . Outgoing | StreamCapabilities . IPN | StreamCapabilities . Apps ;
73+ streamProcessor = new StreamProcessor ( new SpixiPendingMessageProcessor ( Config . spixiUserFolder , Config . enablePushNotifications ) , caps ) ;
74+
7175 // Init TIV
7276 tiv = new TransactionInclusion ( new SpixiTransactionInclusionCallbacks ( ) , false ) ;
7377
@@ -81,13 +85,21 @@ public Node()
8185
8286 FriendList . init ( Config . spixiUserFolder ) ;
8387
84- Logging . info ( "Node init done" ) ;
88+ UpdateVerify . init ( Config . checkVersionUrl , Config . checkVersionSeconds ) ;
89+
90+ OfflinePushMessages . init ( Config . pushServiceUrl , streamProcessor ) ;
8591
8692 string backup_file_name = Path . Combine ( Config . spixiUserFolder , "spixi.account.backup.ixi" ) ;
8793 if ( File . Exists ( backup_file_name ) )
8894 {
8995 File . Delete ( backup_file_name ) ;
9096 }
97+
98+ InventoryCache . init ( new InventoryCacheClient ( tiv ) ) ;
99+
100+ RelaySectors . init ( CoreConfig . relaySectorLevels , null ) ;
101+
102+ Logging . info ( "Node init done" ) ;
91103 }
92104
93105 static public void preStart ( )
@@ -96,12 +108,6 @@ static public void preStart()
96108 IxianHandler . localStorage . start ( ) ;
97109
98110 FriendList . loadContacts ( ) ;
99-
100- // Prepare the stream processor
101- StreamCapabilities caps = StreamCapabilities . Incoming | StreamCapabilities . Outgoing | StreamCapabilities . IPN | StreamCapabilities . Apps ;
102- streamProcessor = new StreamProcessor ( new SpixiPendingMessageProcessor ( Config . spixiUserFolder , Config . enablePushNotifications ) , caps ) ;
103-
104- OfflinePushMessages . init ( Config . pushServiceUrl , streamProcessor ) ;
105111 }
106112
107113 static public void start ( )
@@ -114,7 +120,6 @@ static public void start()
114120
115121 running = true ;
116122
117- UpdateVerify . init ( Config . checkVersionUrl , Config . checkVersionSeconds ) ;
118123 UpdateVerify . start ( ) ;
119124
120125 ulong block_height = 0 ;
@@ -147,9 +152,7 @@ static public void start()
147152 // Start the network queue
148153 NetworkQueue . start ( ) ;
149154
150- InventoryCache . init ( new InventoryCacheClient ( tiv ) ) ;
151-
152- RelaySectors . init ( CoreConfig . relaySectorLevels , null ) ;
155+ streamProcessor . start ( ) ;
153156
154157 // Start the keepalive thread
155158 PresenceList . startKeepAlive ( ) ;
@@ -387,7 +390,7 @@ static public void stop()
387390 running = false ;
388391
389392 // Stop the stream processor
390- streamProcessor . uninitialize ( ) ;
393+ streamProcessor . stop ( ) ;
391394
392395 IxianHandler . localStorage . stop ( ) ;
393396
0 commit comments