Commit Graph

11775 Commits

Author SHA1 Message Date
TomZ 3d4b37a34b Bugixes in reconsiderblock and helpful message 2019-04-21 17:32:47 +02:00
TomZ 2b0260bdf5 fix unneeded space after exception log message 2019-04-21 17:32:41 +02:00
TomZ 8f982bb3c5 A little more verbose log output 2019-04-21 17:32:27 +02:00
TomZ e0b18781fd Downgrade NET warnings to infos 2019-04-21 17:31:39 +02:00
TomZ b41e2795e7 Add Schnorr support 2019-04-19 17:30:59 +02:00
TomZ b675f3dd82 Revert from bitcoin-abc 5801452e5
This restores the functioning of the unit tests
2019-04-19 17:30:59 +02:00
TomZ a6522c93bc Updated 3rdparty lib secp256k1 to latest 2019-04-19 17:30:59 +02:00
TomZ 86a59c067d Add support for the 'segwit recovery' 2019-04-19 17:30:56 +02:00
TomZ f23aa69a86 Detect the 2019-09 protocol upgrade 2019-04-17 16:02:54 +02:00
TomZ f27d7a80ad Remove 'latest' from diverging master branch 2019-04-15 22:45:13 +02:00
TomZ 495040a8dc mark latest branch 2019-04-15 22:28:33 +02:00
TomZ 67865e4615 Add support to print the version. 2019-04-13 16:23:02 +02:00
TomZ 0c602e1f72 Start branch 2019.03 2019-04-13 09:00:06 +02:00
TomZ edd4cada30 Make compile on older Qt
The method I choose was introduced in Qt 5.8.
This change makes it work on any Qt5 based release.
2019-04-11 19:59:54 +02:00
TomZ ed7ca33d6a Add decoding and printing addresses work.
This now supports cashaddress, legacy addresses and it prints
basic info about the usages of said address.
2019-04-11 18:45:28 +02:00
TomZ aa2c1a6f60 Vastly simplify the NWM callback after sent 2019-04-11 16:20:05 +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 dad38b66c6 Flush indexer to SQL database when we reach Tip() 2019-04-11 00:01:54 +02:00
TomZ ac1a3db905 Write new variable to UTXO-DB info files
Write a changesSincePruning integer which has the following effects;
after a restart;
* We will do a prune faster and/or more often for nodes that are not
  running very long stretches of time.
* We will skip pruning files that don't need it.

Context; pruning of the UTXO is throwing away already spent outputs
that are still in our dirty files.
2019-04-10 23:59:10 +02:00
TomZ cec0c28be3 Make indexer subscribe to block updates
When an indexer is in-sync it will stop actively asking for
new blocks, so the block updates (Hub saying they found a new block)
will then allow the indexer to keep up-to-date
2019-04-10 22:17:13 +02:00
TomZ 78219d5bba Make the indexer-cli and indexer interact well
This adds lots of little things;
* Add GetTransaction API call
* I refactored the GetBlock API a little to reuse code.
* a new 'Version' API call for the hub
* API for the logging manager, so we can set a default
  setup with just C++-APIs
* various (usability) fixes in the FloweeServiceApplication
* Binding to localhost attempts to bind to both IPv4 and v6
* Print the actual transaction hex from indexer-cli (which really
  is just a testing app)
2019-04-10 20:52:04 +02:00
TomZ 890ebf2650 Remove obsolete method GetTransaction
It was a bad attempt of correctness and with Indexer it is ready to be
retired.

