30 Commits

Author SHA1 Message Date
tomFlowee 716ba62fff Avoid confusing result due to bad input 2026-05-19 19:29:43 +02:00
John Galt d6c59d6aa4 Fix log category and cath more exceptions 2026-05-19 18:57:53 +02:00
tomFlowee 7bb20aa818 Rename method to fix typo 2026-05-14 23:31:17 +02:00
tomFlowee 008eb35f95 Make compile faster
The IDE include checker got to the point where it is actually useful and
this removes a lot of unneeded includes.
Naturally, especially for headers like util.h, this may mean we need to
re-add includes in consuming cpp files that bloats the diff a bit.
2026-05-14 13:27:17 +02:00
tomFlowee b10f6ea2fb Merge UnspentOutputData classes
Two classes that were becoming very similar now are one.
2026-05-13 17:55:43 +02:00
tomFlowee 465aa8630d Move away from deprecated deadline_timer. 2026-04-09 19:25:27 +02:00
tomFlowee d8e50a348e Make results per connection
This is a patch from John Galt to fix the problem that multiple
connections could end up getting settings from one connection
applied to the reply of another.
2025-08-11 14:28:21 +02:00
tomFlowee bc73c0620d Minor fixes. 2025-08-01 17:14:01 +02:00
tomFlowee ec50e8b12d Improve GetTransaction a little
When the remote requests offsetInBlock, also return the blockheight
in the answer, as they basically come in a pair for all normal
usages.
2025-05-15 16:52:49 +02:00
tomFlowee c47c174b7f Fix inconsistent argument name
Now we have -bind / -apibind / -rpcbind as a consistent naming of
arguments.
2025-04-14 16:56:52 +02:00
tomFlowee 553568da32 Delete our connections in destructor.
When we didn't and one was still alive, it might do a callback on the
class after the destructor.
Deleting them makes the callbacks be removed on the server, avoiding
usage after free.
2025-04-14 16:36:27 +02:00
tomFlowee 64a217df74 Use the passed in tx instead of the indirect one. 2025-02-22 16:38:59 +01:00
tomFlowee 65cc857704 Refactor and cleanup AddressMonitorService
This renames lots of variables to be more "correct" (call it
output instead of transaction and similar things).
This removes duplication by moving repeated into methods.

This fixes the behavior of the dsproof calls to be back to
the old unit test, while adding the new fields to the unit
test for minimal change.
2025-02-13 13:46:12 +01:00
John Galt ae5fc27e4f Improve AddressMonitorService
This is a combination of 5 commits.

Improve AddressMonitorService
Changed double spend notifications to new format & include cashtoken data
Updated AddressMonitorService response for txs found in the mempool.
Removed duplicate BitcoinScriptHashed tags
AddressMonitorService update
2025-02-12 16:01:19 +01:00
tomFlowee e4735ebd54 Post commit review of Johns CashToken stuff
This makes minor renames and cleanups.
We merge the 5 different cashtoken booleans into one, making
usage and server-code simpler.
And probably in real use not actually causing bigger messages.
2025-02-12 15:35:41 +01:00
tomFlowee a009b92c59 Revert half of Johns patch to split two features
This splits off the AddressMonitor parts from the previous commit
so we can review that separately.
2025-02-12 15:35:41 +01:00
John Galt 9942126040 Various changes made to the Flowee API to understand CashTokens and imrpove the AddressMonitorService 2025-02-12 15:35:41 +01:00
tomFlowee 1dc2656bef Follow ASIO porting for apps too. 2025-02-11 19:41:22 +01:00
tomFlowee bb7275466b Stop using deprecated asio io_service
This ports the io-service to the source compatible io-context
class, with the most work going to the WorkerThreads which owns
that one.
2025-02-08 19:05:26 +01:00
tomFlowee a674a3fb7c Change returning of 'target' to be a bytearray.
This affects both the BlockChain/GetBlockHeaderReply and the
BlockChain/GetBlockVerboseReply calls.
The field with id 75 was confusingly called 'bits', but this is really
the blocktarget from the blockheaders. We renamed this.

This field is a int-encoded-floating point value and as such it makes no
sense to send it as a simple int. It is now a byte-array.
Notice that the documentation always listed it as a byte-array so we
actually fixed the implementation to follow the spec.
2024-09-16 23:18:34 +02:00
tomFlowee ecbc199cec Remove dead code. 2024-09-16 22:34:13 +02:00
tomFlowee bc47a700a4 Refactor; wrap BufferPool in shared_ptr
As we moved most of the creation of a BufferPool to be via the
Streaming::pool() method, which uses a thread-local, it makes sense
to start cleaning up the design and make it more modern C++.
The above mentioned method would return a reference and you'd see
loads of places use `auto &pool =` which is less than ideal.

As the number of places where we actually instantiate a BufferPool
goes down, the usage of some sort of smart pointer makes more sense.

This now makes all APIs use BufferPool be wrapped in a shared_ptr.
2023-12-21 15:23:23 +01:00
tomFlowee fce11e8d4f Rename file to match class it is in.
This follows the coding style guideline that the file that contains a
class should follow the exact name of this (main) class.

pubkey.{h|cpp} -> PublicKey.{h|cpp}
pubkey_utils.{h|cpp} -> PublicKeyUtils.{h|cpp}
2023-11-24 22:20:40 +01:00
tomFlowee 1ab4d88993 Split version.h
Version.h held mostly stuff for protocol.h, which is a hub-specific file.
The only thing that we actually use is the PROTOCOL_VERSION in our code
and as such that one moved to the interfaces dir.
2022-07-06 22:50:53 +02:00
tomFlowee 05bbba3cb3 Rename class CKey -> PrivateKey 2022-07-06 22:12:33 +02:00
tomFlowee c9af7cca4a Rename class CPubKey -> PublicKey 2022-07-06 21:56:34 +02:00
tomFlowee c33d54ed7d Rename class CKeyID -> KeyId 2022-07-06 21:52:47 +02:00
tomFlowee 9fa877f425 Rename hashing methods to start with lowercase 2022-05-17 00:46:54 +02:00
tomFlowee cca8a885bc Fix coding style issues
Follow the coding styleguide and make the methods lowercase on CKey
2022-05-11 13:46:15 +02:00
tomFlowee b4a3da2642 The 'Server' and 'Api' dirs are not libs
These are technically static libs, but not in any way shared libs.
They are used solely only by this repo and really only by the hub.

Most important, no header files are installed and basically none of
the normal rules for reusable libraries are applied to these files.
2022-02-22 18:39:13 +01:00