11528 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
e4bea4fb84 qt: Avoid splash-screen related memory leak
Make splash screen queue its own deletion when it receives the finished
command, instead of relying on WA_DeleteOnClose which doesn't work under
these circumstances.

Github-Pull: #9190
Rebased-From: e4f126a7ba66e7317718c30276dff6db92dc1986
2016-12-02 07:50:11 +00:00
Wladimir J. van der Laan
c12f4e93b9 qt: Prevent thread/memory leak on exiting RPCConsole
Make ownership of the QThread object clear, so that the RPCConsole
can wait for the executor thread to quit before shutdown is called. This
increases overall thread safety, and prevents some objects from leaking
on exit.

Github-Pull: #9190
Rebased-From: 693384eedb1ac7f449e226edd53e2cb52a86e279
2016-12-02 07:50:11 +00:00
Wladimir J. van der Laan
dc46b10a08 qt: Plug many memory leaks
None of these are very serious, and are leaks in objects that are
created at most one time.

In most cases this means properly using the QObject parent hierarchy,
except for BanTablePriv/PeerTablePriv which are not QObject,
so use a std::unique_ptr instead.

Github-Pull: #9190
Rebased-From: 47db07537746940ee7dd0739a8c73e328837813f
2016-12-02 07:44:15 +00:00
Wladimir J. van der Laan
ff423cc6b0 [Qt] Clean up and fix coincontrol tree widget handling
- Do sorting for date, amount and confirmations column as longlong, not
  unsigned longlong.
- Use `UserRole` to store our own data. This makes it treated as
  ancillary data prevents it from being displayed.
- Get rid of `getMappedColumn` `strPad` - these are no longer necessary.
- Get rid of hidden `_INT64` columns.
- Start enumeration from 0 (otherwise values are undefined).

Github-Pull: #9185
Rebased-From: 4231032bfcb9728f0f629b3d67884ba9de63e4ff
2016-12-02 07:41:11 +00:00
Jonas Schnelli
6d70a73968 [Qt] fix coincontrol sort issue
Github-Pull: #9185
Rebased-From: 76af4eb876814a916dd4f26cf71faa20bdc54f2d
2016-12-02 07:41:11 +00:00
MarcoFalke
3fffbf7ef0 Doxygen: Set PROJECT_NAME = "Bitcoin Core"
Github-Pull: #9178
Rebased-From: fa63ee8e3eeef8379360c125eeb690a37f097da2
2016-12-02 07:41:11 +00:00
Masahiko Hyuga
f82c81b177 fix getnettotals RPC description about timemillis.
Github-Pull: #9122
Rebased-From: a79f864945d7abe05e777a942864c181311e5070
2016-12-02 07:41:11 +00:00
Cory Fields
6fe3981ac8 net: don't send feefilter messages before the version handshake is complete
Github-Pull: #9117
Rebased-From: 46625538d674a5aaf1bcfa7c8be8a49e5a23fa9e
2016-12-02 07:41:11 +00:00
Wladimir J. van der Laan
5f3a12c97c qt: Use correct conversion function for boost::path datadir
Fixes #9089.

Github-Pull: #9094
Rebased-From: e760b307f6210bee293796d606bcca87f86be200
2016-12-02 07:41:11 +00:00
UdjinM6
08d1c90113 Missed one "return false" in recent refactoring in #9067
Github-Pull: #9120
Rebased-From: 45d372f88900bda74835a20a44246746c2ac94e6
2016-12-02 07:41:11 +00:00
UdjinM6
f27596a7ec Every main()/exit() should return/use one of EXIT_ codes instead of magic numbers
Github-Pull: #9067
Rebased-From: 4441018d0860fce64ee74fa78da79bbb21114ca9
2016-12-02 07:41:11 +00:00
UdjinM6
f85ee01303 Fix exit codes:
- `--help`, `--version` etc should exit with `0` i.e. no error ("not enough args" case should still trigger an error)
- error reading config file should exit with `1`

Slightly refactor AppInitRPC/AppInitRawTx to return standard exit codes (EXIT_FAILURE/EXIT_SUCCESS) or CONTINUE_EXECUTION (-1)

