Commit Graph

67 Commits

Author SHA1 Message Date
TomZ d86c5a837f Make orphancache follow coding style-guide.
member methods start with a lowercase character.
2019-11-21 20:03:26 +01:00
TomZ 175096b2bd Refactor: move files
Move some files back to the server "library".
Merge the 'console' lib with server, as it doesn't really make sense with
just one file and nobody exclusively linking to it.

The server "libary" is not really a library, its the place we put all
the files shared by hub-qt hub-cli and hub.
We no longer depend on these files from other places (mostly due to
moving to the new logging framework) and as such we can move the files
back.
2019-11-13 19:09:24 +01:00
TomZ d573e307c3 Refactor; move SplitHostPort to utilstrencodings 2019-11-12 15:35:54 +01:00
TomZ 60390cc452 Promote multisig tests to the new test framework 2019-10-14 19:24:19 +02:00
TomZ 7593d06473 Use blockheight to enable historical features
We used various ways to enable new features over the last 10 years.
We can remove that legacy code and just set the blockheight.

This cleans up the code quite a bit.
2019-10-14 19:24:19 +02:00
TomZ 4e9f66a335 Remove unused CScript::isCommitment() method. 2019-10-09 19:16:52 +02:00
TomZ df7de2ecd2 Clean up the hairy ball of util.cpp
Move some globals and all stuff pulling in crypto to the
server/serverutil.cpp file

Remove dead code.

Move several items that were used in only one place to the respective
files using them.

Move the class WaitUntilFinishedHelper into its own file.

Made sure no header includes utils.h
remove a handfull of files including utils.h for nothing.
2019-08-24 22:25:09 +02:00
TomZ fa360484ba Move uint256_tests to bitcoin-protocol tests
and convert from BOOST to testlib.
2019-07-29 21:45:25 +02:00
TomZ 1aacb3ae52 Vastly simplify mempool-acceptance
This removes the attempt at magic (predicting future) component
called the fee-estimator.
The direct effect is that all transactions have as a mempool acceptance
the same minimum fee. Regardless of how full the mempool or blocks were.

This mempool-acceptance minimum fee is 0 sat/byte. (aka free)

Notice the node-wide free-tx accept-limiter is going to avoid us getting
overloaded.
2019-06-28 14:02:11 +02:00
TomZ 449f91f46d Move solver method to utils lib
The code that detects standard script-types is now available as a
library function, renamed to live in a namespace;
Script::solver()
2019-06-06 22:21:46 +02:00
TomZ a1dfd1cde9 Work on installable headers 2019-06-03 10:59:33 +02:00
TomZ fbfc0f2015 update test to follow API change 2019-06-03 10:59:33 +02:00
TomZ 7203a058a3 Change API call SplitHostPort slightly
Instead of taking an int for the port, take a short.
This matches better with the networkmanager EndPoint struct.
2019-06-02 20:16:49 +02:00
TomZ f868a8274e Make all protocol upgrades equal.
The "UAHF" one used to be "more equal", mostly just because it happened
to be the first.
This makes them all equally equal.

Specifically this removes the special casing and the enum for the 201708
HF (aka BCH fork-point).
We select the right branch now purely based on the historical check-
points.
2019-06-02 13:57:47 +02:00
TomZ a7f9b9fed5 Remove obsolete code.
Remove txIndex option, its move to Flowee Indexer

Also remove the GUI option for setting the amount
of "script validator threads". :D

Remove DBCash command line option too, equally obsolete.
2019-04-22 21:16:10 +02:00
TomZ 2577b6f7ef Merge branch 'may19PU' 2019-04-22 12:51:07 +02:00
TomZ 5dcc687273 Promote BlockValidation test
This includes a little refactor to make the test init and cleanup
after each individual unit.
2019-04-22 12:49:53 +02:00
TomZ b41e2795e7 Add Schnorr support 2019-04-19 17:30:59 +02:00
TomZ 707d2212de Move encoding (base58) out of server lib
Also write some new accessor methods on the baseclass.

The longer term idea is to make the server itself only use the uint160
raw version for bitcoin addresses.
For now move the encodings (between that uint160 and human-readable) to
the utils library.
2019-04-11 16:20:04 +02:00
TomZ 69ab1133f6 Remove obsolete addressingtype 2019-04-04 22:46:39 +02:00
TomZ dc1f721ce5 Rename some old code to use the product name 'Hub' 2019-04-02 17:45:19 +02:00
TomZ 3d33bdad99 [cmake] Cleanup include paths
as the number of applications grows it makes more sense to separate
the 'server' library from the actually reusable libraries.
To recap, the 'server' library is what we started with when importing
all the code from the hub. Slowly we are moving good code out that
is stand-alone and reusable.
2019-03-29 21:52:07 +01:00
TomZ 6b29387801 Move NetworkManager unit test to own executable 2019-03-24 10:23:52 +01:00
TomZ 557c2000f2 Move CKey to live in utils as well 2019-03-13 22:43:25 +01:00
TomZ cfe690320d Move various standalone simple classes into utils
The 'server' library has always been a catch-all and
ideally only the hub links it in (far future goal).
In line with this I move a list of files out of server
into the utils lib.
I choose 'utils' because all these are plain old data
objects that many crypto apps will find useful.

