Commit Graph

12833 Commits

Author SHA1 Message Date
instagibbs
61b8aea708 Rename ReconsiderBlock func to reflect real behavior 2018-10-23 22:24:41 +03:00
instagibbs
46038d59ea Remove state arg from ReconsiderBlock 2018-10-23 22:24:01 +03:00
Jorge Timón
4a2d793f2a Globals: Explicitly pass const CChainParams& to UpdateTip() 2018-10-23 22:22:50 +03:00
face
7e7f211dea Pass CChainParams to DisconnectTip() 2018-10-23 22:22:19 +03:00
Patrick Strateman
c934f568b7 Always disconnect old nodes which request filtered connections. 2018-10-23 22:17:56 +03:00
Luke Dashjr
7828e48b69 Remove -enforcenodebloom 2018-10-23 22:15:45 +03:00
lateminer
afa46b1aef Use nAbsurdFee instead of maxTxFee in AcceptToMemoryPoolWorker()
main.cpp
2018-10-23 22:09:14 +03:00
MarcoFalke
159b4c71e3 [doxygen] Actually display comment 2018-10-23 22:05:23 +03:00
lateminer
af95ba010d Improve block validity/ConnectBlock() comments
https://github.com/bitcoin/bitcoin/pull/7444
2018-10-23 22:03:49 +03:00
lateminer
d7b72d14d8 Do not throw an error for proof-of-stake blocks in CreateNewBlock()
miner.cpp
2018-10-23 21:28:04 +03:00
lateminer
f085b9e0d7 Update .gitignore 2018-10-23 19:59:14 +03:00
lateminer
e7fe6aa451 Add ZeroMQ patches 2018-10-23 19:58:57 +03:00
Suhas Daftuar
a4361e1863 Add warning if -blockminsize is used. 2018-10-23 01:25:24 +03:00
Gregory Maxwell
87e790f776 Blacklist -whitelistalwaysrelay; replaced by -whitelistrelay. 2018-10-23 01:23:56 +03:00
MarcoFalke
1dc2c96818 [travis] Run contrib/devtools/check-doc.py early 2018-10-23 01:22:51 +03:00
MarcoFalke
32e5de8277 [travis] Fail when documentation is outdated 2018-10-23 01:20:12 +03:00
Suhas Daftuar
671c4b68cc Remove -blockminsize option 2018-10-23 01:18:38 +03:00
lateminer
74cf4b83e5 Refactor CreateNewBlock to be a method of the BlockAssembler class 2018-10-23 01:15:28 +03:00
lateminer
635495ba38 Use CNetAddr() instead of "0.0.0.0"
net.cpp
2018-10-22 22:47:28 +03:00
lateminer
79085ea232 Add missing fMayBanPeerIfInvalid parameter in ProcessNewBlock() call
main.cpp
2018-10-22 22:37:05 +03:00
Alex Morcos
16047baaf6 Populate services in GetLocalAddress 2018-10-22 22:12:31 +03:00
Jonas Schnelli
c4881c72b5 Remove maxuploadtargets recommended minimum 2018-10-22 22:09:35 +03:00
lateminer
b1dc200c9d net: No longer send local address in addrMe 2018-10-22 22:07:57 +03:00
Matt Corallo
53e9126940 Revert "Use async name resolving to improve net thread responsiveness"
This reverts commit caf6150e97.

getaddrinfo_a has a nasty tendency to segfault internally in its
background thread, on every version of glibc I tested, especially
under helgrind.

See https://sourceware.org/bugzilla/show_bug.cgi?id=20874

Github-Pull: #9229
Rebased-From: 10ae7a7b2316f8052ec58ef237ce6dd987300900
2018-10-22 21:30:10 +03:00
Jorge Timón
37ec55836a Consensus: Decouple pow.cpp from util.h 2018-10-22 00:59:11 +03:00
Kaz Wesley
2a758e6810 test prevector::swap
- add a swap operation to prevector tests (fails due to broken prevector::swap)
- fix 2 prevector test operation conditions that were impossible
2018-10-22 00:55:39 +03:00
Kaz Wesley
0e23170ec0 prevector::swap: fix (unreached) data corruption
swap was using an incorrect condition to determine when to apply an optimization
(not swapping the full direct[] when swapping two indirect prevectors).

Rather than correct the optimization I'm removing it for simplicity. Removing
this optimization minutely improves performance in the typical (currently only)
usage of member swap(), which is swapping with a freshly value-initialized
object.
2018-10-22 00:55:30 +03:00
Kaz Wesley
d06798a38b prevector: destroy elements only via erase()
Fixes a bug in which pop_back did not call the deleted item's destructor.

Using the most general erase() implementation to implement all the others
prevents similar bugs because the coupling between deallocation and destructor
invocation only needs to be maintained in one place.
Also reduces duplication of complex memmove logic.
2018-10-22 00:55:22 +03:00
MarcoFalke
c1665d245e Add missing copyright headers 2018-10-22 00:54:59 +03:00
Wladimir J. van der Laan
9a9a172210 test: Fix use-after-free in scheduler tests
Make a copy of the boost time-point to wait for, otherwise the head of
the queue may be deleted by another thread while this one is waiting,
while the boost function still has a reference to it.

Although this problem is in non-test code, this is not an actual problem
outside of the tests because we use the thread scheduler with only one
service thread, so there will never be threads fighting at the head of
the queue.

The old boost fallback escapes this problem because it passes a scalar
value to wait_until instead of a const object reference.

Found by running the tests in LLVM-4.0-master asan.