Github-Pull: #9067
Rebased-From: bd0de1386e1c7f9b875d52290de0d561c8d56bc9
2016-12-02 07:41:11 +00:00
MarcoFalke
5bcb05d4e1 [rpc] ParseHash: Fail when length is not 64
Github-Pull: #9042
Rebased-From: fa326193ad739d1f93da456b3fa73af0bbf9fdd1
2016-12-02 07:41:11 +00:00
Pavel Janík
973ca1e491 Fix doxygen comment: the transaction is returned in txOut
Github-Pull: #8993
Rebased-From: 1d8e12ba48154b2c59213e92efb50958d430a007
2016-12-02 07:41:11 +00:00
Jonas Schnelli
6f86b53643 [Qt] make warnings label selectable
Github-Pull: #8972
Rebased-From: ef0c9ee2960fda58b2fe5b0c3b4c672231b30322
2016-12-02 07:41:11 +00:00
BtcDrak
106da691a5 Sync bitcoin-tx with tx version policy
Github-Pull: #8932
Rebased-From: b0aea8057921f0ed2288cf07048f652c7d6d9cf3
2016-12-02 07:41:11 +00:00
Steven
12428b4d8a add software-properties-common
This allows using `add-apt-repository`.

Github-Pull: #8929
Rebased-From: aa9d3c9a503952589b359624bbb0da11dd7a5e3f
2016-12-02 07:41:11 +00:00
fanquake
40169dcda9 Set minimum required Boost to 1.47.0
Github-Pull: #8920
Rebased-From: 6dd37237222f7102e223ece948150cb5c5087e3c
2016-12-02 07:41:11 +00:00
fanquake
c134d9206d [build-aux] Boost_Base serial 27
Github-Pull: #8920
Rebased-From: 282abd8358e254d976cad05d0eb48586db276bcd
2016-12-02 07:41:11 +00:00
matthias
4a974b2837 Simple Update to File 'bitcoin-qt.desktop'
Github-Pull: #8908
Rebased-From: 164196b7c8aecb72dd20c8681bb24b81b18aecaa
2016-12-02 07:41:11 +00:00
randy-waterhouse
975ab1254e Update INSTALL landing redirection notice for build instructions.
Github-Pull: #8896
Rebased-From: 2920be2a6994cfbffd93e72c6cf4c1ed19ac4339
2016-12-02 07:41:11 +00:00
Gregory Maxwell
3a3bcbf775 Use RelevantServices instead of node_network in AttemptToEvict.
Use of node_network here is really meant to be a proxy of "likely to
 send us blocks in the future".  RelevantServices is the right criteria
 now.

Github-Pull: #9052
Rebased-From: d32036a47d9ccdc38628a7a75bb8b711af462e4f
2016-12-02 07:41:11 +00:00
Gregory Maxwell
ca1fd7521e Make orphan parent fetching ask for witnesses.
In 0.13 orphan transactions began being treated as implicit
 INVs for their parents.  But the resulting getdata were
 not getting the witness flag.

This fixes issue #9182 reported by chjj and roasbeef on IRC.

Github-Pull: #9188
Rebased-From: 5b0150a060208faf436c09b0ca9463407a869c72
2016-12-02 08:38:02 +01:00
Suhas Daftuar
b96a8f7df2 [qa] Test getblocktemplate default_witness_commitment
Github-Pull: #9189
Rebased-From: 95f4a03777ec2ad82a94a3e2890192a93ad83509
2016-12-02 08:38:02 +01:00
Pieter Wuille
99477c71c4 Always add default_witness_commitment with GBT client support
Github-Pull: #9189
Rebased-From: ad04d1cb35b9612d36078c62213bdbb13f56d73d
2016-12-02 08:38:02 +01:00
Gregory Maxwell
da5a16b11d Always drop the least preferred HB peer when adding a new one.
When a BIP152 HB-mode peer is in the least preferred position and
 disconnects, they will not be by ForNode on the next loop. They
 will continue to sit in that position and prevent deactivating
 HB mode for peers that are still connected.

