Commit Graph

1056 Commits

Author SHA1 Message Date
tomFlowee 449dc47871 Move CReserveScript to the only user: the wallet
This does remove the feature that mining can use the internal wallet as
a source of coinbase addresses, but since Flowee doesn't actually ship a
wallet, that was just not a good reason to keep an unused class in the
libs.
2021-01-20 22:43:37 +01:00
tomFlowee 235df9c5f0 Add loading of DSProof from a constbuffer. 2021-01-20 21:35:20 +01:00
tomFlowee 40b6e4e02c Prefer modern C++
static const -> constexpr
2021-01-20 19:59:54 +01:00
tomFlowee defd3950f0 Remove CAmount typedef
The CAmount name is not helpful as its just an int64_t and not a
class, like the name implies. There were a handful of places where
it was passed in as const-ref, as a good example of this actually
creating sub-par code.
2021-01-20 19:59:35 +01:00
tomFlowee b12e846c92 whitespace, make pretty 2021-01-20 19:14:53 +01:00
tomFlowee 5b7fa33573 Add an extra assert.
The method offsetInBlock assumes the block actually is the one this
transaction is in, the assert helps making sure that this assumption
isn't broken, prodicing unusable results.
2021-01-20 18:23:59 +01:00
tomFlowee 30e28acdd5 Remove unused code.
Move the MutableTransactionSignatureChecker class out of the header and
thereby remove the need to include transaction.h in the header.

This checker was never used in any app, just in the unit tests.

This also fixes includes around.
2021-01-20 18:22:34 +01:00
tomFlowee e1d57f91ba Specify copy-construtor and asssignment operators
To be explicit avoids confusion.
2021-01-20 16:00:25 +01:00
tomFlowee 7647dde2b5 Handle DNS feeds better.
Avoid issues when the DNS is slow.
Increase the score of an IP that is part of a feed.
2021-01-13 18:15:33 +01:00
tomFlowee 1d8ea2a294 Add a testnet4 seeder. 2021-01-13 12:00:32 +01:00
tomFlowee c5fca38956 Check basedir or throw
This makes the download manager fail fast, with appropriate logging, on
misconfiguration.
2021-01-13 12:00:15 +01:00
tomFlowee 371a9c5151 Remove unused type 2021-01-13 11:39:38 +01:00
tomFlowee 20da158341 Avoid compile issues in some cases 2021-01-12 17:30:20 +01:00
tomFlowee 2ed836a71d Support buffers for strings too 2021-01-06 23:16:19 +01:00
tomFlowee 407dd2f2ab Simplify messageparser.
Remove some unused methods and complexity.
2021-01-06 19:37:27 +01:00
tomFlowee 6a92cbf695 Add easier way to set the id on a base58 data. 2021-01-05 22:38:57 +01:00
tomFlowee 3fe98afce9 Minor cleanup
This removes some unused includes from common headers and dead code
from some C++ files.
2021-01-05 22:05:25 +01:00
tomFlowee 094ce6907d Clarify code: avoid non-trivial macros 2021-01-05 21:29:44 +01:00
tomFlowee 2f26329eb9 Add some API docs 2021-01-05 21:29:14 +01:00
tomFlowee 9748d3988f Cleanups and improvements. 2020-12-25 23:51:06 +01:00
tomFlowee e89e3fe8ac Add license text
All sources should have a license text at the top of each file
2020-12-25 23:45:03 +01:00
tomFlowee 12c3defd0d Merge MR 19 of gitlab.com:FloweeTheHub/thehub 2020-12-24 22:44:23 +01:00
Justaphf 517db921f9 Add getmempoolinfo RPC wrapper to API 2020-12-24 09:57:30 -05:00
tomFlowee f65cae8b0f More code to make static checkers happy 2020-12-24 14:14:22 +01:00
tomFlowee 940871b73e Slight speadups and cleanups
Static analisis of code suggested some const& and found dead code.
2020-12-24 14:13:43 +01:00
tomFlowee 0eea8e5231 Add RPC call validateblocktemplate 2020-12-18 15:35:45 +01:00
tomFlowee 51153cbf11 Log improvement
Make sure we log by default about each interface the API listens on.
2020-12-17 09:49:53 +01:00
tomFlowee ba5689a4f4 fix BIP37 processing for non-topologically ordered blocks
Summary:
CMerkleBlock::CMerkleBlock called IsRelevantAndUpdate() on each transaction
in order, which (due to the outpoint-adding feature) assumes a topological
order of transactions in order to work correctly. If an outpoint of
interest were created later in a block than when gets spent, then it would
be added into the bloom filter too late, and thus that spending transaction
would get missed.

