Commit Graph

1422 Commits

Author SHA1 Message Date
TomZ 3fa2ac225f Make easier for user.
In applications we typically set a debug section
that is the default for that application so devs
can just call logInfo() without any arguments and
get the debug section for his app.
This now works with MessageParser::debugMessage() as well.
2019-03-17 22:49:46 +01:00
TomZ ec0673187c Add new BlockNotificationService 2019-03-17 22:49:46 +01:00
TomZ 8713914c47 Refactor to create a new baseclass for services
A NetworkSubscriptionService baseclass that creates
some metadata for each connection that uses the service.
2019-03-17 22:49:46 +01:00
TomZ a2b9f23246 Make generate() available through the API
This is a regtest only method, so limited usage.
2019-03-17 22:49:46 +01:00
TomZ 4c7d0010cc Make getBlock always return a height and hash
Also work on error reporting to remote.
2019-03-17 22:49:46 +01:00
TomZ 5bd599a1ed Expand GetBlock API call
Add a filter option to allow clients to send addresses
and match outputs against those bitcoin addresses so
only transactions that spend those outputs match will
be incuded in the result.

Add a session state so clients can send a filter
and just reuse that filter in subsequent calls.
2019-03-17 22:49:46 +01:00
TomZ 7d6760c49d Introduce new GetBlock API call
Demote the old RPC one to Legacy.
The old is still useful as it allows the 'verbose' version, but it uses
lots of deprecated tech and thus doesn't scale.
2019-03-17 22:49:46 +01:00
TomZ 504311d13c Merge branch '2019.01' 2019-03-17 22:38:24 +01:00
TomZ 1dd50ca837 For virtual block validation (&mining);
Validate both interblock-spents and double spends.
2019-03-17 22:24:21 +01:00
TomZ e729a59817 Fix APIRPC bytecount for sendRawTransaction
The full hash is returned.
2019-03-17 22:24:07 +01:00
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