If we are past at least 2000 blocks of the items stored in a data file we
can delete the revert file and save a couple hundred megabytes of
on-disk storage for every blk file.
We seem to be having a LOT of p2sh double spends on mainnet today,
which caused confusion with people reading the logs.
This clarifies that the current version only supports p2pkh and we
need more research to support others too.
Small refactor; move the partition check away from main and the obsolete
global variables we used to use, instead now just add it to the DB which
owns the data it works on.
This fixes the bug that in various cases we'd incorrectly get a warning
about no blocks being found in the last N hours.
Transactions are only kept in the mempool a limited time before they are
removed and have to be re-entered by the owner of the transaction.
To keep mempools from being too different from the rest of the network we
can flush them based on the fact that if a tx hasn't been included yet in
this time, miners are not seeing it.
At popular demand, move the installing of the cmake support file
that lets external projects find the Flowee libs to our libs dir.
This has the effect that a user can selectively compile and install
the libs dir only in order to use our libraries.
The callback on each transaction was only called when individual tx
were fetched, which is "magic" behaviour and I don't like
inconsistencies.
So, also call the callback for each transaction in a block we fetched.
This will most likely benefit some FloweeJS users when they do some stuff
that I didn't think a good idea, at least this way they will not get
a bunch of errors :)
To send out transactions in the p2p net is quite a lot of work,
you need to find multiple peers to send the transaction to. First
you send an INV, then you respond to a getData to actually send
the transaction and last you wait for 'reject' messages that may
indicate that there is something wrong with the transaction.
This introduces the BroadcastTxData class that wraps a transaction
and gets callbacks for sending and for rejects, abstracting away
all the complexity for the user.
The uint256 and CKeyID classes are the same baseclass with template
differences only, which makes them fragile to use for overloading.
As such rename the convenience overload slightly.
The usage of byte-array in json is not well defined, and as such Qt just
no longer handles it as it could end up causing out-of-bounds issues.
This misuse is limited to our unit test, so this is a cheap update.
Ref; https://bugreports.qt.io/browse/QTBUG-84739
Instead of using open(), which makes unavailable the normal method,
use a new methodname instead.
This issue is a bit of an anti-pattern and it would likely be beneficial
to avoid having this as a subclass at all.
Based on the idea that randomly selecting a peer from our database will
prioritize based on the peers punishment score, this sets the punishment
for never connected-to peers at 10 (out of 1000) just to give a minor
benefit to speeding up the meshing.
This supplies a push notification on txid becoming known to the Hub.
Additionally this changes its close relative the AddressMonitorService
to use a different tag for the transaction data and the
double-spend-proof data so as to make it obvious which one is being
sent.