Commit Graph

659 Commits

Author SHA1 Message Date
TomZ ba11657cf7 BitcoreProxy; add endpoint & docs
This makes the service mostly self-documenting as it serves plain simple
html pages for error messages which show the end points you can use.

This adds support for the "unspent outputs for address" endpoint.
2019-10-06 13:07:28 +02:00
TomZ a9e546071f BitCore: Add support for address lookup 2019-10-05 16:08:37 +02:00
TomZ 922d8b1f16 Fixlets in types 2019-10-05 16:08:37 +02:00
TomZ 9107d7d3b9 Change member from CScript to ConstBuffer
The Tx::Output struct can do better by keeping the ConstBuffer as
converting to CScript is cheap, the other way around is not.
2019-10-05 16:08:37 +02:00
TomZ 14cd5397db Add convenience methods to ConstBuffer 2019-10-05 16:08:37 +02:00
TomZ 2e37162aa1 AppUtils lib; add search API
The core APIs in Flowee are quite low-level and especially combining
results from multiple services becomes tedius, verbose and thus
error-prone.

For this reason I wrote a new SearchEngine and related classes which
allow one to create a single compound request, submit it to the engine and
get a callback when it is done.

For instance one can now create a request for a transaction by txid and the
system will split this into a txid-lookup and the actual fetch for the
transaction.
Enough callbacks and options exist to be able to add a lot more details
this way in a simple manner.
2019-09-23 11:03:36 +02:00
TomZ 5d3b765823 Fix order initialization warning 2019-09-23 11:01:05 +02:00
TomZ 7390bea9eb Use proper integer width in api. 2019-09-13 23:45:53 +02:00
TomZ 817682025d API make utxo also react to offsetinblock
Since all the APIs use blockheight/offsetinblock instead of TXID we
should be consistent and allow the UTXO fetch API to use this too.
2019-09-13 16:02:22 +02:00
TomZ 4a6845ff76 Fixlets from static code inspector 2019-09-12 15:24:03 +02:00
TomZ c6e48e2e11 Be much more consistent with our types
(socket) ports are uint16_t
log-debug sections are shorts.
2019-09-12 15:23:30 +02:00
TomZ aa15896386 Fix constness and use nullptr 2019-09-12 15:22:34 +02:00
TomZ c2fe9629c1 Remove dead code. 2019-09-12 15:20:29 +02:00
TomZ c5c25a5e29 Minor usability fix
Avoid confusing naming and consistent casing.
2019-09-08 20:51:25 +02:00
TomZ 028fff30a2 Make clang happy 2019-09-07 20:26:53 +02:00
TomZ 40f2e67db8 Fix removing of proof after tx removal
Including new unit test.
2019-09-04 14:12:38 +02:00
TomZ 0412ae756a Simplify this code
This removes some of the experimental additions that no longer are
used and as such restores the older, simpler, design.
2019-09-04 14:12:38 +02:00
TomZ 364918766b Remove obsolete code 2019-09-04 14:12:28 +02:00
TomZ 37b359cdac Implement network awareness of double-spend-proof 2019-09-02 23:57:46 +02:00
TomZ 57220bb124 Handle doublespend proof message in AddressMonitor 2019-09-02 23:55:46 +02:00
TomZ 6cda85e79f Catch DSP exception and pass to interface 2019-09-02 23:54:43 +02:00
TomZ 19bbfe4ce0 Add the concept of DoubleSpendProofs
The DSP is owned by the DoubleSpendProofStorage, which in turn
is owned by the mempool.
Each mempool-entry can refer to one proof.
2019-09-02 23:33:12 +02:00
TomZ 9ca3a908fa move tipValidationFlags() to Validation::Engine 2019-09-02 23:24:28 +02:00
TomZ 83d455a5d4 Help devops with more info. 2019-08-29 22:33:57 +02:00
TomZ 0b152570ee Add ConstBuffer::startsWith()
and include unit test.
2019-08-26 20:48:12 +02:00
TomZ 0af7ef1ead add isEmpty() on ConstBuffer 2019-08-24 22:25:10 +02:00
TomZ 191bc3758d Add a simpliefied NetworkManager::bind() method
One that doesn't require a callback to be passed in.
2019-08-24 22:25:10 +02:00
TomZ 844747fa65 Make configurable which cli options to allow. 2019-08-24 22:25:10 +02:00
TomZ c3ddab9cd4 Make Indexer bind to localhost as default 2019-08-24 22:25:10 +02:00
TomZ e7a7ada953 Cleanup dependencies a bit more.
This means that for apps like 'pos' no longer link against libSSL

The streams no longer zero-after-free, there are no secrets transported
in datastreams so this is useless and avoids linking in one OpenSSL
call.

The insecure_rand() method depended on the openssl code to seed it with
randomness. Now replaced with a proven current-time-milliseconds.
This is enough in those cases because it was always meant to be an
insecure random.
2019-08-24 22:25:10 +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 9faf50029e Fix typo 2019-08-24 22:25:09 +02:00
TomZ 2bb06afa9e Cleanup the link-lines 2019-08-24 22:25:09 +02:00
TomZ d8248aa821 Small refactor; move code.
Move some methods about arguments from util.cpp to Logger.
This makes the logger more stand-alone and this avoids the
global defined in util.h (still to be fixed in future..)
2019-08-23 22:48:39 +02:00
TomZ 1fc9f1fbf8 Add default argument to mid() 2019-08-23 22:34:33 +02:00
TomZ a3e2b89309 remove stray debug statement 2019-08-20 17:59:27 +02:00
TomZ f311073312 Avoid DNS lookups and better logging
When users type an IP address as hostname we optimistically try
to parse them in order to avoid asking the DNS anyway.
2019-08-19 21:43:08 +02:00
TomZ d2cf95d540 Add helper methods Message::matches(...) 2019-08-16 23:40:23 +02:00
TomZ 7579ee4fc6 Install more.
This installs lib secp256k1, as needed to link to some
of the already installed classes.
2019-08-15 22:05:31 +02:00
TomZ 0fdba5a404 Add special postgres SQL statements
When the user selected postgres, use specific SQL statements that are
optimised for it.
2019-08-13 22:21:22 +02:00
TomZ dce04d2323 Add support for listen=0.0.0.0
This is not portable, so Linux only for now.
2019-08-12 23:48:46 +02:00
TomZ c1fa50d7f8 Handle when user asked to log to a file we can't open
This now logs that problem to the console.
2019-08-12 21:51:42 +02:00
TomZ 6cb3e66421 Fix assert
We also return false when there are no listeners.
2019-08-12 11:08:52 +02:00
TomZ 60195ba472 Change defaults, stop enabling xthin by default. 2019-08-12 11:08:48 +02:00
TomZ 9b7e6ba2a8 Fix error reporting on repeatedly adding a tx
This solves the non-feedback on sendrawtransaction when the tx is
rejected immediately because it was formerly seen as invalid.
2019-08-06 23:00:42 +02:00
TomZ 055934b473 Be smarter about which INVs to send and respond to
This still drops the amount of INVs used during the catch-up phase,
while still being a good netizen.
2019-08-06 23:00:36 +02:00
TomZ 0aff6f6eef Beautify the initial log-line. 2019-08-05 23:00:53 +02:00
TomZ 08c7502bab Make logger log errors found at config parse time. 2019-08-05 23:00:52 +02:00
TomZ 3cd54ed5e6 BufferPool; Add simple way to parse a hex string 2019-08-05 23:00:52 +02:00
TomZ fc7f1d519c Add QList debug operator. 2019-08-05 20:17:45 +02:00