Commit Graph

931 Commits

Author SHA1 Message Date
TomZ c3ddab9cd4 Make Indexer bind to localhost as default 2019-08-24 22:25:10 +02:00
TomZ e7a7ada953 Cleanup dependencies a bit more.
This means that for apps like 'pos' no longer link against libSSL

The streams no longer zero-after-free, there are no secrets transported
in datastreams so this is useless and avoids linking in one OpenSSL
call.

The insecure_rand() method depended on the openssl code to seed it with
randomness. Now replaced with a proven current-time-milliseconds.
This is enough in those cases because it was always meant to be an
insecure random.
2019-08-24 22:25:10 +02:00
TomZ df7de2ecd2 Clean up the hairy ball of util.cpp
Move some globals and all stuff pulling in crypto to the
server/serverutil.cpp file

Remove dead code.

Move several items that were used in only one place to the respective
files using them.

Move the class WaitUntilFinishedHelper into its own file.

Made sure no header includes utils.h
remove a handfull of files including utils.h for nothing.
2019-08-24 22:25:09 +02:00
TomZ 9faf50029e Fix typo 2019-08-24 22:25:09 +02:00
TomZ 2bb06afa9e Cleanup the link-lines 2019-08-24 22:25:09 +02:00
TomZ d8248aa821 Small refactor; move code.
Move some methods about arguments from util.cpp to Logger.
This makes the logger more stand-alone and this avoids the
global defined in util.h (still to be fixed in future..)
2019-08-23 22:48:39 +02:00
TomZ 1fc9f1fbf8 Add default argument to mid() 2019-08-23 22:34:33 +02:00
TomZ a3e2b89309 remove stray debug statement 2019-08-20 17:59:27 +02:00
TomZ f311073312 Avoid DNS lookups and better logging
When users type an IP address as hostname we optimistically try
to parse them in order to avoid asking the DNS anyway.
2019-08-19 21:43:08 +02:00
TomZ d2cf95d540 Add helper methods Message::matches(...) 2019-08-16 23:40:23 +02:00
TomZ 7579ee4fc6 Install more.
This installs lib secp256k1, as needed to link to some
of the already installed classes.
2019-08-15 22:05:31 +02:00
TomZ 0fdba5a404 Add special postgres SQL statements
When the user selected postgres, use specific SQL statements that are
optimised for it.
2019-08-13 22:21:22 +02:00
TomZ dce04d2323 Add support for listen=0.0.0.0
This is not portable, so Linux only for now.
2019-08-12 23:48:46 +02:00
TomZ c1fa50d7f8 Handle when user asked to log to a file we can't open
This now logs that problem to the console.
2019-08-12 21:51:42 +02:00
TomZ 6cb3e66421 Fix assert
We also return false when there are no listeners.
2019-08-12 11:08:52 +02:00
TomZ 60195ba472 Change defaults, stop enabling xthin by default. 2019-08-12 11:08:48 +02:00
TomZ 9b7e6ba2a8 Fix error reporting on repeatedly adding a tx
This solves the non-feedback on sendrawtransaction when the tx is
rejected immediately because it was formerly seen as invalid.
2019-08-06 23:00:42 +02:00
TomZ 055934b473 Be smarter about which INVs to send and respond to
This still drops the amount of INVs used during the catch-up phase,
while still being a good netizen.
2019-08-06 23:00:36 +02:00
TomZ 0aff6f6eef Beautify the initial log-line. 2019-08-05 23:00:53 +02:00
TomZ 08c7502bab Make logger log errors found at config parse time. 2019-08-05 23:00:52 +02:00
TomZ 3cd54ed5e6 BufferPool; Add simple way to parse a hex string 2019-08-05 23:00:52 +02:00
TomZ fc7f1d519c Add QList debug operator. 2019-08-05 20:17:45 +02:00
TomZ 130efe603e Merge branch '2019.06' 2019-08-05 12:54:45 +02:00
TomZ 220684c8fc Support SCHNORR on OP_CDS
Schnorr signatures are also allowd on OP_CheckDataSig
2019-08-05 12:50:00 +02:00
TomZ 10ed6d9e38 Fix debug line causing crash. 2019-08-05 12:09:43 +02:00
TomZ b035ee5777 Waste less bandwidth during catch-up. 2019-08-05 11:55:59 +02:00
TomZ c2083fe5b0 Count missing bytes for the tag and length too 2019-08-04 21:19:56 +02:00
TomZ e07083dd85 Make uint256::Compare simpler and be unit-tested 2019-07-29 22:47:36 +02:00
TomZ 5a9d927aa6 Fix const. 2019-07-29 17:11:11 +02:00
TomZ 0755acd1e6 [API] Add double-spend-proofs to addressMonitor
In the address monitor service this detects specifically if a double
spend detected by the Hub is applicable for our subscriber, and if it is
then a Message will be sent to the subscriber.

