Commit Graph

12355 Commits

Author SHA1 Message Date
TomZ c4d5304d52 Make findOrphans() method const 2020-08-10 10:13:02 +02:00
TomZ 297a22dfa8 Move and fix partitionCheck()
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.
2020-08-10 10:13:02 +02:00
TomZ dda576b4bc Fix some warnings
Code cleanliness nitpicking.
2020-07-31 15:58:15 +02:00
TomZ c244c94634 Add new Indexer API message: 'version'.
This mirrors the one in the Hub in that it returns the version of the
Indexer running on the server.
2020-07-27 21:27:26 +02:00
TomZ 8e1eefaa81 Improve error message
when user specified wrong offset, send them an error.
2020-07-27 21:26:21 +02:00
TomZ dcff0532dc Improve error message
When missing argument, return to peer a specific message
2020-07-27 12:34:27 +02:00
TomZ 513bde1f7a Avoid unneeded check 2020-07-23 14:46:15 +02:00
TomZ 6cd6c54140 Avoid duplication of numbers over sourcefiles
This simply moves the place where the number is changed to the settings
defaults instead of having various places copy/paste the value.
2020-07-23 14:45:42 +02:00
TomZ 5e28bc14b2 Fix return-type 2020-07-17 22:07:15 +02:00
TomZ 59ac2f259c Update default timeout
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.
2020-07-07 11:16:16 +02:00
TomZ 436a061ddc Port merkle tests to qtestlib 2020-07-05 19:07:02 +02:00
TomZ 7e648699e7 Port some more test to qtestlib 2020-07-05 18:59:09 +02:00
TomZ 3c0367b091 Fix test
The test assumed a timing which naturally failed on some machines,
as such the test now checks for either of the two messages.
2020-07-05 16:31:49 +02:00
TomZ a6c7d1604a Make possible to just compile/install libs
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.
2020-07-05 16:14:50 +02:00
TomZ 3ca3311ee9 port crypt tests to qtestlib 2020-07-05 16:07:53 +02:00
TomZ 190394f0d7 Move bswap test to use qtestlib 2020-07-05 14:03:27 +02:00
TomZ 6fdbd2dfa9 Move arith_uint256_test to qtestlib 2020-07-05 14:01:54 +02:00
TomZ f716847705 Move univalue tests to qtestlib 2020-07-05 12:50:50 +02:00
TomZ 648eb56c9d Drop cmake add_dependencies() calls
When we made the 3rdparty libs be build by cmake the need to manually
add dependencies became irrelevant.
2020-07-05 12:50:09 +02:00
TomZ 34db927e0a Move unit test to qtestlib 2020-07-05 12:34:11 +02:00
TomZ 671bb4e1e1 Add readme for the libs subdir 2020-06-29 22:34:07 +02:00
TomZ 32251471a5 On fetch-block, also notify about each transaction.
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.
2020-06-19 16:40:29 +02:00
TomZ c5a8181299 Pre-allocate a larger buffer
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 :)
2020-06-19 16:40:29 +02:00
TomZ 7e5d3a98dd Fix in apputils/blockchain (floweejs) for assert
This assert would hit in some cases, due to coinbase not getting a
prevtx field.

This solves that properly.
2020-06-19 16:40:29 +02:00
TomZ e8f7698560 Remove stray log-lines. 2020-06-19 16:40:29 +02:00
TomZ 9429baf3dc Increase Tx init version
We don't actually use any new features, but users of our libraries might,
so just default to the new version.
2020-06-19 16:39:59 +02:00
TomZ 0782399891 Fix deprecated warning in protobuf 2020-06-09 23:55:12 +02:00
TomZ 6b992586f0 Make compile with latest Qt 2020-06-09 23:54:44 +02:00
TomZ 652fc1e161 Introduce structure to broadcast transactions.
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.
2020-06-08 21:35:10 +02:00
TomZ c2de615c97 Use enum 2020-06-08 21:31:00 +02:00
TomZ a56ff62c0d Add some useful TransactionBuilder API 2020-06-08 18:47:09 +02:00
TomZ fa18524d77 Update URL to ref-doc. 2020-06-08 18:05:05 +02:00
TomZ cf01da9164 API review: privacySegment
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.
2020-06-07 13:56:55 +02:00
TomZ c92b722c0f Fix test that broke on new Qt version
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
2020-06-05 18:04:56 +02:00
TomZ ef90ed79d6 Avoid overloading virtual method
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.
2020-06-05 16:44:39 +02:00
TomZ 64507d4f75 Be less noisy for newer Qt
The latest Qt (5.15) is advertised to be the last before Qt6.
As a result the Qt devs have already made a lot of small refactors,
but just mark old methods deprecated.
When we start requiring at minimum Qt5.15 this will help us, so far
the deprecation methods are just noise we can't fix without
breaking people's builds. So turn them off.
2020-06-05 15:32:30 +02:00
TomZ bab87a9900 Sync usage of random engine 2020-06-05 15:32:30 +02:00
TomZ 21e77809fa Silence some warnings 2020-06-05 15:32:11 +02:00
TomZ dd251ba242 Merge branch '2020.04' 2020-06-01 20:03:15 +02:00
TomZ bd2ea54ca8 Increase timeout
Debug runs seem to take longer than the 5 seconds default too often that
this is an issue.
Make the timeout 30s
2020-06-01 20:02:01 +02:00
TomZ 73bc9b78ad Pimpl transactionbuilder and install 2020-05-28 22:34:49 +02:00
TomZ 72f1f3733c make clang happy; implicit coversion 2020-05-27 12:14:27 +02:00
TomZ 5dce540238 Make clang happy; override 2020-05-27 12:14:15 +02:00
TomZ f586adf430 Fix clang warning; use static via class, not instance. 2020-05-27 11:59:49 +02:00
TomZ f86c1e771f Remove 'is release' and make Qt client option
The Qt client is not being shipped (nor will it ever be), then maybe
it should not be compiled by default.
2020-05-27 11:55:56 +02:00
TomZ 7fb776f815 Avoid CLANG warning and make this clearer. 2020-05-27 11:36:28 +02:00
TomZ 33c6758ea5 Add some API docs. 2020.04.1 2020-05-23 14:03:42 +02:00
TomZ 2e29bc4f6e When saving to non-existing dir, handle the error. 2020-05-23 14:03:29 +02:00
TomZ a96e927d10 const fix 2020-05-21 19:33:29 +02:00
TomZ 60f1864b74 API review. Use isClosingDown() 2020-05-21 19:33:13 +02:00