This changes CMerkleBlock::CMerkleBlock to scan all outputs first, then
make a second loop to scan all inputs. This requires breaking up the
IsRelevantAndUpdate() function into two parts. The original
IsRelevantAndUpdate() functionality remains fully intact however, as it
gets called from mempool-related code (mempool has topological order) and
tests.

Note that vMatchedTxn.push_back is moved into the second loop so that index
i keeps ascending order, in case that is somehow relevant. (the tests at
least do check this)

A two-loop construction like this will very slightly increase the false
positive rate.

Originally by: Mark Lundeberg
2020-12-17 09:49:15 +01:00
tomFlowee 8e44b058af Add flags getter 2020-12-17 09:08:34 +01:00
tomFlowee 42bbe20cac Change place to look for logs.conf
First search for the logs.conf in the same dir as the -conf file.
2020-12-07 17:35:41 +01:00
tomFlowee 6195f84068 Print IP since peer-ID is useless before handshake 2020-12-07 17:35:10 +01:00
TomZ 9f0a75839a Process static checks warnings 2020-12-06 13:18:08 +01:00
TomZ 0fda43974d Make log line a little more clear 2020-12-06 13:17:24 +01:00
TomZ b0cf4104b1 Merge branch '2020.07' 2020-11-23 14:17:42 +01:00
TomZ d430a4be8a Update all usages of boost create_directories
The API throws when the directories already exist, which is quite
unexpected.
This now changes the code to silently ignore these issues in the
knowledge that the immediately following opening of files will
fail with a nice error message.
2020-11-23 14:09:00 +01:00
TomZ 617fc9afb6 Make API clearer: add UserTag1 - 3
Users are allowed to put (almost) anything in the header and we parrot
it back to them, this API makes it clearer which ones are available for
users.
2020-11-21 12:20:05 +01:00
TomZ 251cc76966 Avoid banning a whitelisted peer on bad headers. 2020-11-18 22:40:46 +01:00
TomZ 27e507cba0 Test and fix reconsiderBlock
This adds a unit test to see if the combination of invalidateBlock and
reconsiderBlock do what we expect to do.

The main issue was that we store an invalidated block in the UTXO and we
forgot to re-validate that on reconsider.

Additionally I avoid writing a lot of unchanged data to the block-index.
2020-11-18 22:08:00 +01:00
TomZ 700c2b59d6 Make controlling blockchain not hidden.
This stops hiding the reconsiderblock and invalidateblock RPC calls.
2020-11-18 16:40:11 +01:00
TomZ d2959dc4c1 Be smarter on reconsiderblock for headers 2020-11-17 23:40:29 +01:00
TomZ 6f2584f14d Fix off-by-one
The test was on the pprev, so we need a +1
2020-11-17 23:11:05 +01:00
TomZ 262706cf8e Make loading faulty data more robust
Instead of an assert when we encouter faulty data this moves the error
up the stack and allows for rollback.
2020-11-17 20:59:11 +01:00
TomZ 477a536e25 [UTXO] UnitTest rollback-to-checkpoint code 2020-11-17 20:57:32 +01:00
TomZ 089145a3a6 Delete copy constructor 2020-11-17 16:04:45 +01:00
TomZ 3343b7a2b2 Share binding code with bitcore-proxy
Additionally, support optional port argument.
2020-11-16 23:09:17 +01:00
TomZ 960e3afeb2 Redo binding logic in all Qt
Avoid conversion to and from boost and this solves the issue of trying
to listen to multiple interfaces not working very well.
2020-11-16 22:45:46 +01:00
TomZ bdcf8ad45c Show version in the start message
This is used by various apps, like indexer. They will now display
something like:

Flowee indexer starting. Version: 2020-7.0 (v1)
2020-11-16 18:59:25 +01:00
TomZ dad1a0e0c0 Hardcode blockheight for DAA PU
Now the protocol upgrade went smooth, we take the effective details
and hardcode the blockheight for each chain we support.
2020-11-16 15:32:28 +01:00
TomZ 93148976e9 add the checkpoint to p2pnet 2020-11-15 15:27:32 +01:00
TomZ 37e1f2fcd3 Fix bad usage of create_directories() 2020-11-14 23:59:01 +01:00