Commit Graph

264 Commits

Author SHA1 Message Date
tomFlowee 1b5ae89d31 [Refactor] rename FastTransaction.{h|cpp} -> Tx.* 2021-11-02 11:05:14 +01:00
tomFlowee 639a57d957 [Refactor] primitives/BlockHeader -> BlockHeaderFields
This avoids a naming conflict with a p2p class BlockHeader.

Notice that the block data structures are mostly still private API, they
are in the utils dir but headers are not installed, nobody has needed
them so far.
2021-11-02 11:05:14 +01:00
tomFlowee 50af3dc02c [Refactor] rename FastBlock.{h|cpp} -> Block.* 2021-11-02 10:24:58 +01:00
tomFlowee 6ff0e7c0de [Refactor] FastBlock -> Block 2021-11-02 10:18:24 +01:00
tomFlowee dce57fd8ea [Refactor] rename block.{h|cpp} -> MutableBlock.* 2021-11-02 10:13:23 +01:00
tomFlowee 406dc46671 [Refactor] move CBlockLocator to libs/server
Its not needed anywhere outside the apps.
2021-11-02 09:59:13 +01:00
tomFlowee 4689cc6a92 [Refactor] CBlock -> MutableBlock 2021-11-02 09:36:09 +01:00
tomFlowee 64d901d760 Refactor; CBlockHeader -> BlockHeader 2021-11-02 09:28:35 +01:00
tomFlowee cc2b725452 Install random.h from flowee_utils 2021-10-27 19:14:09 +02:00
tomFlowee 6da5090202 Make converter method available in API.
This allows people to validate and convert a deriviation path from a
string to a vector of numbers.
2021-10-18 22:59:11 +02:00
tomFlowee b8e6ddfb19 Add a specific operator=
This avoids checkers being worries about the inconsistency of a
specific copy-constructor but a generic assignment operator.
The assignment operator can be generic because locking doesn't
care what the content is.
2021-10-13 17:06:58 +02:00
tomFlowee 4252e859e7 Remove obsolete (and untested) code. 2021-10-13 17:06:58 +02:00
tomFlowee c264641cbe Provide hierarchically deterministic wallet parts
This introduces a Mnemonic class for BIP39 (seed words)
validation as well as a HDMasterKey class with provides the
BIP32 & BIP43 support.

All tests went into the apputils unit test.
2021-10-13 17:03:02 +02:00
tomFlowee e30c4ceca5 Wrap new feature in ifdef
The API-wise nice addition of base58 encoding learning about
private keys has as a downside that external projects get the
surprise of pulling in a lot more code.

Those that want to avoid this, while not using private keys, can
simply add
  add_definitions(-DNPRIVKEY)  # avoid private-key using code
