* Rename NamecoinBlockProcessor.
For Xaya, we will use the same kind of logic for keeping track of an
index of names in addition to the index of addresses. Thus it makes
sense to call it by some more generic name. Here, we rename it to
NameIndexBlockProcessor.
* Create NameIndexMixin from Namecoin.
This factors out some code from Namecoin to a new NameIndexMixin. This
code is what we need to keep track of a name index in addition to the
address index, as done by the NameIndexBlockProcessor.
With the code factored out, the Coin itself only needs to define the
set of possible name operations it allows (and where they have the name
by which the index will be built).
For now, this is only used by Namecoin. But in the future, we will use
it for Xaya as well.
* Add name indexing to Xaya.
Change the Xaya definition so that it handles name scripts correctly:
We want to strip them off the "real" address for indexing by address,
and we want to keep a separate index on names like Namecoin does.
* Split out deserialisation of CAuxPow.
The current DeserializerAuxPow has code for reading a block header
including (potentially) an auxpow. In this change, we split out the
logic for reading the actual CAuxPow instance to its own function.
This makes the code easier to read, as the different steps are more
clearly separated. It will also be useful for working with CAuxPow
instances that are part of a different serialisation format (e.g.
for the Xaya blockchain).
* Add Xaya coin with deserialiser.
This defines a new coin for Xaya (https://github.com/xaya/xaya), with
the appropriate deserialiser methods. Xaya is based on Namecoin, but
uses its own special twist on auxpow for the PoW, so we need to handle
that properly in block-header deserialisation.
Xaya also has names like Namecoin (but with slightly changed semantics),
but handling for them (i.e. building a name index in addition to the
address index) will be added later on.
* Keep more data in truncated Xaya headers.
When Xaya headers are truncated (because they are checkpointed), we still
need to send the algorithm and bits with them. That is needed for the
difficulty retargeting of Xaya to work correctly.
* Define peers for Xaya.
We will run ElectrumX instances on the seeder VPSes. Set those in PEERS
for mainnet (there are no peers for testnet).
JSON errors indicate an erroneous request in some sense; HTTP errors
generally indicate refusal to provide service. These should be handled
differently - the latter with retries (and logging so an admin can fix it);
the former should terminate the request.
WorkQueueFullError was a special case; generalise to ServiceRefusedError.
Fixes#866