168 Commits

Author SHA1 Message Date
John Galt 96f036e78d script: enable Upgrade9 P2SH32 validation
Adds the SCRIPT_ENABLE_P2SH_32 script flag and applies it at the existing May 2023 activation point
2026-05-07 15:29:55 +02:00
John Galt 45b8369aaf add chipnet chain 2026-05-07 12:21:35 +02:00
tomFlowee b48aa63b58 Add booleans and block heights for upgrades. 2026-05-05 09:05:35 +02:00
tomFlowee f53daa79f6 Cleanup
This removes the transaction-signing code from the hub internal codebase.
The only user for this was the API call signrawtransaction,
and a lot of unit testing code.
I'd argue that if the user needs to send a private key to the hub via
RPC for signing his transaction, then they are doing it wrong.

This also removes the duplicate test double_spend which tests
functionality also tested in the DoubleSpendProofTest.

As an aside, the flowee/utils library still has full signing capability
and we suggest using the TransactionBuilder API for that.
2026-05-05 00:39:16 +02:00
tomFlowee 37f6039898 Remove unused include 2026-05-04 21:32:08 +02:00
tomFlowee 648f348c3a Apply best header to the header tip
This uses the header longest chain if that is longer than the fully
validated chain.
2026-05-04 21:32:08 +02:00
John Galt 26ee594ef5 validation: rescan live full-block arrivals 2026-05-04 21:31:35 +02:00
tomFlowee 25b91d9a48 Make this into a simple for loop
The usage of std::equal is tricky due to the lack of length
variable. This avoids any off-by-one issues.
2026-04-21 00:39:52 +02:00
tomFlowee c3e2f98b75 Remove expensive and not used ToString() methods.
The mining code still called that, this replaces it with standard
log lines that cost less at runtime and keeps the code that is
rarely run away from the shared parts.
2026-04-20 22:45:56 +02:00
tomFlowee 7db4a84bc3 Fix the way that orphan flushing is done.
Also use a faster container for fetching orphans.
2026-04-20 22:21:18 +02:00
tomFlowee f3dc67d3e1 Make faster. 2026-04-20 22:21:18 +02:00
tomFlowee 0a2e552168 Move more logic over to byte-array based Block
This introduces a new BlockHeader helper class which Block and
MutableBlock can both produce, which helps a lot of methods to
be ported to no longer be dependent on us using a MutableBlock
object, which is too costly to use when we have no intention
to alter the block.
2026-04-20 22:21:18 +02:00
tomFlowee 6cb1f97700 Move checking for space to the proper place. 2026-04-15 14:16:33 +02:00
tomFlowee 9aa590cc62 Fix rare benchmark measurement issue. 2026-04-15 14:15:57 +02:00
tomFlowee 25f9e6979c Changes to use the new format
For transaction::checkTransaction():
this in practice avoids lots of mallocs and overhead while doing
transaction checks.

For merkleroot, the same benefits. Avoiding copying and mallocs.
2026-04-15 00:07:09 +02:00
tomFlowee a47dbad5c5 Add reference. 2026-04-15 00:07:09 +02:00
tomFlowee d8b0af0f8e Add way to quickly set up the new log channel. 2026-04-12 00:47:42 +02:00
tomFlowee 12016f316f Cleanup confusing code. 2026-04-12 00:47:09 +02:00
tomFlowee d806b09729 Needs a max too. 2026-04-11 19:00:23 +02:00
tomFlowee 9103051683 Minor logging updates. 2026-04-11 14:38:33 +02:00
tomFlowee 8c28e349b9 Tweak in the numbers. 2026-04-11 14:38:11 +02:00
tomFlowee f44007d86d Add bool on engine: do SPV level validation only
This helps unit tests.
2026-04-09 23:15:08 +02:00
tomFlowee 465aa8630d Move away from deprecated deadline_timer. 2026-04-09 19:25:27 +02:00
tomFlowee efa6c05e1a A API review of CashAddr.h
This removes from the header all private methods, adds API docs and does
some renames that make code using this API much more readable.
2026-02-09 15:28:04 +01:00
tomFlowee 4c52d55169 Lower debug level of this log line. 2025-10-21 19:28:16 +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 e9a9746c67 Restoring this hack for testing.
Turns out it is also about ctor, not just the tx size.
2025-04-14 18:14:20 +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 624257b3a9 Add interruption points for better shutdown.
Also make more responsive as the code could make the shutdown take 120
seconds.
2025-04-12 13:58:46 +02:00
tomFlowee 07f408d601 Turn off validation while not in consensus. 2025-04-12 12:14:59 +02:00
tomFlowee e8aa7b5e0e Update transaction size check.
Get a little bit back into consensus.
2025-04-12 12:11:01 +02:00
tomFlowee 49324fad28 Limit linking to only needed boost libs.
We now removed the need for Boost:chrono in all the libs, to avoid
accidentally linking to it again this change makes the apps link to
the actual specific libs instead of just all.
2025-03-07 15:36:36 +01:00
tomFlowee 64a217df74 Use the passed in tx instead of the indirect one. 2025-02-22 16:38:59 +01:00
tomFlowee 5874f13505 Remove unused include 2025-02-14 22:31:14 +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 a042cecd59 Refactor: move private class declaration to _p.h
This moves the class CBlockFileInfo from main.h to the BlocksDB_p.h
file as that is the class where it is mostly used.

There is a global variable in main.{h|cpp} left but since that is
strictly limited to main.cpp it made no sense to details slip out
via the massively overused main.h
2024-09-25 20:45:12 +02:00
tomFlowee ffeb8e059e Improve logging of libEvent
The log handler sometimes gets handed log strings that have a trailing
linefeed. Which is generated inside of the lib-event code.
To avoid these log-lines taking multiple lines in our own log, this code
removes the trailing linefeed before sending them to our own log.

Notice that as a side-effect we also limit the libevent loglines to 170
characters, which is very generous based on our tests. But this avoids a
little trust in an external library.
2024-09-25 17:18:20 +02: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 671882883c Minor linting fixes 2024-09-06 18:19:58 +02:00
tomFlowee 82e2309c2a Merge branch 'TxTokenIterator' 2024-09-06 18:19:34 +02:00