to their CMake file.
2021-08-09 20:04:27 +02:00
tomFlowee b1f6f497dd Prevent misuse of API 2021-08-05 22:43:24 +02:00
tomFlowee 3bac1cc9e0 Add setData for CKey style data. 2021-07-31 17:36:15 +02:00
tomFlowee 47f0d955bb Add double include protection 2021-07-29 20:26:03 +02:00
tomFlowee 2308600929 Add convenience constructor. 2021-07-26 15:01:25 +02:00
tomFlowee e7a229e806 Add some API docs. 2021-07-01 20:09:04 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee 3f91689e3e Minor refactor of bloomfilter.
Rename fields to follow the coding guidelines.
Add an isEmpty() getter.
2021-05-23 17:49:57 +02:00
tomFlowee f9a0050220 Update TransactionBuilder / signature type handling
The choice between Schnorr and ECDSA signatures is now per input instead
of once choice for the entire transaction.
2021-05-04 16:57:55 +02:00
tomFlowee 28af16d536 Add TransactionBuilder::pushOutputPay2Script() method
Code modified from snipped shared by user Sandurr on noise.cash.
2021-04-22 12:46:35 +02:00
tomFlowee 793e4ed48d Fix warning: add assignement operator when we have copy-constructor. 2021-04-19 16:29:23 +02:00
tomFlowee ec5e563125 Make TransactionBuilder sign using Schnorr by default. 2021-04-19 16:09:42 +02:00
tomFlowee 6d33d187d4 Add new CKey::signSchnorr() method. 2021-04-19 15:49:56 +02:00
tomFlowee 6682a4a5b2 Rename CKey::Sign() -> signECDSA() 2021-04-19 15:45:02 +02:00
tomFlowee fcb648916d Make pubkey follow coding styleguide 2021-04-19 14:48:18 +02:00
tomFlowee d797b1bf50 Minor additions of helper methods.
Tested in the upcoming unit test.
2021-03-24 21:00:25 +01:00
tomFlowee 41e0739e17 add op_group convenience method to transactionbuilder 2021-03-24 19:08:25 +01:00
tomFlowee 9025a2e2ea Add DoubleSpendService to listen to all double spend notifications 2021-03-16 19:53:14 +01:00
tomFlowee 7406cd6ecf Remove dead code (xor of stream). 2021-03-16 19:34:33 +01:00
tomFlowee 45dd785f39 Follow whole-script sizelimit.
Also add unit test for the op_return limits.
2021-03-13 16:52:04 +01:00
tomFlowee a9d3c2ee92 Support change to allow multiple op_returns 2021-03-13 14:02:38 +01:00
tomFlowee aa57e4bbb2 Merge branch 'blockMetadata' 2021-03-12 14:12:11 +01:00
tomFlowee 5d750eb736 One less historical check needed so far after making them mandatory 2021-03-12 13:18:31 +01:00
tomFlowee 4e0acff905 Make reindex finding blocks massively faster.
The code that connects blocks together uses the block-hash (blockId) for
that, which we always just created on the fly.
Instead store the blockId on the state and in that way make adding
headers not entirely in-sequence be 10 times as fast.

Additionally, we wait with actual validation after a reindex until the
files are all found because otherwise we can't save the meta blocks.
2021-03-12 11:21:46 +01:00
tomFlowee c73a9d850e Fix compiler warning. 2021-03-12 10:09:03 +01:00
tomFlowee 51e671fefd Allow eliding by the compiler. 2021-03-08 13:48:33 +01:00
tomFlowee bc945ffaaf Remove silly code. 2021-03-08 13:48:20 +01:00
tomFlowee 018a855e03 Avoid confusion.
People all over the Internet, including on the BCH spec, seem confused
about these enum values. They think they are opcodes.
So lets be clear and rename them to the thing they are. Placeholders or
a return-code.
2021-03-06 14:50:40 +01:00
tomFlowee 630b8422ed Upgrade RPC method to take a blockhash
This also moves the code to search linearly in a block onto the
FastBlock class, for reusal.
2021-03-03 10:17:14 +01:00
tomFlowee 048d5b83a8 make defaults more sane 2021-02-23 17:12:59 +01:00
tomFlowee bf88ee6218 Check inputs better 2021-02-16 19:22:33 +01:00
tomFlowee 08c04b3b25 Assume less and check the inputs better
Should an Tx::Iterator be created on some random data we are now
checking the read values better.
2021-02-16 18:56:13 +01:00
tomFlowee b4df28bd90 Avoid programming errors, add assert. 2021-02-11 15:23:35 +01:00
tomFlowee 1f2f7c36d2 Port the boost container to the std one.
The unordered_map is now available in stl, and said to be better,
so lets slowly switch over
2021-02-03 16:31:46 +01:00
tomFlowee 94ae61132b Promote 'interpreter' to the utils lib.
Being able to parse bitcoin-script is useful for users other than
the hub, using the flowee shared libraries they can now do so.
2021-01-21 15:47:46 +01:00
tomFlowee 7b0949031f Rename CHashWriter::GetHash to finalizeHash()
as the expected behavior of 'get*' is a const method, it is harmful to
name a method such when it actually alters the state of the method such
that subsequent calls will produce a different result.
2021-01-20 22:51:48 +01:00
tomFlowee 449dc47871 Move CReserveScript to the only user: the wallet
This does remove the feature that mining can use the internal wallet as
a source of coinbase addresses, but since Flowee doesn't actually ship a
wallet, that was just not a good reason to keep an unused class in the
libs.
2021-01-20 22:43:37 +01:00