Replace an assert() in Unserialize() with the actual behavior we want,
i.e. making sure that vRandom is empty. Before the assert() was added,
the code called Clear() which ensured vRandom was empty. Clear() was
changed to the assert() in BTC commit b138973a8b4bbe061ad97011f278a21e08ea79e6
to prevent recursive locks but risks crashing the node. Instead, we
just empty out vRandom.
The addition of EXCLUSIVE_LOCKS_REQUIRED is not needed to fix
this but seems prudent since Serialize() has it and the original code
from BTC has EXCLUSIVE_LOCKS_REQUIRED on all the methods of this class.
As a side note, crashing a full node with an assert() and possibly
corrupting the wallet.dat, block files and other data is REALLY
FUCKING DUMB. Instead, code should be written to prevent the
possibility of crashing or throw an exception with a useful error.
From BTC Core https://github.com/bitcoin/bitcoin/pull/9037/ with modifications to support our asmap.
This has a small part of code commented out that depends feeler connection code.
Any projects which want to use Hush code from now on will need to be licensed as
GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/
Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive
code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull
in changes from the Hush Full Node without permission from The Hush Developers,
which may in some circumstances grant an MIT license on a case-by-case basis.