Commit Graph

8822 Commits

Author SHA1 Message Date
Russell Yanofsky ad24256a65
Fix importmulti returning rescan errors for wrong keys
Bug was a missing ++i line in a new range for loop added in commit e2e2f4c
"Return errors from importmulti if complete rescans are not successful"

Github-Pull: #9829
Rebased-From: 306bd72157
2017-02-28 13:53:28 +01:00
Wladimir J. van der Laan 8d2d08efaa
qt: pre-rc3 translations update 2017-02-28 12:49:29 +01:00
Pieter Wuille 1825a03f81
Avoid VLA in hash.h
Github-Pull: #9791
Rebased-From: 5c8fd50811
2017-02-28 12:48:19 +01:00
Marijn Stollenga 289204fbe0
Change bitcoin address in RPC helpaddress to an invalid address, so people don't accidentally send coins there (like I did).
Github-Pull: #9865
Rebased-From: 83ac719d34
2017-02-28 12:01:06 +01:00
Russell Yanofsky 08e0690f3f
Update sendfrom RPC help to correct coin selection misconception
Github-Pull: #9840
Rebased-From: f81f0d0030
2017-02-28 11:41:58 +01:00
Cory Fields 775cf54d0e
prevector: assert successful allocation
Github-Pull: #9856
Rebased-From: d4ee7baef7
2017-02-28 11:40:50 +01:00
Cory Fields 69832aaad5
don't throw std::bad_alloc when out of memory. Instead, terminate immediately
Github-Pull: #9856
Rebased-From: c5f008a416
2017-02-28 11:40:50 +01:00
Wladimir J. van der Laan 50953c2aad
tests: Fix dangling pwalletMain pointer in wallet tests
Github-Pull: #9875
Rebased-From: 75a109338f
2017-02-28 11:40:50 +01:00
Wladimir J. van der Laan 847e3753a6
qt: pre-rc2 translations update 2017-02-23 20:31:57 +01:00
Cory Fields 05e906dbc6
build: add --enable-werror option
This turns some compiler warnings into errors. Useful for c-i.

Github-Pull: #9789
Rebased-From: 205830a37b
2017-02-23 10:49:07 +01:00
John Newbery 9d3f9d2a59
[Trivial] Remove incorrect help message from gettxoutproof()
Github-Pull: #9711
Rebased-From: 9949ebfa6a
2017-02-22 13:03:55 +01:00
Russell Yanofsky 9072395e5f
Return errors from importmulti if complete rescans are not successful
Github-Pull: #9773
Rebased-From: e2e2f4c856
2017-02-22 12:45:43 +01:00
Jonas Schnelli 7d75a5a93c
Fix segfault crash when shutdown the GUI in disablewallet mode
Github-Pull: #9817
Rebased-From: 312c4f1057
2017-02-21 15:14:17 +01:00
kirit93 e22c0671c7
Fix for issue #9775. Added check for open() returning a NULL pointer.
Github-Pull: #9798
Rebased-From: 40f11f8872
2017-02-21 14:33:34 +01:00
Pavel Janík 3972a8efb2
Read/write mempool.dat as a binary.
mempool.dat is a binary file and thus it should be read/written as such.

Fixes #9810.

Github-Pull: #9813
Rebased-From: 171fc91f06
2017-02-21 12:35:38 +01:00
Luke Dashjr 6552729f38
Bugfix: RPC/Mining: GBT should return 1 MB sizelimit before segwit activates
Github-Pull: #9619
Rebased-From: 9fc7f0bce9
2017-02-20 17:32:59 +01:00
Russell Yanofsky 40c754cb38
[wallet] Remove importmulti always-true check
Remove "nLowestTimestamp <= chainActive.Tip()->GetBlockTimeMax()" check from
importmulti, which is always true because nLowestTimestamp is set to the
minimum of the most recent block time and all the imported key timestamps,
which is necessarily lower than the maximum block time.

Github-Pull: #9760
Rebased-From: ec1267f13b
2017-02-20 17:30:26 +01:00
Cory Fields 2afefeade6
boost: remove iostreams includes
They're unused and produce nasty deprecation warnings

