10114 Commits

Author SHA1 Message Date
Adrian Gallagher
b6a8a1b28d
Litecoin: Update chainparams and blockchain size 2018-01-18 16:28:03 -08:00
Adrian Gallagher
98dcbd7856
Litecoin: Update hardcoded seeds 2018-01-18 16:28:00 -08:00
Romano
d8b8d96d23
Litecoin: enable support for SSE2 instructions in scrypt via configure --enable-sse2 (#362) 2018-01-18 16:27:56 -08:00
Adrian Gallagher
da8306292d
Litecoin: Adjust splashscreen for testnet/regtest 2018-01-18 16:27:55 -08:00
Adrian Gallagher
231fb558a9
Litecoin: Fix build system 2018-01-18 16:27:51 -08:00
Adrian Gallagher
53aa681e0d
Litecoin: Fix various tests 2018-01-18 16:27:47 -08:00
Charlie Lee
e1ec1a548a
Set final alert message for Litecoin 2018-01-18 16:27:43 -08:00
romanornr
e9801c248d
Litecoin: Zeitgeist2 bool fshift bnNew.bits() 2018-01-18 16:27:41 -08:00
Adrian Gallagher
293d7cac1d
Litecoin: Adjust fee system
# Conflicts:
#	src/policy/policy.h
#	src/test/transaction_tests.cpp
#	src/wallet/wallet.h
#	test/functional/abandonconflict.py
#	test/functional/bumpfee.py
2018-01-18 16:27:39 -08:00
Adrian Gallagher
ec665bae20
Litecoin: Branding
# Conflicts:
#	.gitignore
#	contrib/seeds/README.md
#	doc/README.md
#	doc/README_windows.txt
#	doc/release-process.md
#	qa/rpc-tests/README.md
#	src/Makefile.qt.include
#	src/Makefile.qttest.include
#	src/Makefile.test.include
#	src/bitcoind.cpp
#	src/qt/forms/intro.ui
#	src/qt/test/test_main.cpp
#	src/rpc/mining.cpp
#	src/rpc/rawtransaction.cpp
#	src/validation.cpp
#	src/wallet/rpcdump.cpp
#	src/wallet/rpcwallet.cpp
2018-01-18 16:27:37 -08:00
Adrian Gallagher
a5d4ed049f
Litecoin: Fix copyright year value 2018-01-18 16:27:35 -08:00
Adrian Gallagher
b41ecc6feb
Litecoin: Protocol and default settings
0) Adjust BIP16 & BIP30 enforcement values

1) Reduce amount that peers can adjust our time to eliminate an attack vector. Thanks to
coblee for this fix.

2) Zeitgeist2 patch - thanks to Lolcust and ArtForz. This fixes an issue where a
51% attack can change difficulty at will. Go back the full period unless it's the
first retarget after genesis.

3) Avoid overflow in CalculateNextWorkRequired(). Thanks to pooler for the overflow fix.

4) SegWit ContextualCheckBlockHeader adjustment and extra coverage

5) Reject peer proto version below 70002. Thanks to wtogami for this patch.

6) Adjust default settings for Litecoin
2018-01-18 16:27:33 -08:00
Xinxi Wang
837ee5b597
Litecoin: M prefix added for script addresses 2018-01-18 16:27:29 -08:00
ultragtx
ddbdcd482a
Litecoin: Fix various tests
# Conflicts:
#	.travis.yml
#	qa/README.md
#	qa/pull-tester/rpc-tests.py
#	qa/rpc-tests/test_framework/test_framework.py
#	src/test/README.md
#	src/test/blockencodings_tests.cpp
#	src/test/main_tests.cpp
#	src/test/pow_tests.cpp
#	src/test/test_bitcoin.cpp
#	test/functional/fundrawtransaction.py
#	test/functional/multi_rpc.py
#	test/functional/p2p-compactblocks.py
#	test/functional/test_framework/mininode.py
#	test/functional/test_framework/util.py
2018-01-18 16:27:25 -08:00
Martin Smith
dd764bb478
Litecoin: Add Litecoin logos and icons
# Conflicts:
#	share/pixmaps/nsis-header.bmp
#	share/pixmaps/nsis-wizard.bmp
2018-01-18 16:27:22 -08:00
shaolinfry
166fcb2aec
Litecoin: Add scrypt N=1024 PoW
# Conflicts:
#	src/txdb.cpp
2018-01-18 16:27:20 -08:00
shaolinfry
5c06f19e31
Litecoin: Adjust chain parameters 2018-01-18 16:27:13 -08:00
Cory Fields
8195cb0d7f rpc: further constrain the libevent workaround
The bug was introduced in 2.1.6-beta, versions before that don't need the
workaround.

