TomZ
6f2584f14d
Fix off-by-one
...
The test was on the pprev, so we need a +1
2020-11-17 23:11:05 +01:00
TomZ
262706cf8e
Make loading faulty data more robust
...
Instead of an assert when we encouter faulty data this moves the error
up the stack and allows for rollback.
2020-11-17 20:59:11 +01:00
TomZ
477a536e25
[UTXO] UnitTest rollback-to-checkpoint code
2020-11-17 20:57:32 +01:00
TomZ
089145a3a6
Delete copy constructor
2020-11-17 16:04:45 +01:00
TomZ
3343b7a2b2
Share binding code with bitcore-proxy
...
Additionally, support optional port argument.
2020-11-16 23:09:17 +01:00
TomZ
960e3afeb2
Redo binding logic in all Qt
...
Avoid conversion to and from boost and this solves the issue of trying
to listen to multiple interfaces not working very well.
2020-11-16 22:45:46 +01:00
TomZ
bdcf8ad45c
Show version in the start message
...
This is used by various apps, like indexer. They will now display
something like:
Flowee indexer starting. Version: 2020-7.0 (v1)
2020-11-16 18:59:25 +01:00
TomZ
dad1a0e0c0
Hardcode blockheight for DAA PU
...
Now the protocol upgrade went smooth, we take the effective details
and hardcode the blockheight for each chain we support.
2020-11-16 15:32:28 +01:00
TomZ
93148976e9
add the checkpoint to p2pnet
2020-11-15 15:27:32 +01:00
TomZ
37e1f2fcd3
Fix bad usage of create_directories()
2020-11-14 23:59:01 +01:00
TomZ
2b7ae939cf
Simplify the syncchain action.
2020-11-13 21:03:56 +01:00
TomZ
301a4ca3ee
Fix properly following the chain-tip
...
This is done in several steps:
1. Separate my height from the remote peer heights.
Instead of assuming we have one height, recognize that a peer may
not be at the tip at the same time we are. We monitor headers/invs
to update the 'peerHeight' variable.
2. Ask for merkle blocks from a peer to the maximum height of that
peer (but not later than what we validated to be true).
This avoids us asking past the remotes tip which they didn't like.
3. Redo the SyncSPVAction to use all this and make it much more
reliable in finding peers to download from and getting all the
changes as fast as possible.
2020-11-13 21:03:56 +01:00
TomZ
5fa1b50fa1
Remove duplicate
2020-11-13 20:09:29 +01:00
TomZ
370b374431
Avoid uninitialized data
2020-11-12 19:03:35 +01:00
TomZ
449e84338c
Catch more errors while removing the 'unspent' dir content.
...
We now handle various more corner cases when preparing the unspent dir
for reindexing.
2020-11-10 22:38:50 +01:00
TomZ
9128660272
Fix the hardcoded number for different LANG
...
atof uses locales, so lets drop the decimals.
2020-11-10 22:18:53 +01:00
TomZ
a966ffb129
Remove the hardcoded max message size.
...
We already had in place the blockSizeAcceptLimit as the limit
on messages, which is now the only limit.
In practice this means when the operator sets the maximum mining
size that we adjust the blockSizeAcceptLimit, if they only set the
blockSizeAcceptLimit, we use that (plus a margin) to limit messages
both on the p2p layer and on the RPC (JSON) layer we change the
limit to be twice the blockSizeAcceptLimit (copied those numbers
from BCHN).
2020-11-10 18:33:07 +01:00
TomZ
36a0bb10f2
Improve log info.
2020-11-10 17:28:40 +01:00
TomZ
8c15b5942f
Make scalenet easier to use
...
This adds a parameter interaction. Starting scalenet sets the
maxblocksize (mining) and blocksizeAcceptLimit to be 250MiB.
2020-11-10 17:25:56 +01:00
TomZ
0556bc56d1
Fix bugs in SPV sync behavior.
2020-11-09 18:38:38 +01:00
TomZ
d2869ef06b
Fix bug where we'd ban perfectly good peers
...
Due to misdetection of stalling the download.
2020-11-07 15:03:27 +01:00
TomZ
afd33b2ee0
API docs
2020-11-05 22:06:41 +01:00
TomZ
5e48d0dae7
Be smarter about when to ask for headers.
...
This avoids us asking a bunch of peers the headers while we are not yet
at the tip.
2020-11-05 21:54:33 +01:00
TomZ
062f62af67
Bugfixes
2020-11-05 21:49:32 +01:00
TomZ
e8a2996c84
Persist succesful 'headers' call.
...
This fixes the issue that a headers call did not get remembered when we
were up-to-date.
2020-11-05 21:48:57 +01:00
TomZ
781805d6a9
Less waiting while finding proper peers
2020-11-05 21:47:54 +01:00
TomZ
9397ab54e6
Accept less peers for non-mainnet chains.
2020-11-05 17:42:51 +01:00
TomZ
599ef31340
Add API docs.
2020-11-05 16:56:14 +01:00
TomZ
ae58d68058
Fix loop never increasing.
2020-11-05 16:56:02 +01:00
TomZ
8e2e343695
Fix out-of-range
...
This makes the fetching of DNS based entries work much better and
actively avoids an off-by-one issue when accessing the vector.
2020-11-05 16:55:38 +01:00
TomZ
a337c6b6b5
Use consistent variable typing.
...
Use uint8 and friends instead.
2020-10-31 19:51:04 +01:00
TomZ
8796dc4b7d
Add support for testnet addresses
...
Notice that we only use 2 type of base58 prefixes, mainnet and everything
else. So this support all worthless chains.
2020-10-30 18:08:09 +01:00
TomZ
f7729fd08d
Update chainparams for the scalenet.
2020-10-30 15:39:56 +01:00
TomZ
376fe9dc86
On startup, start downloading headers
...
In most cases headers would be automatically downloaded if we didn't
connect to that peer for a while, but that is not a guarentee so lets
make sure we actually start downloading headers from any peer we can :)
2020-10-29 22:18:10 +01:00
TomZ
3f5fe41534
P2PNet: Support multiple chains.
...
This adds support for the testnet4 chain.
2020-10-29 21:47:53 +01:00
TomZ
bf8e4aa3fc
Remove silly checkpoint.
2020-10-29 20:17:15 +01:00
TomZ
60f754ef58
Make reindex not delete the 'unspent' dir, but its contents
...
This is a feature request following the fact that some sysops use a
symlink for the unspent dir and don't want the reindex to delete the
symlink itself.
2020-10-29 18:56:04 +01:00
TomZ
2d90ade9d2
Update specification for testnet4 to actually validate.
...
Specifically: SCRIPT_ENABLE_SCHNORR.
2020-10-29 18:56:04 +01:00
TomZ
016d9565f2
Remove old detection of outdated UTXO
...
We have had our new format for so long, this only can give false-
positives now.
2020-10-29 18:56:04 +01:00
TomZ
027c1a19d4
Don't ban without logline.
2020-10-28 22:06:15 +01:00
TomZ
6d330622f2
Handle whitelisted nodes different for DSProof punishment.
2020-10-27 16:33:08 +01:00
TomZ
5d9e290f41
Add TODO for async usage
2020-10-27 16:33:08 +01:00
TomZ
42d883d418
A block inherits its 'tree' status.
2020-10-27 16:33:08 +01:00
TomZ
7248251a5a
Fix warning.
...
Avoid std::move here.
2020-10-27 16:33:08 +01:00
TomZ
67cf8955b0
Drop usage of old log-style.
2020-10-27 16:33:08 +01:00
TomZ
4a183dee98
Add needed include
2020-10-26 22:38:28 +01:00
TomZ
b104025f12
Ensure memory leaks are impossible
...
unique_ptr all the way, baby.
2020-10-26 18:30:39 +01:00
TomZ
e7b0995b1a
Make testnet4 have standardness rules on
2020-10-26 18:21:52 +01:00
TomZ
4054b9a7d4
Avoid (re)connecting to incoming peer.
2020-10-26 18:21:52 +01:00
TomZ
ff58ae6a36
Implement the first ASync API command
...
This implements the sendTransaction command using the async framework,
allowing clients to benefit from multi-core systems to process
transactions in parallel when being submitted to the Hub.
2020-10-26 18:21:52 +01:00