Github-Pull: #9786
Rebased-From: 3301587dc5
2017-02-17 21:50:30 +01:00
Pieter Wuille 973e345f7f
Move BIP70_MAX_PAYMENTREQUEST_SIZE to header
Github-Pull: #9785
Rebased-From: c801c82e25
2017-02-17 21:50:22 +01:00
Pieter Wuille f873564231
Make KEY_SIZE a compile-time constant
Github-Pull: #9785
Rebased-From: 914fad155d
2017-02-17 21:50:14 +01:00
Wladimir J. van der Laan f68e4414d7
qt: pre-rc1 translations update 2017-02-17 17:43:06 +01:00
Wladimir J. van der Laan bc69f34b35
build: bump version to 0.14.0 2017-02-17 17:24:00 +01:00
Wladimir J. van der Laan 9828f9a996
Merge #9761: Use 2 hour grace period for key timestamps in importmulti rescans
e662af3 Use 2 hour grace period for key timestamps in importmulti rescans (Russell Yanofsky)
38d3e9e [qa] Extend import-rescan.py to test imports on pruned nodes. (Russell Yanofsky)
c28583d [qa] Extend import-rescan.py to test specific key timestamps (Russell Yanofsky)
8be0866 [qa] Simplify import-rescan.py (Russell Yanofsky)
2017-02-17 12:53:41 +01:00
Wladimir J. van der Laan ad168ef4e3
Merge #9778: Add two hour buffer to manual pruning
91fb506 Add two hour buffer to manual pruning (Alex Morcos)
2017-02-17 12:51:08 +01:00
Wladimir J. van der Laan 3c02b95740
Merge #9779: Update nMinimumChainWork and defaultAssumeValid.
3f78e46 Update nMinimumChainWork and defaultAssumeValid. (Gregory Maxwell)
2017-02-17 12:41:49 +01:00
Wladimir J. van der Laan 8dee822177
Merge #9777: Handle unusual maxsigcachesize gracefully
55c403b Ensure `-maxsigcachesize` is in valid range (John Newbery)
2017-02-17 09:05:48 +01:00
John Newbery 55c403b8fe Ensure `-maxsigcachesize` is in valid range
- If the -maxsigcachesize parameter is set to zero, setup a minimum sized
sigcache (2 elements) rather than segfaulting.
- Handle maxsigcachesize being negative
- Handle maxsigcachesize being too large
2017-02-17 09:04:37 +01:00
Alex Morcos 91fb506e0a Add two hour buffer to manual pruning 2017-02-16 17:47:56 -05:00
Gregory Maxwell 3f78e460ba Update nMinimumChainWork and defaultAssumeValid. 2017-02-16 19:31:03 +00:00
Russell Yanofsky e662af3583 Use 2 hour grace period for key timestamps in importmulti rescans
Gregory Maxwell <greg@xiph.org> pointed out the lack of grace period in
https://github.com/bitcoin/bitcoin/pull/9490#issue-199407998.

