Commit Graph

12179 Commits

Author SHA1 Message Date
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
TomZ 6d9881f413 Play with punishment
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.
2020-05-20 20:31:19 +02:00
TomZ 5b63dd4c9b P2PNet: Peer downgrades log-level 2020-05-20 15:20:09 +02:00
TomZ 60a2203440 Rename license file to recognize it on github/gitlab 2020-05-20 13:18:14 +02:00
TomZ db35dd2d00 new version 2020-05-20 13:18:14 +02:00
TomZ 8fed1957fc This test and gitlab-CI have communication issues.
The black-box testing in a single-core docker setup seems to just
get odd timeouts and issues that no other test environment has.
Giving up on running it on the CI.

Please note that the Flowee private CI will keep running this test
on every commit.
2020-05-19 23:20:14 +02:00
TomZ 69a7db91ec Introduce TransactionMonitorService
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.
2020-05-19 20:57:51 +02:00
TomZ 82dfd082cd Initial support for a Transaction Monitor API 2020-05-19 08:29:31 +02:00
TomZ 52f40acb93 Speed up loading 2020-05-19 08:27:53 +02:00
TomZ a5e6bea027 Merge branch '2020.03' 2020-05-18 22:52:19 +02:00
TomZ e9a2437c2d Add unit tests for UTXO and fixes
This fixes that the .info file is sometimes not written when nothing
changed in the db file.

This fixes that the info file with .1.info extension is reused again
and again, effectively reducing the usefulness of the snapshots.
This only really affects the indexer as pruning avoids this most
of the time.

Closes issue flowee-issues#6
2020-05-18 22:51:41 +02:00
TomZ 7ba11b9880 Unify usage of random number generator. 2020-05-18 19:53:11 +02:00
TomZ 45d9ac3bd2 Make Peer listen to Bloom filter changes 2020-05-18 14:32:34 +02:00
TomZ cde1372b2e Make PrivacySegment emit signals
this adds a listener interface and a way to emit the callbacks on
changing of the filter.

This also adds a mutex since we expect the Peer to use the filter which
will likely live in its own thread.
This makes the class thread safe and re-entrant.

Notice that we use a recursive mutex to allow various usecase on
altering the bloom filter.
The most involved one is a complete replacement which calls clear and
then various calls to add() style methods.
Second is a single 'add' which can be done without the clear first.

The second needs an explicit lock in the add() methods, which would
deadlock in the first usecase if I didn't pick the recursive mutex.
2020-05-18 14:25:14 +02:00
TomZ f6bf22e9ad Remember 'reset' time.
This allows the seeder to re-investigate a peer that has high
punishment, but has not been tried for a long time.
2020-05-17 22:31:30 +02:00
TomZ 158a70ca12 Increase requirement for DB size now we persist them 2020-05-16 12:17:24 +02:00
TomZ 01e8bcfb09 Announce all transactions per block at once.
Instead of forwarding one transaction at a time as the peer sends them
to us, bundle them in a group of transactions known to be merkle-checked
and all belonging together in one block.

Since the peer has no obligation (and with CTOR even less) to send the
transactions in natural order, we should get them per block so we know
all transactions forwarded have parents.
2020-05-16 11:01:27 +02:00
TomZ 10cc4443ab Add a mutex to the peer-address-db
As this is a multi-threaded enabled class, even though 99% of it is
reads, we still need to lock.
2020-05-16 11:01:27 +02:00
TomZ cafa0ede08 For wallets, start a sync at startup.
This helps when SPV wallets are still behind on merkle-blocks while the
wallet shut down.
We start instantly again, instead of waiting for the first block to be
mined.
2020-05-16 10:27:00 +02:00
TomZ c09aed6692 Add comment. 2020-05-15 17:41:52 +02:00
TomZ c2d53d75e4 Add some extra methods on the privacySegment
this allows more mature usage of the bloom filter.
2020-05-15 17:18:42 +02:00
TomZ b89d117475 Add checkpoints after latest protcol upgrade 2020-05-15 17:14:46 +02:00
TomZ 3c01d382d0 Merge branch '2020.03' 2020-05-15 15:45:06 +02:00
TomZ 21f519190d Fix copy/paste issue 2020.03.3 2020-05-15 15:13:52 +02:00
TomZ c14aa3c1f7 Forgot to copy this. 2020-05-14 22:50:51 +02:00
TomZ 71c529df4d Indexer-cli now aligns numbering 2020-05-14 22:10:17 +02:00
TomZ f4ce2cbf73 Cleanup the indexer-cli client
* avoid using warning/fatal log levels as they go to stderr
* correctly exit at end in more cases
* Limit size of transaction we dump on screen unasked.
* remove dead code.
2020-05-14 21:43:48 +02:00