Github-Pull: #9186
Rebased-From: 12519bf62b8c49b1c1744eca6ea5b3162a61f962
2018-10-22 00:50:16 +03:00
Christian Barcenas
a5d81ed4ec Trivial: Fix two VarInt examples in serialize.h
Github-Pull: #8560
Rebased-From: 7bd5ff46237b06b3cf223176c1c71ef66383fa92
2018-10-22 00:48:46 +03:00
Pieter Wuille
183a586a01 Clean up lockorder data of destroyed mutexes
The lockorder potential deadlock detection works by remembering for each
lock A that is acquired while holding another B the pair (A,B), and
triggering a warning when (B,A) already exists in the table.

A and B in the above text are represented by pointers to the CCriticalSection
object that is acquired. This does mean however that we need to clean up the
table entries that refer to any critical section which is destroyed, as it
memory address can potentially be used for another unrelated lock in the future.

Implement this clean up by remembering not only the pairs in forward direction,
but also backward direction. This allows for fast iteration over all pairs that
use a deleted CCriticalSection in either the first or the second position.
2018-10-22 00:46:36 +03:00
mruddy
3fe2f7ee04 P2P: add maxtimeadjustment command line option 2018-10-22 00:45:03 +03:00
Wladimir J. van der Laan
a2b5a784ca tinyformat: force USE_VARIADIC_TEMPLATES
Now that we started using c++11, force use of variadic templates.

The autodetection may be wonky on some compilers, see discussion
[here](https://github.com/bitcoin/bitcoin/pull/7982#issuecomment-216222357)
and is unnecessary for us anyhow.
2018-10-22 00:44:20 +03:00
Wladimir J. van der Laan
7a11d02bde Break circular dependency main ↔ txdb
Break the circular dependency between main and txdb by:

- Moving `CBlockFileInfo` from `main.h` to `chain.h`. I think this makes
  sense, as the other block-file stuff is there too.

- Moving `CDiskTxPos` from `main.h` to `txdb.h`. This type seems
  specific to txdb.

- Pass a functor `insertBlockIndex` to `LoadBlockIndexGuts`. This leaves
  it up to the caller how to insert block indices.
2018-10-22 00:42:47 +03:00
21E14
69de80c238 Remove obsolete reference to CValidationState from UpdateCoins. 2018-10-22 00:40:59 +03:00
lateminer
a28600154a Bring back SetThreadPriority 2018-10-22 00:22:54 +03:00
Pieter Wuille
fad48f416c Use std::atomic for fRequestShutdown and fReopenDebugLog 2018-10-22 00:17:37 +03:00
Wladimir J. van der Laan
e9ac273479 util: switch LogPrint and error to variadic templates 2018-10-22 00:11:10 +03:00
Mustafa
43c5d478c0 Move GetTempPath() to testutil. 2018-10-22 00:10:54 +03:00
Luke Dashjr
e5913199ff Copyrights stuff fixes 2018-10-22 00:07:39 +03:00
Wladimir J. van der Laan
853cd3845c util: Add ParseUInt32 and ParseUInt64
Add error and range-checking parsers for unsigned 32 and 64 bit numbers.
The 32-bit variant is required for parsing sequence numbers from the
command line in `bitcoin-tx` (see #8164 for discussion). I've thrown in
the 64-bit variant as a bonus, as I'm sure it will be needed at some
point.

Also adds tests, and updates `developer-notes.md`.
2018-10-21 23:59:08 +03:00
MarcoFalke
c6ac3b5c34 [doc] Fix doxygen comments for members 2018-10-21 23:57:58 +03:00
Jonas Schnelli
6d90c71b64 include the chaintip blockindex in the SyncTransaction signal, add signal UpdateTip() 2018-10-21 23:51:31 +03:00
Suhas Daftuar
8f5935a1d8 Bump the protocol version to distinguish new banning behavior.
This allows future software that would relay compact blocks before
full validation to announce only to peers that will not ban if the
block turns out to be invalid.
2018-10-21 23:41:32 +03:00
Suhas Daftuar
f2a7a4d1ba Fix compact block handling to not ban if block is invalid 2018-10-21 23:41:27 +03:00
Suhas Daftuar
531d15ea84 [qa] Another attempt to fix race condition in p2p-compactblocks.py
sync_with_ping() only guarantees that the node has processed messages
it's received from the peer, not that block announcements from the node have
made it back to the peer.  Replace sync_with_ping() with an explicit check that
the node's tip has been announced.

Github-Pull: #8882
Rebased-From: 6976db2f4687d575e1b4bee5aaf1d93a794f23c3
2018-10-21 23:36:16 +03:00
Suhas Daftuar
90f833fe60 [qa] Fix race condition in p2p-compactblocks test
Also fix a bug in the sync_with_ping() helper function

Github-Pull: #8854
Rebased-From: b5fd666984fdb7125cb809c773b36034f32128cc
2018-10-21 23:36:07 +03:00
Suhas Daftuar
79a8a8b012 Fix broken sendcmpct test in p2p-compactblocks.py
Python lambda use was incorrect.

sendcmpct messages need to be synchronized with RPC calls to generate().

Headers need to be synced (eg with getheaders) for cmpctblock announcements
to start.

Last test omitted sending a sendcmpct message.

Github-Pull: #8739
Rebased-From: 157254a4bfdfc4ca3ad5bf2d84e82f290bd0c7f2)
2018-10-21 23:35:49 +03:00
Suhas Daftuar
1df646211a Add p2p test for BIP 152 (compact blocks) 2018-10-21 23:35:40 +03:00