Github-Pull: #11593
Rebased-From: 97932cd2689659addfbb58dc6148928b73af3bd0
2017-11-02 15:31:39 -04:00
Cory Fields
34153a7e4a rpc: work-around an upstream libevent bug
A rare race condition may trigger while awaiting the body of a message, see
upsteam commit 5ff8eb26371c4dc56f384b2de35bea2d87814779 for details.

This may fix some reported rpc hangs/crashes.

Github-Pull: #11593
Rebased-From: 6b58360f9b64eb0b680a662fdfd590e47f115f44
2017-11-02 15:31:18 -04:00
Suhas Daftuar
fc308a6cdb Add unit test for stale tip checking
Github-Pull: #11560
Rebased-From: 626291508c433488439b662f2e88882048fb59fb
2017-11-02 15:18:56 -04:00
João Barbosa
2ed0647ac1 Add CConnmanTest to mutate g_connman in tests
Github-Pull: #11560
Rebased-From: 83df25736ebaa23777e965d265ed677a8d79f23f
2017-11-02 15:18:56 -04:00
Suhas Daftuar
a607a95d81 Connect to an extra outbound peer if our tip is stale
If our tip hasn't updated in a while, that may be because our peers are
not relaying blocks to us that we would consider valid. Allow connection
to an additional outbound peer in that circumstance.

Also, periodically check to see if we are exceeding our target number of
outbound peers, and disconnect the one which has least recently
announced a new block to us (choosing the newest such peer in the case
of tie).

Github-Pull: #11560
Rebased-From: ac7b37cd2bd612a64a4009ba82f1cd1d57f37434
2017-11-02 15:18:56 -04:00
Suhas Daftuar
459f2db425 Track tip update time and last new block announcement from each peer
Github-Pull: #11560
Rebased-From: db32a6589720e5b15931cef82e477118dfd92669
2017-11-02 15:18:56 -04:00
Suhas Daftuar
49bf090185 net: Allow connecting to extra outbound peers
Github-Pull: #11560
Rebased-From: 2d4327db1973a354e9e4153de6958d49120fcde8
2017-11-02 15:18:56 -04:00
Matt Corallo
4c82cea99b Use a sensible default for blockmaxweight
No sensible user will ever keep the default settings here, so not
having sensible defaults only serves to screw users who are
paying less attention, which makes for terrible defaults.

Github-Pull: #11100
Rebased-From: 3dc263c9b9068ee9793b6c7a0023eff16d70fb8f
2017-11-02 15:18:56 -04:00
Matt Corallo
7871a7d3be Deprecate confusing blockmaxsize, fix getmininginfo output
* This removes block-size-limiting code in favor of GBT clients
  doing the limiting themselves (if at all).
* -blockmaxsize is deprecated and only used to calculate an implied
  blockmaxweight, addressing confusion from multiple users.
* getmininginfo's currentblocksize return value was returning
  garbage values, and has been removed, also removing a
  GetSerializeSize call in some block generation inner loops and
  potentially addressing some performance edge cases.

Github-Pull: #11100
Rebased-From: ba206d2c63a8d3cbd4a8dd47e9ef126af1bb3bb9
2017-11-02 15:18:56 -04:00
Matt Corallo
92d6105c4e Reject headers building on invalid chains by tracking invalidity
This tracks the set of all known invalid-themselves blocks (ie
blocks which we attempted to connect but which were found to be
invalid). This is used to cheaply check if new headers build on an
invalid chain.

While we're at it we also resolve an edge-case in invalidateblock
on pruned nodes which results in them needing a reindex if they
fail to reorg.