now in utils/primitives/
* CScript
* CPubKey
* CTransaction
* CBlock
* FastTransaction
* FastBlock
* CScript

streams.h is now in utils/streaming/
hash.h is now in utils/
2019-03-11 15:40:42 +01:00
TomZ c367278a1d Cleanup resizing code
We no longer resize blk / rev files, which was a premature optimization.
This means this code is obsolete.
2019-02-06 13:40:40 +01:00
TomZ 135bbb9a5f Cleanup BOOST_FOREACH -> for(:) 2018-12-30 15:33:11 +01:00
TomZ 4623a07968 Remove some usages of the multi-chain feature
During the BCH fork-off time we allowed the client to be started
as either BCH or BTC and as such there are several code-paths
that behave different based on this user setting.
We remove those as we no longer allow starting as BTC client.

This also removes the check for the min-block-size (rollback protection)
as this is accomplished by the checkpoints on the BCH chain.
2018-12-30 13:33:25 +01:00
TomZ d36d99426b Migrate more tests out of boost to qtestlib 2018-12-28 22:26:33 +01:00
TomZ 18d032a556 Transfer more to QTestLib
As boost testlib is extremely IDE unfriendly, as well as human
unfriendly with lots of macros for basic C++ functions (like methods!!)
this is better for me.

But the real reason is that its just unstable. I get double deletes
on some releases of boost and I'm missing plain features that all
other test frameworks have.
For instance a QCOMPARE shows what is expected vs what we got. Boost
just fails.
In QTestLib I can mark a test as "expect fail" an idea that boost
tried and failed (can easily create false positives).
2018-12-28 16:21:49 +01:00
TomZ 3e3f8843f3 Remove the optional replay protection feature
Its sundown has passed, so the code is now effectively dead.
2018-11-29 23:13:48 +01:00
TomZ 830726ef88 Make mining work again.
* Make mining software honor CTOR resorting.
* Fix bugs
2018-11-20 20:44:06 +01:00
TomZ 71b45cd38c Merge branch 'dev/HFNov2018' 2018-11-15 23:40:56 +01:00
TomZ c2412a0e59 Add testing for CTOR 2018-11-15 23:35:43 +01:00
TomZ 9aab378b0a Add checks for 100 bytes min tx size 2018-11-15 23:34:05 +01:00
TomZ 66b610adac Fix compile of tests without wallet 2018-11-13 23:36:35 +01:00
TomZ 35225f1400 Update API to make keys by default compressed 2018-11-13 14:30:17 +01:00
TomZ e0b3a14daa Import unit tests 2018-11-08 10:53:16 +01:00
TomZ 7b76d177e8 Remove chain obfuscation misfeature. 2018-11-02 20:42:45 +01:00
TomZ d8dfec2c26 Make test a bit more stable 2018-10-22 13:08:35 +02:00
TomZ 90f635e8ec Add a test for a cornercase of appendHeader and fix it. 2018-10-21 20:38:34 +02:00
TomZ fdd693541e Make the UTXO have some limits "configurable"
This change makes the limits be static variables, which means they are
only settable once for a process. The only usecase so far is to use much
smaller limits in testing situations.
2018-10-21 13:21:24 +02:00
TomZ be1c403586 port unit test and add benchmark 2018-10-08 22:30:21 +02:00
TomZ a2928b91eb Simplify
On all mature operating systems and filesystems creation of a 1GB file
will not actually use that data, only when we start using blocks does
the disk space get used.
As such this is a premature optimization that Core added and I ported to
Flowee which this commit removes.

Additionally, increase the block file size to 1GiB
2018-10-05 20:49:44 +02:00
TomZ 9aec9e5eeb Merge branch 'master' into UnspentOutputDB 2018-09-24 21:25:34 +02:00
TomZ 4a52fd62ca Add test for duplicate inputs.
This failed on Bitcoin Core (with a crash), best way to show we don't
crash is to write a passing unit test.
2018-09-19 21:39:13 +02:00
TomZ 82a670787e Merge branch 'master' into UnspentOutputDB
Conflicts:
	testing/prevector/test_prevector.cpp
	testing/test/test_bitcoin.cpp
	testing/utxo/test_utxo.cpp
2018-08-15 20:30:45 +02:00
Tom Zander 69e7cd89f8 Merge branch 'master' into 'master'
Add CuckooCache

See merge request FloweeTheHub/thehub!6
2018-08-15 18:22:22 +00:00
TomZ 7df238b281 Refactor tests a little
Duplicate the test_bitcoin file into the common dir,
I hope to remove the original in future.
Make the common dir a new static lib and create a new
qtestlib based unit test out of the old doublespend unit test.
2018-08-14 22:44:00 +02:00
TomZ ce63d5165f Move prevector to its own test since its slow (16s) 2018-08-14 15:53:00 +02:00