Fix a bug where it appeared as though a notification handler was being
attached to the dcrd RPC client, but actually no notifications were
received until the client was disconnected a new one was created.
Now, rather than delaying attaching the notification handler, it is
attached immediately upon client creation and vspd does not start
handling the received notifications until it is ready.
Moving the existing integrity checks up into vspd removes the
depdendancy on rpc clients from the database client, and also creates a
natural home for future integrity checks to be added.
Storing all of the essential resources such as db, rpcs and logger in a
vspd struct enables vspd functions to be called without passing a bunch
of parameters unnecessarily. This will be increasingly useful later when
further changes are introduced.
Only fatal errors should result in data integrity checks being stopped.
If a single ticket encounters an error, that error should be logged and
other tickets should still be attempted.
The existing signal.go was inherited directly from dcrwallet, and was
slightly more flexible/complicated than required for vspd. This brings
the code more inline with the dcrd implementation which can be
instantiated in one line and with only one parameter.
Creating these closer to where they are needed tidies things up a bit,
and reduces the chance of them being used unnecessarily (as was being
done previously).
Only attach the dcrd notification listener after all other startup tasks
have been completed.
Attaching the listener before this can result in the notification
handler being invoked whilst startup tasks are still running, which
isn't necessarily a problem, but it is unnecessary and makes a mess of
logging.
Adding the autoclient to vspd created a circular dependency between vspd
and dcrwallet which is cumbersome and not worth the maintence burden.
At this point there are no known consumers of the vspd version of
autoclient, so removing it is not expected to cause problems for
anybody.
The autoclient will continue to live in the dcrwallet repo.
A simple test to ensure an error string returned by the securecookie lib
does not change when we upgrade to newer versions. Important because
vspd checks for this error using string comparison.
A line such as "v3tool" is not specific enough as it does not only
ignore files named "v3tool", but also directories. This is problematic
when adding new files to the directory "/cmd/v3tool/".
sendrawtransaction is expected to fail if the transaction already exists in the mempool or a mined block. dcrd returns two different errors which can indicate this situation. Handling for one of them already existed, and this commit adds handling for the other.
No need to manually construct HTML in this formatting func, it can simply deal with whitespace and then use <pre> tags to display.
Add some tests to validate behaviour.
The "search" input type is functionally the same as "text" but has a nice extra property - most browsers will render it with a "Clear" button to wipe the current input.
Also disable spellchecking on this input.
The client supported overriding the default server signature validation func. This was originally added to facilitate testing, but at the moment only serves to make using the client more clunky and error prone.