1543 Commits

Author SHA1 Message Date
TomZ 776c9d019b Don't crash when dir already locked
Should you have a hub already running then starting a second aborts
at startup.
Since the shutdown sequence is run it tries to save everything.
This fix avoids a nullptr dereference in this specific event.
2019-03-10 11:34:04 +01:00
TomZ 04c7929b49 Use new style logger in debugMessage 2019-03-09 22:47:54 +01:00
TomZ 0dfae60d3c Add streaming log operator to ConstBuffer 2019-03-09 22:47:54 +01:00
TomZ 27c96cadff Log a bit in the API server when a call is processed. 2019-03-09 22:47:36 +01:00
TomZ 3e24215858 Small refactor
Now the Parsers can be direct parsers, move them to the
general API namespace.
2019-03-08 10:55:26 +01:00
TomZ 2b8ec40f55 Disable wallet RPC calls when not compiled in. 2019-03-08 10:55:16 +01:00
TomZ 1f779a3d9b For the UTXO set the no-CoW flag
This is really only relevant for people using btrfs on Linux, we will
set the utxo dir to be no-copy-on-write which causes all new databases
to follow this flag and be faster due to lack of copying on write.
2019-03-06 15:11:42 +01:00
TomZ ef1aa4b4dd Use std::swap
this avoids a race condition.
2019-03-06 10:13:38 +01:00
TomZ a09339dc05 Applying lessons learned for lock-free programming
The reason there are no standard library versions of lock-free
containers is because you want to always take full advantage of
the details in question.
In this case (read millions of times for each modification) it makes
no sense to use anything other than a standard container, but put in
a copy-on-write block. Simple and easy.
2019-03-05 18:52:49 +01:00
TomZ 0e7dcf5b73 Enable hostname (DNS) based connections. 2019-03-04 20:16:40 +01:00
TomZ 6d13425f53 Make possible to start Application without Params configured 2019-03-04 20:16:21 +01:00
TomZ bc53fe2d4b Make this a little less confusing; use BCH not BTC 2019-03-04 12:46:26 +01:00
TomZ 3de349ed37 Merge branch '2018.02' 2019-03-03 20:05:38 +01:00
TomZ 929491828f Move code to delay checks not relevant 2019-03-03 20:01:34 +01:00
TomZ 7b185570e5 Various cleanups and fixes 2019-02-25 21:35:05 +01:00
TomZ 65fbe65196 Cleanup unused code 2019-02-25 18:41:35 +01:00
TomZ 31650b7340 Squashed commit of the utxo-lockfree-map branch
Replace the m_buckets unsorted map with a lock-free version
based on atomic pointers. (BucketMap)
remove the m_leafs and move those into the bucket struct.
Make the access to the jumptable transactional to avoid one big lock
over all datastructures.

On my threadripper 2990WX the entire 150GB BCH blockchain was
parsed and imported in under 3 hours.
2019-02-23 15:33:22 +01:00
TomZ b7c9b467ff Use less threads 2019-02-23 15:24:31 +01:00
TomZ ea0f634665 Put the log lines in the right group 2019-02-22 22:27:04 +01:00
TomZ 3f1fae0adb Fix case where indexDB inconsistency was not detected properly
When a block is expected to be on-disk, but we don't know where it is
this now no longer leads to a validation process hanging.
2019-02-18 18:31:17 +01:00
TomZ 3c13ff18e4 Make exceptions have a bit more context 2019-02-18 18:31:17 +01:00
TomZ 41b1a2058b Minor fixlet 2019-02-18 18:31:17 +01:00
TomZ caff0b1ee2 Add block-maintainance cronjob
Every 15 minutes we check and take action should there be a need
to delete old revert files or truncate blk files.
2019-02-15 13:31:49 +01:00
TomZ c09a5f94f6 Simplify and avoid race-conditions 2019-02-06 16:30:25 +01:00
TomZ c367278a1d Cleanup resizing code
We no longer resize blk / rev files, which was a premature optimization.
This means this code is obsolete.
2019-02-06 13:40:40 +01:00
TomZ 8998b0afaf Move slow unmapping to be done outside the mutex 2019-02-06 13:39:56 +01:00
TomZ bd9d735a66 Also print the path to the used logs.conf 2019-02-03 19:49:39 +01:00
TomZ 265852c2d6 Fix log category 2019-02-03 19:12:42 +01:00
TomZ 5747a3b888 Change m_flushScheduled to be an atomic 2019-02-03 19:02:53 +01:00
TomZ 775a06b4d1 Make optimization do what the comment says
The optimization was wrongly implemented making it worse
instead of better. This fixes that.
2019-02-03 19:00:55 +01:00
TomZ 135bbb9a5f Cleanup BOOST_FOREACH -> for(:) 2018-12-30 15:33:11 +01:00
TomZ 898cb1fc5f Remove dead code
As the miners have started using the block-version bits for their
own purposes this means that BIP9 checks are rather irrelevant.
Signalling using version bits is rather silly anyway.