This introduces a new message type DoubleSpendFound
and changes the API for the TransactionFound message while dropping the
TransactionRejected message.
2019-07-24 18:41:16 +02:00
TomZ 1aacb3ae52 Vastly simplify mempool-acceptance
This removes the attempt at magic (predicting future) component
called the fee-estimator.
The direct effect is that all transactions have as a mempool acceptance
the same minimum fee. Regardless of how full the mempool or blocks were.

This mempool-acceptance minimum fee is 0 sat/byte. (aka free)

Notice the node-wide free-tx accept-limiter is going to avoid us getting
overloaded.
2019-06-28 14:02:11 +02:00
TomZ 896f5e7b68 Merge branch 'master' into MessageBuilder::Reply 2019-06-26 22:20:44 +02:00
TomZ 98b3e7cece use new MessageBuilder::reply() 2019-06-26 22:19:28 +02:00
TomZ 39428f1271 Cleanup the logging at shutdown.
The RPC / HTTP servers were logging about being shutdown even if
they never were started in the first place. This confused people.
Also removed some empty methods.
2019-06-24 21:18:01 +02:00
TomZ 3383d1e1dc Add method MessageBuilder::reply()
This is an overload of message() specifically meant to build
replies to incoming messages.
The behaviour changed here is that incoming messages with
headers other than "RequestId" now get copied to the outgoing
message by default.
2019-06-24 19:53:24 +02:00
TomZ cf4eca26ba Merge branch '2019.06' 2019-06-22 13:02:11 +02:00
TomZ 21ce0163f7 Fix possible threading issue, use an atomic
The changecount integer was updated in two different threads,
so it needs to be an atomic to be safe.
2019-06-22 12:37:01 +02:00
TomZ a56b67caf2 NWM; Create a new socket before reconnect 2019-06-22 10:59:47 +02:00
TomZ 49b6f802a5 Make loglines less confusing
Now multiple different targets use this database, the messages
were confusing. Next to that "pruning" is not really correct
and it lead to confusing. More correct is the term GC.
2019-06-22 10:59:37 +02:00
TomZ 9ee38a2633 Merge branch '2019.06' 2019-06-19 22:47:56 +02:00
TomZ ba213cfe9d Fix optimisation.
It incorrectly assumed all transactions were coinbases.
2019-06-19 22:45:44 +02:00
TomZ c0752a944c Fix sometimes not being able to load a UTXO
In the rare case when we already created a new DB file, but never
managed to write a .info file, the constructor would end up rejecting
the whole DB.
This just drops off the last useless file and goes from there.
2019-06-19 21:49:04 +02:00
TomZ 110d7e8a39 Fix pruning of rather large files 2019-06-19 16:55:59 +02:00
TomZ 75b394e94b Various little fixes
* user selected nodes (using -connect=) are whitelisted, which allows
them to get your headers even if you are still in initial download.
* Avoid crash in a starting node in isInInitialDownload when
pIndexBestHeader was still null.
2019-06-17 22:07:17 +02:00
TomZ 9eb3814103 Stabilize new API 2019-06-17 20:50:17 +02:00
TomZ 499db27a61 Fix parameter interaction blockmaxsize->maxmempool 2019-06-16 23:04:15 +02:00
TomZ 4bba0f0666 Remove dead code. 2019-06-16 23:04:14 +02:00
TomZ 174e9b55dd Make regtest generate() create min 100bytes txs.
The rule that transactions need to be at least 100bytes was honoured for
normal mining already.
Now unit tests and txVulcano which call RPC 'generate' will also comply.
2019-06-16 23:04:14 +02:00
TomZ 4a4a61aeed Add unit test for GetTransaction
This also includes a little blockchain of 114 blocks (the first 100 just
coinbase to reach coin-maturity) with transactions generated by the
txVulcano. So lots of outputs.

I adjusted the BlackBoxTest to load this data into any hub with ease.
2019-06-16 23:04:14 +02:00
TomZ 5ca03cddd5 Futher improve how often save is called
Realize that the changes made before committing are changes I'm
not allowed to save yet and as such move scheduling to the commit()
method.
2019-06-15 21:36:52 +02:00