* Automatically wake up select() when optimistic send was not used
But only when we know that we are actually inside select() and that it
currenlty is unlikely for it to have selected the node's socket for
sending. We accept race conditions here as the select() timeout
will ensure that we always send the data.
* Don't manually call WakeSelect() in CSigSharesManager::SendMessages
Not needed anymore
* Disable optimistic send in PushMessage by default
* Let ProcessPendingInstantSendLocks return true when it did some work
* Introduce own worker thread for CInstantSendManager
Instead of using the scheduler.
* Remove scheduler from CInstantSendManager
* Add missing reset() call for workInterrupt
* Merge #13176: Improve CRollingBloomFilter performance: replace modulus with FastMod
9aac9f90d5e56752cc6cbfac48063ad29a01143c replace modulus with FastMod (Martin Ankerl)
Pull request description:
Not sure if this is optimization is necessary, but anyway I have some spare time so here it is. This replaces the slow modulo operation with a much faster 64bit multiplication & shift. This works when the hash is uniformly distributed between 0 and 2^32-1. This speeds up the benchmark by a factor of about 1.3:
```
RollingBloom, 5, 1500000, 3.73733, 4.97569e-07, 4.99002e-07, 4.98372e-07 # before
RollingBloom, 5, 1500000, 2.86842, 3.81630e-07, 3.83730e-07, 3.82473e-07 # FastMod
```
Be aware that this changes the internal data of the filter, so this should probably
not be used for CBloomFilter because of interoperability problems.
Tree-SHA512: 04104f3fb09f56c9d14458a6aad919aeb0a5af944e8ee6a31f00e93c753e22004648c1cd65bf36752b6addec528d19fb665c27b955ce1666a85a928e17afa47a
* Use unordered_map in CSporkManager
In one of my profiling sessions with many InstantSend transactions
happening, calls into CSporkManager added up to about 1% of total CPU time.
This is easily avoidable by using unordered maps.
* Use std::unordered_map instead of std::map in limitedmap
* Use unordered_set for CNode::setAskFor
* Add serialization support for unordered maps and sets
* Use unordered_map for mapArgs and mapMultiArgs
* Let limitedmap prune in batches and use unordered_multimap
Due to the batched pruning, there is no need to maintain an ordered map
of values anymore. Only when nPruneAfterSize, there is a need to create
a temporary ordered vector of values to figure out what can be removed.
* Instead of using a multimap for mapAskFor, use a vector which we sort on demand
CNode::AskFor will now push entries into an initially unordered vector
instead of an ordered multimap. Only when we later want to use vecAskFor in
SendMessages, we sort the vector.
The vector will actually be mostly sorted in most cases as insertion order
usually mimics the desired ordering. Only the last few entries might need
some shuffling around. Doing the sort on-demand should be less wasteful
then trying to maintain correct order all the time.
* Fix compilation of tests
* Fix limitedmap tests
* Rename limitedmap to unordered_limitedmap to ensure backports conflict
This ensures that future backports that depends on limitedmap's ordering
conflict so that we are made aware of needed action.
* Fix compilation error on Travis
* Remove unused (old) icons
* Remove red line from top/bottom of frame
* Remove red line from about image
* Clean up theme display names
* Remove DASH at the beginning (just redundant)
* Capitalize theme names
* Flip "about" image back on its end
* Fix up about image a bit
* Skip required services and port checks when outgoing connections is a MN
* Only relax default port check when AllowMultiplePorts is true
Co-Authored-By: codablock <ablock84@gmail.com>
It's not a good idea to try to connect to an old address of a masternode.
This will also skip connection attempts when the masternode is not in the
valid set anymore (banned or collateral spent).
* Fix crash in RemoveInvalidVotes()
Caused by lock not being held while accessing lastMNListForVotingKeys when RemoveInvalidVotes() is called from DoMaintenance() and UpdatedBlockTip() at the same time.
* No need to call RemoveInvalidVotes() from DoMaintenance()
MN list only changes on new blocks and we already call RemoveInvalidVotes() from UpdatedBlockTip()
* No need to call RemoveInvalidVotes() until we are fully synced