There is no reason for them to stay in the list if already gone,
 so drop the first element unconditionally if there are too many.

Fixes issue #9163.

Github-Pull: #9199
Rebased-From: ca8549d2bd32f17f8b69d1edbe3f2976fba504b4
2016-12-02 08:38:02 +01:00
jnewbery
094848baf0 log block size and weight correctly.
Github-Pull: #8838
Rebased-From: 5f274a1749acfdf331bc2931e25ac80c346e5faa
2016-12-02 08:38:02 +01:00
Cory Fields
d1b4da9259 build: fix qt5.7 build under macOS
OBJCXX's std flags don't get defined by our cxx macro. Rather than hard-coding
to c++11, just force OBJCXX to be the same as CXX unless the user specified
otherwise.

Github-Pull: #9169
Rebased-From: 70266e98292bf9c8f019ca4b11d681b575f71448
2016-12-02 08:38:02 +01:00
Wladimir J. van der Laan
29435db6a4
Merge #9191: [qa] 0.13.2 Backports
e846166 Modify getblocktxn handler not to drop requests for old blocks (Russell Yanofsky)
2cad5db Align constant names for maximum compact block / blocktxn depth (Pieter Wuille)
3d23a0e Add cmpctblock to debug help list (instagibbs)
76ba1c9 More agressively filter compact block requests (Matt Corallo)
36e3b95 Dont remove a "preferred" cmpctblock peer if they provide a block (Matt Corallo)
286e548 [qa] Fix stale data bug in test_compactblocks_not_at_tip (Russell Yanofsky)
2ba5d78 [qa] Fix bug in compactblocks v2 merge (Russell Yanofsky)
eca9b46 [qa] Wait for specific block announcement in p2p-compactblocks (Russell Yanofsky)
dccdc3a test: Fix use-after-free in scheduler tests (Wladimir J. van der Laan)
da4926b [qa] Add more helpful RPC timeout message (Russell Yanofsky)
1d4c884 [qa] Increase wallet-dump RPC timeout (Russell Yanofsky)
3107280 [qa] add assert_raises_message to check specific error message (mrbandrews)
2016-12-02 08:16:50 +01:00
Matt Corallo
b172377857
Revert "Use async name resolving to improve net thread responsiveness"
This reverts commit caf6150e9785da408f1e603ae70eae25b5202d98.

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
2016-12-02 05:50:58 +01:00
Wladimir J. van der Laan
94531b5350
torcontrol: Explicitly request RSA1024 private key
When generating a new service key, explicitly request a RSA1024 one.

The bitcoin P2P protocol has no support for the longer hidden service names
that will come with ed25519 keys, until it does, we depend on the old
hidden service type so make this explicit.

See #9214.

Rebased-From: 7d3b627395582ae7c9d54ebdbc68096d7042162b
Github-Pull: #9234
2016-11-30 12:51:06 +01:00
Russell Yanofsky
e8461666ec Modify getblocktxn handler not to drop requests for old blocks
The current getblocktxn implementation drops and ignores requests for old
blocks, which causes occasional sync_block timeouts during the
p2p-compactblocks.py test as reported in
https://github.com/bitcoin/bitcoin/issues/8842.

The p2p-compactblocks.py test setup creates many new blocks in a short
period of time, which can lead to getblocktxn requests for blocks below the
hardcoded depth limit of 10 blocks. This commit changes the getblocktxn
handler not to ignore these requests, so the peer nodes in the test setup
will reliably be able to sync.

The protocol change is documented in BIP-152 update "Allow block responses
to getblocktxn requests" at https://github.com/bitcoin/bips/pull/469.

The protocol change is not expected to affect nodes running outside the test
environment, because there shouldn't normally be lots of new blocks being
rapidly added that need to be synced.

