Commit Graph

662 Commits

Author SHA1 Message Date
TomZ 70d0c55a04 Add standard accessor; dataLength 2019-03-17 22:23:52 +01:00
TomZ bd2c43f4fd Merge branch '2019.01' 2019-03-15 19:26:23 +01:00
TomZ d04b93538c Make mining work again (after CTOR)
Mining currently runs a 'verifyOnly' step which is currently
entirely single-threaded because of CTOR.

Since we are collecting transactions from the mempool
it looks a bit odd to check what we already checked on
mempool-accept again.
2019-03-15 19:16:16 +01:00
TomZ 8deb6dbcd9 Fix comments. 2019-03-15 19:15:48 +01:00
TomZ b3331db7cd Fix log levels 2019-03-15 19:15:28 +01:00
TomZ 0e43b90210 Merge branch '2019.01' 2019-03-14 21:13:26 +01:00
TomZ a00dc19bd3 Pass uint256 by reference. 2019-03-14 21:13:14 +01:00
TomZ 133bb6b14f Fix using wrong txid. 2019-03-14 21:12:08 +01:00
TomZ 6aa8b4a184 Update API for TransactionBuilder to do signing
Allow users to add a private key and other details while
building a transaction and then as we export the final transaction
we sign the input.
2019-03-13 23:07:00 +01:00
TomZ 7e7fe61081 Little bit of review for TransactionBuilder 2019-03-13 23:06:54 +01:00
TomZ c90ae87187 add TransactionBuilder 2019-03-13 23:06:47 +01:00
TomZ a3776b4944 Port CreateAddress over to be a DirectParser
Its silly for such a simple method use bindings
2019-03-13 22:44:19 +01:00
TomZ 43fa503126 [Minor] Fix grammar of comment. 2019-03-13 22:43:25 +01:00
TomZ 557c2000f2 Move CKey to live in utils as well 2019-03-13 22:43:25 +01:00
TomZ a0f39317ea Add an accessor method: Tx::data() 2019-03-13 22:36:00 +01:00
TomZ cfe690320d Move various standalone simple classes into utils
The 'server' library has always been a catch-all and
ideally only the hub links it in (far future goal).
In line with this I move a list of files out of server
into the utils lib.
I choose 'utils' because all these are plain old data
objects that many crypto apps will find useful.

now in utils/primitives/
* CScript
* CPubKey
* CTransaction
* CBlock
* FastTransaction
* FastBlock
* CScript

streams.h is now in utils/streaming/
hash.h is now in utils/
2019-03-11 15:40:42 +01:00
TomZ adacad2992 Merge branch '2019.01' 2019-03-10 14:23:30 +01:00
TomZ a45eaac865 Make validationinterface a bit more consistent
This also fixes some regressions in the zmq API
2019-03-10 14:02:27 +01:00
TomZ d8ecf9cc41 Better warning if you forget to login. 2019-03-10 13:22:14 +01:00
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