The RPC methods now just look in the mempool.
2019-04-10 16:16:05 +02:00
TomZ aea9c25c15 Make indexer-cli have more suitable output 2019-04-10 15:38:37 +02:00
TomZ 3e58679108 Add a new app indexer-cli
This is frankly just a testing application at the moment, but you
can connect to a Indexer server and get the information out, so its
at least useful.
2019-04-10 14:32:46 +02:00
TomZ 6cc433c589 Make usage of NetworkConnection::accept() clear
I added some docs to bind() that handlers there should call
accept().
Also made sure that when nobody accepts a connection it actually
gets disconnected instead of just being ignored.
2019-04-10 14:28:33 +02:00
TomZ 76fdd25b51 Avoid exit without save
Only throw at startup when SQL problems occur.
When they occur later ask for a clean shutdown so we can allow other
parts to shutdown cleanly.
2019-04-09 20:22:35 +02:00
TomZ 20694d4f33 Make indexer be a server too 2019-04-09 19:34:55 +02:00
TomZ ccd66a49b2 Document and refactor NetworkService
The main goal of this is to make sure that network services
implementations don't reuse one bufferpool for all their remotes as that
can cause threading issues.
One bufferpool per remote is now made easy.
2019-04-09 17:24:38 +02:00
TomZ 50b65d054b Cleanups and fixlets 2019-04-09 14:49:08 +02:00
TomZ 07f3a57f73 Fix misuse of std::sort API
Its not clear from my reading of the docs, but the std::sort version
that takes a struct actually makes a deep copy of the struct for each
sort. Which means that this usage is a really bad idea if you were
actually storing the data on this struct.
2019-04-09 12:02:45 +02:00
TomZ df83dc8701 Upgrade HashStorage design phase2
Instead of merging a small list into a bigger and bigger list,
write lots of small lists (20MB each or so) and then when we hit
the wanted final size, merge all of those into one.
2019-04-09 11:19:03 +02:00
TomZ 4f0726119c Give nodes which handed us bad blocks a punishment
This means that when a node following a different chain hands us
a known bad block (likely due to a checkpoint) we end up banning
them.
2019-04-08 16:22:37 +02:00
TomZ 1ce6a93984 Redo setup of HashStorage, phase 1 2019-04-08 13:19:54 +02:00
TomZ a3a456cdcd Try to get more speed out of the SQL DB
we chunk the data and make sure we create a transaction so autocommit
is turned off.
2019-04-06 19:00:55 +02:00
TomZ e14254f33d Make indexer load a config file for setup
Using standard ini file format.
This is the easiest way to configure it to connect to an external SQL
database.
2019-04-06 15:16:37 +02:00
TomZ 2f9d9520d4 Add support for logging std::list 2019-04-06 15:15:36 +02:00
TomZ 0c97e3261f Cleanup close/disconnect in NWM
Specifically avoid clearing the messages queue when the other side
disconnects.
2019-04-06 12:28:41 +02:00
TomZ ef5dafe6e0 Add private header warnings 2019-04-06 12:28:34 +02:00
TomZ cec1950650 Make connection wait on destructor
Make sure that a NetworkConnection object (which owns the callbacks)
doesn't return from its destructor until the already scheduled callbacks
in another thread have been completed.

This avoids shutdown scenarios where we execute in a deleted
object.
2019-04-06 11:59:49 +02:00
TomZ dfb28874ca Adjust design by inverting hash
Additionally I split the sql data over multiple tables
to avoid a forever-growing one.
2019-04-05 23:11:37 +02:00
TomZ 9846b467e3 Move code and avoid work.
Move the creation of the ping message to the constructor (from the
connection-established method) so we are certain it gets done exactly
once.

Also avoid putting default (invalid) values in the hashmap.
2019-04-04 22:46:39 +02:00
TomZ 69ab1133f6 Remove obsolete addressingtype 2019-04-04 22:46:39 +02:00
TomZ 8759359442 Run unit test on CI 2019-04-04 22:46:38 +02:00
TomZ 5ed3419d9b Add beginnings of the AddressIndexer as well 2019-04-04 22:46:38 +02:00
TomZ 285b27d3b8 Add multiple databases concept to HashStorage 2019-04-04 22:46:38 +02:00
TomZ 88dd81d090 Make find() work properly 2019-04-03 18:55:33 +02:00
TomZ e5d5b9ec91 Merge branch 'master' into addressdb 2019-04-03 18:09:56 +02:00
TomZ 0447d3c9f6 Correctly detect and print finishing of indexer 2019-04-03 16:16:44 +02:00
TomZ 6202d74d62 More branding 2019-04-03 14:58:19 +02:00
TomZ 747d038585 Make nodes that send us a double spend not get banned
Better keep those nodes close.
2019-04-03 14:48:52 +02:00