Github-Pull: #11531
Rebased-From: 015a5258adffb0cf394f387a95ac9c8afc34cfc3
2017-11-02 13:21:07 -04:00
Matt Corallo
51001d684b Accept unrequested blocks with work equal to our tip
This is a simple change that makes our accept requirements the
same as our request requirements, (ever so slightly) further
decoupling our consensus logic from our FindNextBlocksToDownload
logic in net_processing.

Github-Pull: #11531
Rebased-From: 932f118e6a3779bb3d6c3cc83963cf34ac150e42
2017-11-02 13:20:53 -04:00
Matt Corallo
c6e4d0ce82 Stop always storing blocks from whitelisted peers
There is no reason to wish to store blocks on disk always just
because a peer is whitelisted. This appears to be a historical
quirk to avoid breaking things when the accept limits were added.

Github-Pull: #11531
Rebased-From: 3d9c70ca0fd5d42f31114b689714af1825f0ed30
2017-11-02 13:20:45 -04:00
practicalswift
ec8dedff46 net: Add missing lock in ProcessHeadersMessage(...)
Reading the variable mapBlockIndex requires holding the mutex cs_main.

The new "Disconnect outbound peers relaying invalid headers" code
added in commit 37886d5e2f9992678dea4b1bd893f4f10d61d3ad and merged
as part of #11568 two days ago did not lock cs_main prior to accessing
mapBlockIndex.

Github-Pull: #11578
Rebased-From: 2530bf27b72e53cc6ffec27de35f3b487984833d
2017-11-02 13:20:18 -04:00
Suhas Daftuar
59b210d9a7 Disconnect outbound peers relaying invalid headers
Github-Pull: #11568
Rebased-From: 37886d5e2f9992678dea4b1bd893f4f10d61d3ad
2017-11-02 13:19:57 -04:00
Suhas Daftuar
fc966bbd2b moveonly: factor out headers processing into separate function
ProcessMessages will now return earlier when processing headers
messages, rather than continuing on (and do nothing).

Github-Pull: #11568
Rebased-From: 4637f18522429473e68f6f512a03040e121a446d
2017-11-02 13:19:47 -04:00
Suhas Daftuar
e3272242e2 Add unit test for outbound peer eviction
Github-Pull: #11490
Rebased-From: e065249c014a070a8799b2ff947af5b8f012c5c1
2017-11-02 13:18:44 -04:00
Suhas Daftuar
9961abf9e4 Permit disconnection of outbound peers on bad/slow chains
Currently we have no rotation of outbound peers.  If an outbound peer
stops serving us blocks, or is on a consensus-incompatible chain with
less work than our tip (but otherwise valid headers), then we will never
disconnect that peer, even though that peer is using one of our 8
outbound connection slots.  Because we rely on our outbound peers to
find an honest node in order to reach consensus, allowing an
incompatible peer to occupy one of those slots is undesirable,
particularly if it is possible for all such slots to be occupied by such
peers.

Protect against this by always checking to see if a peer's best known
block has less work than our tip, and if so, set a 20 minute timeout --
if the peer is still not known to have caught up to a chain with as much
work as ours after 20 minutes, then send a single getheaders message,
wait 2 more minutes, and if a better header hasn't been received by then,
disconnect that peer.

Note:

- we do not require that our peer sync to the same tip as ours, just an
equal or greater work tip.  (Doing otherwise would risk partitioning the
network in the event of a chain split, and is also unnecessary.)

- we pick 4 of our outbound peers and do not subject them to this logic,
to be more conservative. We don't wish to permit temporary network
issues (or an attacker) to excessively disrupt network topology.

Github-Pull: #11490
Rebased-From: 5a6d00c6defc587e22c93e63029fdd538ce8858d
2017-11-02 13:18:34 -04:00
Suhas Daftuar
bf191a7183 Disconnecting from bad outbound peers in IBD
When in IBD, we'd like to use all our outbound peers to help us
sync the chain.  Disconnect any outbound peers whose headers have
insufficient work.

