This improves several corner cases on detecting if a peer we
are requesting headers from is actually giving them to us.
Specifically, the height could be zero for a genesis-only view, which
caused the detection to always give the higest score (height zero is
seen as special).
After a node is disconnected we now also reset the history in order to
let the new node get measured from only its own performance.
We optimistically create a new info file but as we start we might
instantly realize the file is useless and give up before having written
a single byte.
We now remove that file to avoid stale state.
Also be more verbose on warnings.
- Changed API for HDMasterKey::fromMnemonic to use an enum to specify
BIP39 vs Electrum format phrase
- Added unit test for this class to existing unit tests
These are almost identical to BIP39. They use the same word list except:
- The checksum is calculated differently
- Deriving the master key from them uses a different pbkdf512 salt
("electrum" vs "mnemonic")
The blockchain class can effectively now be shallow,
we can have a list of blockheaders of, for instance, the last year
alone. It builds on top of a known checkpoint (hardcoded block data)
and as long as we do not access block info that is unavailable, things
just work like normal.
We throw at the request of a blockheader that is too old.
Should the peer have been rejected on status or similar, we don't
register a successful connection and avoid the peer from being selected
again since then we don't remove the punishment done on connection
start.
This uses old methods from the ugly utilstrencodings files
and cleans them up to allow us to install this header file and
use these methods outside of theHub repo.
There factually is no difference between char and unsigned char
except in very rare cases (like bitshifting). But in APIs they
are incompatible, which is a pain...
Protocol Buffers interaction is just another serialization standard,
while its widespread it has fortunately mostly been kept out of
anything relevant or important. Mostly due to the fact that is
really quite bad from a technical perspective.
This adds simple and basic support for creating and parsing
protocol buffer messages, mostly to allow interoperability.
If you want quality: use the MessagBuilder/MessageParser ones instead.
This changes the SPV action to not actually exit when sync
is completed, but instead keep running in the background
so it will detect when a wallet loses a peer and reinstate one.
The methodname:
blockHeightAtTime()
makes the reader think about the actual height of the chain at that
time. Returning that value until the timestamp of the next block is
reached.
Now the method actally returns that number.
The code does not do any work to account for blocks going backwards in
time compared to the block before.
We removed the default value in order to avoid misusage of the method
and mistaking the amount with the connection-id.
From Peer we now se the faster overload of punish(), avoiding looping
through the peer list.
Also check return-code when needed.
The secp256k1 imported library would compile a native executable
and run it to create the ecmult_static_context.h file.
This made cross-compiles much harder without much reason as the
output of the executable is always the same. So why not just add
it to git?
This adds a cmake option to compile the gen_context executable,
but the option defaults to OFF.