Commit Graph

730 Commits

Author SHA1 Message Date
TomZ b8cf859fa6 Upgrade NWM to use ringbuffers
for internal purposes the network manager used std::list instances
for things that essentially were FIFO queues.
With high volume of packages being sent this causes a large overhead
and even a crash or two.
So I replaced them with ringbuffers which means that the normal
sending
of data will remove a large selection of mem allocations.
2019-03-24 10:23:52 +01:00
TomZ bcc454f1c6 Add some useful log output 2019-03-23 19:31:31 +01:00
TomZ f6c3efa33e Fixlet (speedup) 2019-03-23 19:31:18 +01:00
TomZ 54c565fdd8 DB files start at 1 2019-03-23 19:24:20 +01:00
TomZ 038f17bbaa Avoid calling logger during shutdown 2019-03-23 19:24:07 +01:00
TomZ e535d39ced Account for rounding errors. 2019-03-21 21:44:14 +01:00
TomZ 05a5af0d34 add parameter interaction max/accept blocksize 2019-03-21 18:43:00 +01:00
TomZ 9c920d1f70 Extend GetBlock API call
Allow interpretation of data to make it easier to
process by remote and less data to send.
2019-03-17 22:49:46 +01:00
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