Github-Pull: #11490
Rebased-From: c60fd71a65e841efe187992f46c583a704cc37f5
2017-11-02 13:18:23 -04:00
MeshCollider
d570aa4290 Fix uninitialized g_connman crash in Shutdown()
Github-Pull: #11326
Rebased-From: 77939f27f7dc42640ebfb9fe52490a2ddacc3ad4
2017-11-02 13:17:58 -04:00
Cory Fields
0a5477c7e3 net: stop both net/net_processing before destroying them
This should avoid either attempting to use an invalid reference/pointer to the
other.

Github-Pull: #10756
Rebased-From: 2525b972af6645ca239ac1078cffb132b402bfbb
2017-11-02 13:16:57 -04:00
Cory Fields
b4136f21cf net: drop unused connman param
The copy in PeerLogicValidation can be used instead.

Github-Pull: #10756
Rebased-From: 80e2e9d0cec890c5d2f81360ebb81e81c07ccb8c
2017-11-02 13:16:50 -04:00
Cory Fields
dc897e53d8 net: use an interface class rather than signals for message processing
Drop boost signals in favor of a stateful class. This will allow the message
processing loop to actually move to net_processing in a future step.

Github-Pull: #10756
Rebased-From: 8ad663c1fa88d68843e45580deced56112343183
2017-11-02 13:16:28 -04:00
Cory Fields
8aee55af3d net: pass CConnman via pointer rather than reference
There are a few too many edge-cases here to make this a scripted diff.

The following commits will move a few functions into PeerLogicValidation, where
the local connman instance can be used. This change prepares for that usage.

Github-Pull: #10756
Rebased-From: 28f11e9406b185dc87144f1f29af0d93eb115b4e
2017-11-02 13:15:02 -04:00
Matt Corallo
6f279652b0 Rename fAddnode to a more-descriptive "manual_connection"
Github-Pull: #11456
Rebased-From: 57edc0b0c86549020a39cd65f96496e9771c4769
2017-11-02 13:11:54 -04:00
Suhas Daftuar
ffb6ea4e5e Add comment explaining forced processing of compact blocks
Github-Pull: #11458
Rebased-From: 01b52cedd42f50a93b40981c91af7c12de6e45ce
2017-11-02 13:09:16 -04:00
Suhas Daftuar
3acec38781 Don't process unrequested, low-work blocks
A peer could try to waste our resources by sending us unrequested blocks with
low work, eg to fill up our disk.  Since
e2652002b6011f793185d473f87f1730c625593b we no longer request blocks until we
know we're on a chain with more than nMinimumChainWork (our anti-DoS
threshold), but we would still process unrequested blocks that had more work
than our tip.  This commit fixes that behavior.

Github-Pull: #11458
Rebased-From: ce8cd7a7da9174ab151172fc0ce97b5164637cf3
2017-11-02 13:09:00 -04:00
Suhas Daftuar
da4908c3a0 Allow setting nMinimumChainWork on command line
Github-Pull: #10357
Rebased-From: 0311836f6927aec4ba5687ea12af35df3c509682
2017-11-02 13:08:43 -04:00
Russell Yanofsky
9c8006dc33 Avoid opening copied wallet databases simultaneously
Make sure wallet databases have unique fileids. If they don't, throw an error.
BDB caches do not work properly when more than one open database has the same
fileid, because values written to one database may show up in reads to other
databases.

Bitcoin will never create different databases with the same fileid, but users
can create them by manually copying database files.

BDB caching bug was reported by Chris Moore <dooglus@gmail.com>
https://github.com/bitcoin/bitcoin/issues/11429

Fixes #11429

Github-Pull: #11476
Rebased-From: 478a89c1ef79a75275d1b508122c06eee9386b2d
2017-11-01 15:23:06 -04:00
João Barbosa
de7053f114 [wallet] Fix leak in CDB constructor
Now using a std::unique_ptr, the Db instance is correctly released
when CDB initialization fails.
The internal CDB state and mapFileUseCount are only mutated when
the CDB initialization succeeds.

Github-Pull: #11492
Rebased-From: 7104de8b1f3a31d3a60009b5dc376adbedac6a9c
2017-11-01 15:23:06 -04:00
Tomas van der Wansem
fd79ed6b20 Ensure backupwallet fails when attempting to backup to source file
Previous behaviour was to destroy the wallet (to zero-length)

