smarter network code, fixed various issues

- deciding on the stream at creation time is just silly - it should be done based on the identities (this part is TODO)
- changed NodeRegistry so it doesn't store nodes - this should help to connect faster
- inventory items shouldn't be advertised to nodes that are already aware of them (issue #13)
- objects shouldn't be requested more than once (issue #9)
This commit is contained in:
2015-07-01 06:57:30 +02:00
parent c8960df2b3
commit 2c4d95af2f
11 changed files with 248 additions and 205 deletions

View File

@ -43,11 +43,10 @@ public class Application {
ctx = new BitmessageContext.Builder()
.addressRepo(new JdbcAddressRepository(jdbcConfig))
.inventory(new JdbcInventory(jdbcConfig))
.nodeRegistry(new JdbcNodeRegistry(jdbcConfig))
.nodeRegistry(new MemoryNodeRegistry())
.messageRepo(new JdbcMessageRepository(jdbcConfig))
.networkHandler(new NetworkNode())
.port(48444)
.streams(1)
.build();
ctx.startup(new BitmessageContext.Listener() {