In Flowee there will no longer be warnings generated based on
these now outdated assumptions.
And this means less code :)
2018-12-30 13:51:25 +01:00
TomZ 4623a07968 Remove some usages of the multi-chain feature
During the BCH fork-off time we allowed the client to be started
as either BCH or BTC and as such there are several code-paths
that behave different based on this user setting.
We remove those as we no longer allow starting as BTC client.

This also removes the check for the min-block-size (rollback protection)
as this is accomplished by the checkpoints on the BCH chain.
2018-12-30 13:33:25 +01:00
TomZ f790960a97 Another tag.
At least 50% of the UTXO entries reuse the posOnDisk
because they are outputs on the same tx. This changes
such entries from using 2 bytes to 1 byte only when saved
in a bucket.
2018-12-07 20:59:16 +01:00
TomZ 3e3f8843f3 Remove the optional replay protection feature
Its sundown has passed, so the code is now effectively dead.
2018-11-29 23:13:48 +01:00
TomZ 121895df1e Make UTXO DB logging less noisy 2018-11-24 11:50:21 +01:00
TomZ c6297727b8 Change the inserting to be in batches 2018-11-21 20:20:31 +01:00
TomZ d3bb3b1f1d Add support for std::set in the logger 2018-11-21 14:02:20 +01:00
TomZ 4142cd5c65 Merge branch '2018.02' 2018-11-21 12:51:52 +01:00
TomZ f89aa4598c Fix copy/paste error in chaintip-finding
and add some debug output on startup for the chaintips.
2018-11-21 12:49:18 +01:00
TomZ 4cd84c0d34 update comments about flowee.conf 2018-11-21 12:26:17 +01:00
TomZ b256676044 Rename debug.log -> hub.log 2018-11-21 12:18:32 +01:00
TomZ 7bfabca6fc Mark log-levels 2018-11-21 11:31:54 +01:00
TomZ 5ae14f17ac remove BIP9 warnings
The usage of block-version in ASICBoost means that BIP9 is not really
useful to detect, let alone generate warnings for.
2018-11-20 20:44:07 +01:00
TomZ 830726ef88 Make mining work again.
* Make mining software honor CTOR resorting.
* Fix bugs
2018-11-20 20:44:06 +01:00
TomZ 9d5f9d2142 Fix UTXO throttling feature
On low core-count machines the request to save could end up being
delayed since all threads are busy doing things like validating
transactions.
So when a really big block came in I ended up throttling while there
was no save method running in parallel at all.
This fixes this and also makes throtteling be a per-thread thing
instead of doing it inside the mutex.
2018-11-18 14:42:14 +01:00
TomZ 8f9b160012 Make mapper close more agressive
I expect that it would be bettter to make this configurable
because it is based on what the rest of the system is used for.
2018-11-18 12:27:41 +01:00
TomZ 58a9baba3a On loading, calculate nChainWork 2018-11-18 12:12:38 +01:00
TomZ 02ba17bce7 Enable checkpoint for reecent upgrade 2018-11-18 12:12:38 +01:00
TomZ ded88e733c Use simpler logic
Instead of depending on a hardcoded offset, just use index.
2018-11-17 16:46:49 +01:00