Github-Pull: #11376
Rebased-From: 5d465e396249a0e2cc60b16984a2bdbe4c8993c3
2017-11-01 15:23:06 -04:00
Russell Yanofsky
7d4546f17d
Make listsinceblock refuse unknown block hash
Change suggested by Cory Fields <cory-nospam-@coryfields.com> who noticed
listsinceblock would ignore invalid block hashes causing it to return a
completely unfiltered list of transactions.

Github-Pull: #11565
Rebased-From: 659b2061c4329472a45e913c5d45e6ab180600a3
Tree-SHA512: 2091a830b730421b49c806cb83a16c7da2ec0a7adac2bac0585324aad12a32bb99a840264c3d346937ea84786fac56e44befb6641511a417977803875efe5a21
2017-11-01 14:15:59 +01:00
Andreas Schildbach
a2bd86a5ff
Remove my testnet DNS seed as I currently don't have the capacity to keep it up to date.
Github-Pull: #11527
Rebased-From: 132d3225f325b84afc282638c9e99623d249a52c
Tree-SHA512: 3738afd8070fa601b5039e268088b7f3827613dbc37fae192b96b13c91f56d41fa3209533a3cad876c4e673b19015aabfce331b0b5f46a0ac518d00816e912a4
2017-10-19 15:02:08 +02:00
Wladimir J. van der Laan
1646f9c760
Merge #11447: 0.15.1: Backports
20cdc2b Fix importmulti bug when importing an already imported key (Pedro Branco)
405e069 Update importprivkey named args documentation (Dusty Williams)
c94527a [Docs] Update Windows build instructions for using WSL and Ubuntu 17.04 (fanquake)
27e861a net: Improve and document SOCKS code (Wladimir J. van der Laan)
dea3b87 Add new step to clean $PATH var by removing /mnt specific Window's %PATH% paths that cause issues with the make system (Donal OConnor)
a43be5b rpc: Prevent `dumpwallet` from overwriting files (Wladimir J. van der Laan)
b6c0209 Fix validationinterface build on super old boost/clang (Matt Corallo)
6a62c74 qt: Backup former GUI settings on `-resetguisettings` (Wladimir J. van der Laan)
0fe2a9a when clearing addrman clear mapInfo and mapAddr (Gregory Sanders)
6b4d9f2 wallet: update stored witness in AddToWallet (Suhas Daftuar)
62d18cd doc: Prepare release notes for 0.15.1 (MarcoFalke)
8b61aee Put back inadvertently removed copyright notices (Paul Berg)
75997c3 Disallow uncompressed pubkeys in bitcoin-tx [multisig] output adds (Matt Corallo)
8d13b42 Replace save|restoreWindowGeometry with Qt functions (MeshCollider)
6642558 [Qt] Add delay before filtering transactions Fixes 3141 (Lucas Betschart)
19d63e8 Remove custom fee radio group (Andrew Chow)
b1a6c94 rpc: make estimatesmartfee argument naming consistent with documentation (Wladimir J. van der Laan)
921542e rpc: update cli for estimatefee argument rename (Wladimir J. van der Laan)
2e31b1d Fix division by zero in time remaining (MeshCollider)
47c02a8 qt: Use IsMine to validate custom change address (Chris Moore)
7310f1f [Qt] Fix display of package name on 'open config file' tooltip (Daniel Edgecumbe)
2cb720a Acquire cs_main lock before cs_wallet during wallet initialization (Russell Yanofsky)
b278a43 rpc: Write authcookie atomically (Wladimir J. van der Laan)
50bd3f6 Avoid returning a BIP9Stats object with uninitialized values (practicalswift)
9e8aae3 [wallet] Close DB on error. (Karl-Johan Alm)

Pull request description:

  This mostly backports various commits that fix(ed) bugs and issues.

  However, it also includes two patches for qt that only fix minor issues,
  as well as some doc patches.

Tree-SHA512: 5165e309faf6b4395fdf2f6662ccc0d58306971f3769e675504f17b2055efe29b2919f22d0dbf78c4c2dc7fd5c9d08a2c53345615e4a1df73914526687c9d571
2017-10-18 20:55:35 +02:00