Github-Pull: #9058
Rebased-From: dac53b58b555183ccc0d5e64c428528267cd98b3
Github-Pull: #9160
Rebased-From: ec34648766c4052816e4072cc61ad429430bcfd9
2016-11-20 15:25:34 +01:00
Pieter Wuille
2cad5db6f7 Align constant names for maximum compact block / blocktxn depth
Github-Pull: #8637
Rebased-From: 3ac6de0a045cc9b2047ceb19af970e7ffbf905fa
2016-11-20 15:08:16 +01:00
instagibbs
3d23a0eaa3 Add cmpctblock to debug help list
Github-Pull: #8637
Rebased-From: b2e93a343ec2dc7d255b970e6ee45e9c390f7ed0
2016-11-20 15:08:03 +01:00
Matt Corallo
76ba1c9739 More agressively filter compact block requests
Unit test adaptations by Pieter Wuille.

Github-Pull: #8637
Rebased-From: fe998e962dc015978f104b782afb7daec3c4d4df
2016-11-20 15:07:53 +01:00
Matt Corallo
36e3b95103 Dont remove a "preferred" cmpctblock peer if they provide a block
Github-Pull: #8637
Rebased-From: 02a337defdd854efc78ecba6d1fb19cb1c075f16
2016-11-20 15:07:39 +01:00
Russell Yanofsky
286e548d87 [qa] Fix stale data bug in test_compactblocks_not_at_tip
Clear test_node.last_block before requesting blocks in the
compactblocks_not_at_tip test so comparisons won't fail if a blocks were received
before the test started.

The bug doesn't currently cause any problems due to the order tests run, but
this will change in the next commit.

Github-Pull: #9058
Rebased-From: 55bfddcabbf9e8a3743f77167ba4a43aaba9f948
2016-11-19 23:55:07 +01:00
Russell Yanofsky
2ba5d78427 [qa] Fix bug in compactblocks v2 merge
Bug caused the wait_for_block_announcement to be called on the wrong node,
leading to nondeterminism and occasional test failures. Bug was introduced in
merge commit:

d075479 Merge #8882: [qa] Fix race conditions in p2p-compactblocks.py and sendheaders.py

Underlying commits which conflicted were:

27acfc1 [qa] Update p2p-compactblocks.py for compactblocks v2
6976db2 [qa] Another attempt to fix race condition in p2p-compactblocks.py

The first commit changed the test_compactblock_construction function signature
and second commit added code which wasn't updated during the merge to use the
new arguments.

Suhas Daftuar <sdaftuar@chaincode.com> noticed the bug and suggested the fix.

