Commit Graph

1422 Commits

Author SHA1 Message Date
TomZ 6a8313252d Merge branch '2019.04' 2019-05-15 20:45:18 +02:00
TomZ 5996205a07 add checkpoint and set PU blockheight 2019-05-15 20:44:47 +02:00
TomZ 4addb23158 Fix off-by-one
This is rather embarrasing, but I have to ask why fully synching the
testnet created precisely for this fork (to the same height as the
explorers) didn't fail. Did it not have any schnorr signatures? Otherwise
this bug would have shown.  What good is a testnet then?
2019-05-15 20:17:55 +02:00
TomZ 34bcbd775e comment out debug log 2019-05-15 19:55:18 +02:00
TomZ ba2216d582 Add to CLI clients verbose/quiet options
All client apps (=connecting to a server only) now gained the  verbose
and quiet command line arguments to select a different level of
verbosity.

Servers don't need this as they use a config file.

This also makes the --debug option only for debug builds as the logging
system already doesn't compile in debug statements otherwise, it makes
little sense to try to print them.
2019-05-13 18:27:09 +02:00
TomZ 7fbb6772de NWM: Promote some debug level to warn/info 2019-05-13 12:20:57 +02:00
TomZ 5b155600d9 Make app arguments more consitent
Now everyone auto-connects to localhost unless passed the
option --connect=

Also make indexer find the logs.conf from the same dir as the
commandline passed config file.

This makes running it as a service more useful.
2019-05-09 12:16:11 +02:00
TomZ 8d716cba28 Allow log path to be a dir
Allow logs.conf to supply the file-path as an (existing) directory which
will lead to the result of opening the standard filename in that dir.
2019-05-08 17:04:09 +02:00
TomZ 4995215f2d Fix API inconsistencies
The rule is that all sha256s are serialized like they are printed (so
zeros first for a blockID), this updates various places in the API did
reversed this order.
2019-05-08 12:49:33 +02:00
TomZ d450b73358 revert adding reproducable_build cmake option 2019-05-08 11:15:54 +02:00
TomZ 26747573f7 Import protocol version numbers 2019-05-08 10:53:18 +02:00
TomZ e1388b8ce7 Disconnect nodes that follow a different chain
Nodes that follow a different chain (and thus send us headers that we
already invalidated) now get an immediate disconnect whereas before
we could keep them around for an hour.
2019-05-08 10:51:46 +02:00
TomZ 32c45610cd Further fixes for cashier / PoS
Also upgrade the cashier app with logging, ctrl-c catching
and debug + version command line arguments.

Last, this checks the server version and exits if the Hub
version is too old.
2019-05-08 09:07:17 +02:00
TomZ 8d81cc5471 Create new lib apputils
This lib depends on QtCore, as such it is separated from other libs. As
many apps depend on QtCore we can share classes here to avoid
duplication.
2019-05-07 20:53:22 +02:00
TomZ 82a8e137bb API reviews
Rename 'RawTransaction' to 'LiveTransactions'
Review the AddressMonitorService.
Cleanup and remove some unused items (but keep binary compatible).
2019-05-06 20:13:10 +02:00
TomZ e137a7b59f Add simple memcpy constructor to KeyId / uint160 2019-05-06 14:45:12 +02:00
TomZ 8e191f6fd5 Implement some TODOs in blockvalidation 2019-04-28 23:02:58 +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 d20dd6d70a Cleanup; block-pruning
This has been commented out code for some time and its probably best to
remove dead code so as to avoid it rotting.
2019-04-22 20:33:49 +02:00
TomZ 2577b6f7ef Merge branch 'may19PU' 2019-04-22 12:51:07 +02:00
TomZ 5c7caf35e4 Merge branch '2019.03' 2019-04-22 12:50:21 +02:00
TomZ eca66d8734 Add 'rollback' unit test and make it pass 2019-04-22 12:50:09 +02:00
TomZ b0eb502688 Make start date configurable
introducing: -hf201905-activationtime
2019-04-21 17:45:40 +02:00
TomZ 932cd03ad9 Import blockheights of upgrades on testnet 2019-04-21 17:42:49 +02:00
TomZ d8b9d79f2f Use block-height for DAA PU (201711) 2019-04-21 17:41:47 +02:00
TomZ 4112306616 minor; debug output update 2019-04-21 17:33:00 +02:00
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 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 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 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 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 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 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 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