GolangCI complained:
testArray is unused (from deadcode)
But this function was actually wrong being a copy-paste of testMakeStackMap(),
it also didn't conform to testMake... naming scheme, so this fixes it. To make
thing more uniform NewArray() was also changed to return error, map_test.go
code adjusted to this changes and finally array_test.go was added as a stub
for future Array testing.
Like:
Error return value of alg.Write is not checked (from errcheck)
Actually even though the hash.Hash implements an io.Writer interface (that
return meaningful things on .Write()) it has this comment in its
documentation:
// Write (via the embedded io.Writer interface) adds more data to the running hash.
// It never returns an error.
so it should be OK to ignore return results here.
* Added
1) ReverseString method to the Uint160 type
2) ToReverseScriptHash method to convert a base58 address to a reverse script hash
* Simplified ToScriptHash method
- refactored OnBlockBlockMode to use blockPool
- syncmgr now checks for future blocks, instead of looking for a
FutureBlockErr from the Chain. This makes it so that syncmgr does not
depend on the Chain package.
- removed GetBestBlockHash function from config(unused)
- refactored all tests in the syncmgr package
- refactor syncmgr for blockpool
- add nextBlockIndex so that we can add blocks to the blockPool by
comparing their index
- add processBlock helper method,wraps around cfg.ProcessBlock and increments the nextBlockIndex
internally
[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