Github-Pull: #9058
Rebased-From: 47e9659ecfbe07077a4564591095bd5510e0f917
2016-11-19 23:53:01 +01:00
Russell Yanofsky
eca9b46537 [qa] Wait for specific block announcement in p2p-compactblocks
Change check_announcement_of_new_block() to wait specifically for the
announcement of the newly created block, instead of waiting for any
announcement at all. A difficult to reproduce failure in
check_announcement_of_new_block() that happened in a travis build
(https://travis-ci.org/bitcoin/bitcoin/jobs/175198367) might have happened
because an older announcement was mistaken for the expected one. The error
looked like:

  Assertion failed: Failed

  File ".../bitcoin/qa/rpc-tests/test_framework/test_framework.py", line 145, in main
    self.run_test()
  File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 787, in run_test
    self.test_sendcmpct(self.nodes[1], self.segwit_node, 2, old_node=self.old_node)
  File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 201, in test_sendcmpct
    check_announcement_of_new_block(node, test_node, lambda p: p.last_cmpctblock is None and p.last_inv is not None)
  File ".../bitcoin/build/../qa/rpc-tests/p2p-compactblocks.py", line 194, in check_announcement_of_new_block
    assert(predicate(peer))

This commit also changes the assertion failed message above to include more
detailed information for debug.

Github-Pull: #9159
Rebased-From: dfa44d1b07a6d1022005dba63dd6372739eee8a0
2016-11-19 23:34:58 +01:00
Wladimir J. van der Laan
dccdc3aa34 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
2016-11-19 23:24:35 +01:00
Russell Yanofsky
da4926b1d2 [qa] Add more helpful RPC timeout message
Replace previous timeout('timed out',) exception with more detailed error.

Github-Pull: #9077
Rebased-From: e89614b6abf28d7fe201c3db44a0df6e4db6de03
2016-11-19 23:21:19 +01:00
Russell Yanofsky
1d4c884cd3 [qa] Increase wallet-dump RPC timeout
Increase wallet-dump RPC timeout from 30 seconds to 1 minute. This avoids a
timeout error that seemed to happen regularly (around 50% of builds) on a
particular jenkins server during the first getnewaddress RPC call made by the
test.

The failing stack trace looked like:

    Unexpected exception caught during testing: timeout('timed out',)

    File ".../bitcoin/qa/rpc-tests/test_framework/test_framework.py", line 146, in main
      self.run_test()
    File ".../bitcoin/qa/rpc-tests/wallet-dump.py", line 73, in run_test
      addr = self.nodes[0].getnewaddress()
    File ".../bitcoin/qa/rpc-tests/test_framework/coverage.py", line 49, in __call__
      return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 145, in __call__
      response = self._request('POST', self.__url.path, postdata.encode('utf-8'))
    File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 121, in _request
      return self._get_response()
    File ".../bitcoin/qa/rpc-tests/test_framework/authproxy.py", line 160, in _get_response
      http_response = self.__conn.getresponse()
    File "/usr/lib/python3.4/http/client.py", line 1171, in getresponse
      response.begin()
    File "/usr/lib/python3.4/http/client.py", line 351, in begin
      version, status, reason = self._read_status()
    File "/usr/lib/python3.4/http/client.py", line 313, in _read_status
      line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
    File "/usr/lib/python3.4/socket.py", line 374, in readinto
      return self._sock.recv_into(b)

Github-Pull: #9077
Rebased-From: 8463aaa63c5ac76421c4d2754ea9e17a31584c93
2016-11-19 23:21:07 +01:00
mrbandrews
3107280e14 [qa] add assert_raises_message to check specific error message
Github-Pull: #9168
Rebased-From: 307acdd3df03082295ac0f7fe9eba7dd35973bc4
2016-11-19 23:20:14 +01:00
Wladimir J. van der Laan
9460771a60
Merge #9048: [0.13 backport] Fix handling of invalid compact blocks
e8ef50b Bump the protocol version to distinguish new banning behavior. (Suhas Daftuar)
015865e Fix compact block handling to not ban if block is invalid (Suhas Daftuar)
8290506 [qa] Test that invalid compactblocks don't result in ban (Suhas Daftuar)
2016-11-09 22:11:47 +01:00
Wladimir J. van der Laan
59ce53c13c
Merge #9011: 0.13.2 backports
b16cdb7 Add MIT license to build-aux/m4 scripts (Luke Dashjr)
2cfcca7 Trivial: build-aux/m4/l_atomic: Fix typo (Luke Dashjr)
fa58e55 Add MIT license to autogen.sh and share/genbuild.sh (Luke Dashjr)
6d05fe1 Add MIT license to Makefiles (Luke Dashjr)
1d048b9 Don't return the address of a P2SH of a P2SH. (jnewbery)
ce0d817 Fix relaypriority calculation error (maiiz)
9ef3875 Add missing cs_main lock to ::GETBLOCKTXN processing (Matt Corallo)
2016-11-02 15:15:44 +01:00
Suhas Daftuar
e8ef50ba51 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.
2016-11-01 15:27:20 -04:00
Suhas Daftuar
015865ee9e Fix compact block handling to not ban if block is invalid 2016-11-01 13:20:21 -04:00
Suhas Daftuar
82905069bf [qa] Test that invalid compactblocks don't result in ban 2016-10-31 10:05:29 -04:00
Wladimir J. van der Laan
2e2388a5cb
Move release notes to release-notes/release-notes-0.13.1.md
And clean out current release notes, ready for next release from this
branch.
2016-10-27 14:55:10 +02:00
Luke Dashjr
b16cdb71ff Add MIT license to build-aux/m4 scripts
Github-Pull: #8784
Rebased-From: 0c4e6ce88f58c13ed81807e3a5bef28b673aa503
2016-10-27 14:47:22 +02:00