Commit Graph

730 Commits

Author SHA1 Message Date
TomZ 00814e24f9 API: Use hash of outscript instead of address
The usage of a ripe160 for bitcoin addresses in the API and in the
Indexer loses some info, specifically what kind of script it is.
Additionally not all types of scripts fit this mold. At best that means
its not future-proof.

This adds a method to the API in order to select from a Tx the hashed
outscript (thats singlehashed sha256) and refactor the address indexer
to use that instead of the ripe160 address.

The API enums broke a little, so I used the opportunity to break it a
lot and clean up the enums in order to make them more future-proof.
But, yeah, software from before this commit is protocol incompatible
with software after this commit.
2019-10-16 22:57:50 +02:00
TomZ d24b4450ea A little cleanup of main.cpp 2019-10-15 19:23:57 +02:00
TomZ 7489baae5a Add testnet seeds
The only one maintained last time I tested is now severely outdated...
So lets just add a bunch more.

also use proper testnet fork point time.
2019-10-15 19:23:57 +02:00
TomZ 3d34226103 Fixes in types and unsigned/signed comparisons. 2019-10-14 19:24:19 +02:00
TomZ 4d501f77f7 Add [[noreturn]] attribute. 2019-10-14 19:24:19 +02:00
TomZ 7593d06473 Use blockheight to enable historical features
We used various ways to enable new features over the last 10 years.
We can remove that legacy code and just set the blockheight.

This cleans up the code quite a bit.
2019-10-14 19:24:19 +02:00
TomZ dae5ce3a6b Fixes and comments in the new MultiSig code 2019-10-14 19:24:19 +02:00
TomZ 2e600dfe7f Import Schnorr multisig code 2019-10-14 19:22:27 +02:00
TomZ 71f0dcf942 Fixlets
Add 'override' keyword on various places.
Make test output a more readable should it fail.
2019-10-10 19:20:04 +02:00
TomZ d684bb5b52 Remove dead code. 2019-10-10 19:18:47 +02:00
TomZ 035cbe34f7 Do not construct out-of-bound pointers in SHA2 code
Backport of Bitcoin Core PR15950
2019-10-10 17:47:56 +02:00
TomZ 4f1bf92aef Remove unneeded semicolon 2019-10-10 17:42:16 +02:00
TomZ 0cac942685 Replace boost::bind with std::bind
This is done almost everywhere, I skipped the boost signals since thats
only really used in the GUI part which is just there to do testing.
2019-10-10 16:18:53 +02:00
TomZ da199a5cf7 Port https://github.com/bitcoin/bitcoin/pull/12460
Assert CPubKey::ValidLength to the pubkey's header-relevant size

Original author: Marco Falke
2019-10-10 15:13:34 +02:00
TomZ 51dbc6163e Add a more generic API for outputscripts. 2019-10-09 19:36:29 +02:00
TomZ b09fa3ab7e Minor fixups
This makes the whitespace usage more in line with the standard.

This also moves an implementation of a virtual method to the cpp file
in order to avoid dynamic linking issues down the line.
2019-10-09 19:35:14 +02:00
TomZ 4e9f66a335 Remove unused CScript::isCommitment() method. 2019-10-09 19:16:52 +02:00
TomZ bba96f3805 Remove unused member 2019-10-09 19:13:03 +02:00
TomZ 1f33f9c6bc Remove various warnings 2019-10-08 14:24:22 +02:00
TomZ 3fc088a76d Add 2019-11 HF activation mechanism. 2019-10-08 14:24:22 +02:00
TomZ 80f27ee26d Make CheckMinimalPush exposed and unit test it. 2019-10-08 14:24:22 +02:00
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