The importwallet RPC which uses key timestamps in a similar way already has a 2
hour grace period.
2017-02-16 09:05:55 -05:00
Wladimir J. van der Laan 8743320d6c
Merge #9763: [Trivial] Update comments referencing main.cpp
00e623d [Trivial] Update comments referencing main.cpp (CryptAxe)
2017-02-16 14:01:14 +01:00
CryptAxe 00e623d0b8 [Trivial] Update comments referencing main.cpp 2017-02-16 13:52:38 +01:00
Wladimir J. van der Laan e43a58514d
Merge #9771: Add missing cs_wallet lock that triggers new lock held assertion
07afcd6 Add missing cs_wallet lock that triggers new lock held assertion (Russell Yanofsky)
2017-02-16 10:30:33 +01:00
Wladimir J. van der Laan f8af89a918
Merge #9764: wallet: Prevent "overrides a member function but is not marked 'override'" warnings
6c5427d wallet: Prevent "overrides a member function but is not marked 'override'" warnings (Wladimir J. van der Laan)
2017-02-16 10:24:24 +01:00
Wladimir J. van der Laan 1e92e041dd
Merge #9765: Harden against mistakes handling invalid blocks
ba803ef Harden against mistakes handling invalid blocks (Suhas Daftuar)
2017-02-16 10:23:41 +01:00
Russell Yanofsky 07afcd6379 Add missing cs_wallet lock that triggers new lock held assertion
A new AssertLockHeld(cs_wallet) call was added in commit a58370e
"Dedup nTimeFirstKey update logic" (part of PR #9108).

The lock held assertion will fail when loading prexisting wallets files from
before the #9108 merge that have watch-only keys.
2017-02-15 17:01:30 -05:00
Wladimir J. van der Laan 7a93af8340
Merge #9756: Return error when importmulti called with invalid address.
9acf25c Return error when importmulti called with invalid address. (Russell Yanofsky)
2017-02-15 16:29:16 +01:00
Wladimir J. van der Laan 476cc47da0
Merge #9758: Selectively suppress deprecation warnings
4b6cccc Selectively suppress deprecation warnings (Jonas Schnelli)
2017-02-15 15:08:59 +01:00
Suhas Daftuar ba803efb68 Harden against mistakes handling invalid blocks
Fixes a bug in AcceptBlock() in invoking CheckBlock() with incorrect
arguments, and restores a call to CheckBlock() from ProcessNewBlock()
as belt-and-suspenders.

Updates the (overspecified) tests to match behavior.
2017-02-15 08:17:57 -05:00
Wladimir J. van der Laan 6c5427d24c wallet: Prevent "overrides a member function but is not marked 'override'" warnings
Because it is used inconsistently at least version 5.4.0 of g++ to
complains about methods that don't use override. There is two ways to go
about this: remove override from the methods having it, or add it to the
methods missing it. I chose the second.
2017-02-15 11:31:28 +01:00
Wladimir J. van der Laan d8e8b06bd0
Merge #9108: Use importmulti timestamp when importing watch only keys (on top of #9682)
a80f98b Use importmulti timestamp when importing watch only keys (Russell Yanofsky)
a58370e Dedup nTimeFirstKey update logic (Russell Yanofsky)
2017-02-15 11:13:48 +01:00
Wladimir J. van der Laan 4c69d683f2
Merge #9553: Use z = std::max(x - y, 0) instead of z = x - y; if (z < 0) z = 0;
a47da4b Use z = std::max(x - y, 0); instead of z = x - y; if (z < 0) z = 0; (practicalswift)
2017-02-15 09:27:47 +01:00
Jonas Schnelli a441db01b5
Merge #9755: Bugfix: Qt/Options: Restore persistent "restart required" notice
0b4f273 Bugfix: Qt/Options: Restore persistent "restart required" notice (Luke Dashjr)
2017-02-14 15:57:02 +01:00
Wladimir J. van der Laan e87ce95fbd
Merge #9720: net: fix banning and disallow sending messages before receiving verack
d943491 qa: add a test to detect leaky p2p messages (Cory Fields)
8650bbb qa: Expose on-connection to mininode listeners (Matt Corallo)
5b5e4f8 qa: mininode learns when a socket connects, not its first action (Matt Corallo)
cbfc5a6 net: require a verack before responding to anything else (Cory Fields)
8502e7a net: parse reject earlier (Cory Fields)
c45b9fb net: correctly ban before the handshake is complete (Cory Fields)
2017-02-14 14:42:29 +01:00
Wladimir J. van der Laan b08656e343
Merge #9715: Disconnect peers which we do not receive VERACKs from within 60 sec
66f861a Add a test for P2P inactivity timeouts (Matt Corallo)
b436f92 qa: Expose on-connection to mininode listeners (Matt Corallo)
8aaba7a qa: mininode learns when a socket connects, not its first action (Matt Corallo)
2cbd119 Disconnect peers which we do not receive VERACKs from within 60 sec (Matt Corallo)
2017-02-14 14:35:15 +01:00
Wladimir J. van der Laan edc9e63c57
Merge #9682: Require timestamps for importmulti keys
266a811 Use MTP for importmulti "now" timestamps (Russell Yanofsky)
3cf9917 Add test to check new importmulti "now" value (Russell Yanofsky)
442887f Require timestamps for importmulti keys (Russell Yanofsky)
2017-02-14 14:32:22 +01:00
Jonas Schnelli 4b6ccccc16
Selectively suppress deprecation warnings 2017-02-14 13:50:57 +01:00
Wladimir J. van der Laan ec66d06e6e
Merge #9735: devtools: Handle Qt formatting characters edge-case in update-translations.py
7179e7c qt: Periodic translations update (Wladimir J. van der Laan)
5e903a5 devtools: Handle Qt formatting characters edge-case in update-translations.py (Wladimir J. van der Laan)
2017-02-14 12:21:34 +01:00
Cory Fields cbfc5a6728 net: require a verack before responding to anything else
7a8c251901 made this logic hard to follow. After that change, messages would
not be sent to a peer via SendMessages() before the handshake was complete, but
messages could still be sent as a response to an incoming message.

For example, if a peer had not yet sent a verack, we wouldn't notify it about
new blocks, but we would respond to a PING with a PONG.

This change makes the behavior straightforward: until we've received a verack,
never send any message other than version/verack/reject.

The behavior until a VERACK is received has always been undefined, this change
just tightens our policy.

This also makes testing much easier, because we can now connect but not send
version/verack, and anything sent to us is an error.
2017-02-13 18:55:35 -05:00
Cory Fields 8502e7acbe net: parse reject earlier
Prior to this change, all messages were ignored until a VERSION message was
received, as well as possibly incurring a ban score.

Since REJECT messages can be sent at any time (including as a response to a bad
VERSION message), make sure to always parse them.

Moving this parsing up keeps it from being caught in the
if (pfrom->nVersion == 0) check below.
2017-02-13 18:55:35 -05:00