neoneo-go/pkg/syncmgr
decentralisedkev abb4da9cbd
[PeerMgr] Add Caching and Re-processing system (#263)
[peermgr]

- Add request cache with tests
- Add requestCache to peermgr
- refactored peer manager tests
- Added blockInfo struct, to allow sorting on the blockIndex
- added helper methods for cache, pickItem, pickFirstItem, removeHash,
findHash and refactored tests
- renamed requestcache to blockcache
- refactored peer manager to use block cache for block requests *only*
- added blockCallPeer function to handle block requests only
- refactored onDisconnect to add back any pending peer requests that the
disconnected peer did not complete into the peer manager queue

[peermgr/server]

- Modify onBlock handler in server, to send peermgr a BlockInfo struct

[peermgr/syncmgr/server]

- Modified blockIndex in BlockInfo to be uint32 and not uint64
- RequestBlocks in syncmgr now takes an index along with the hash
- modified syncmgr code to pass index along with hash in all methods
2019-03-30 18:10:27 +00:00
..
blockmode.go [PeerMgr] Add Caching and Re-processing system (#263) 2019-03-30 18:10:27 +00:00
config.go [PeerMgr] Add Caching and Re-processing system (#263) 2019-03-30 18:10:27 +00:00
headermode.go [PeerMgr] Add Caching and Re-processing system (#263) 2019-03-30 18:10:27 +00:00
mockhelpers_test.go [PeerMgr] Add Caching and Re-processing system (#263) 2019-03-30 18:10:27 +00:00
normalmode.go [PeerMgr] Add Caching and Re-processing system (#263) 2019-03-30 18:10:27 +00:00
syncmgr.go Syncmgr: Implement synchronisation manager (#249) 2019-03-28 21:22:17 +00:00
syncmgr_onblock_test.go Syncmgr: Implement synchronisation manager (#249) 2019-03-28 21:22:17 +00:00
syncmgr_onheaders_test.go Syncmgr: Implement synchronisation manager (#249) 2019-03-28 21:22:17 +00:00