8892 Commits

Author SHA1 Message Date
Suhas Daftuar
52965fbaef
Fix crash bug with duplicate inputs within a transaction
Introduced by #9049

Github-Pull: #14247

Tree-SHA512: 54ccf896e4c816ba8532644affc984a091ed801d8387bb01a836953c9ec4a345359d98fb58dd5f929617afd42bce0cc40293fecf943a1584207c82dd78da0ea5
2018-09-18 13:05:49 +02:00
Wladimir J. van der Laan
91be5e3c1e
Merge #10516: Backports for 0.14.3
ff274d3 [doc] Add hint about getmempoolentry to getrawmempool help. (Karl-Johan Alm)
76f9cf9 contrib: Update location of seeds.txt (Wladimir J. van der Laan)
12adedf Trivial: remove extra character from comment (CryptAxe)
d2ec969 Fixed typo in documentation for merkleblock.h (Mikerah)
3612219 contrib/init/bitcoind.openrcconf: Don't disable wallet by default (Luke Dashjr)
692dbb0 [doc] Minor corrections to osx dependencies (fanquake)
87a21d5 Fix: make CCoinsViewDbCursor::Seek work for missing keys (Pieter Wuille)
28b8b8b [wallet] Securely erase potentially sensitive keys/values (Thomas Snider)
ff13f59 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call. (Karl-Johan Alm)
e23cef0 Fix some empty vector references (Pieter Wuille)
6ad45b8 Re-enable upnp support in contrib/debian (Matt Corallo)
e9a0d89 Build with QT5 on Debian-based systems using contrib/debian (Matt Corallo)
2ea0358 Bump minimum boost version in contrib/debian (Matt Corallo)
c94e262 Update contrib/debian to latest Ubuntu PPA upload. (Matt Corallo)
96c7f2c Add CheckQueue Tests (Jeremy Rubin)
e207342 Fix CCheckQueue IsIdle (potential) race condition and remove dangerous constructors. (Jeremy Rubin)
ef810c4 [trivial] Fix a typo (introduced two days ago) in the default fee warning (practicalswift)
7abe7bb Qt/Send: Give fallback fee a reasonable indent (Luke Dashjr)
3e4d7bf Qt/Send: Figure a decent warning colour from theme (Luke Dashjr)
c5adf8f [Qt] Show more significant warning if we fall back to the default fee (Jonas Schnelli)
ee1a60d [tests] update disconnect_ban.py test case to work with listbanned (John Newbery)
d289b56 [net] listbanned RPC and QT should show correct banned subnets (John Newbery)
0422693 [tests] disconnect_ban: remove dependency on urllib (John Newbery)
98bd0c3 [tests] disconnect_ban: use wait_until instead of sleep (John Newbery)
bfd1cf6 [tests] disconnectban test - only use two nodes (John Newbery)
5bc75bb [tests] fix nodehandling.py flake8 warnings (John Newbery)
c25d0a8 Update release notes to include RPC error code changes. (John Newbery)
f5efe82 Return correct error codes in fundrawtransaction(). (John Newbery)
4943d7a Return correct error codes in setban(). (John Newbery)
18c109d Return correct error codes in removeprunedfunds(). (John Newbery)
fe51c89 Return correct error codes in blockchain.cpp. (John Newbery)
3ad00b4 Return correct error codes in bumpfee(). (John Newbery)
71463a7 [qa] Test prioritise_transaction / getblocktemplate interaction (Suhas Daftuar)
d28d583 Bugfix: PrioritiseTransaction updates the mempool tx counter (Suhas Daftuar)

Tree-SHA512: fa3628527c8e176e438de992b9c5815cc2f3c296dbe5d81b592d17a907554e9c6af7eb595e96a2c345de399ba5326c07b4791a91b7b07f89dce0787c85891206
2017-07-06 18:57:00 +02:00
Wladimir J. van der Laan
cc23438af0
qt: 0.14.2 pre-rc2 translations update 2017-06-06 15:06:16 +02:00
Karl-Johan Alm
ff274d3b00 [doc] Add hint about getmempoolentry to getrawmempool help.
Github-Pull: #10310
Rebased-From: 3a0a5bc2341ea6a453306f6fe1c065b937294cfb
2017-06-05 22:58:53 +00:00
CryptAxe
12adedff0b Trivial: remove extra character from comment
Github-Pull: #10309
Rebased-From: 3503716f1e37a0cc3ab13c8f4e774061ff4ae2f8
2017-06-05 22:58:53 +00:00
Mikerah
d2ec96909a Fixed typo in documentation for merkleblock.h
Github-Pull: #10258
Rebased-From: dd07068d6b11e738bc954c998800b5660d160959
2017-06-05 22:58:53 +00:00
Pieter Wuille
87a21d5922 Fix: make CCoinsViewDbCursor::Seek work for missing keys
Thanks to Suhas Daftuar for figuring this out.

Github-Pull: #10445
Rebased-From: 822755a424d0abfa408dc34313f4aca4b816f54f
2017-06-05 22:58:25 +00:00
Thomas Snider
28b8b8b603 [wallet] Securely erase potentially sensitive keys/values
Github-Pull: #10308
Rebased-From: 6c914ac176624468c66febdb1ad0e24ff2118a5f
2017-06-05 22:58:24 +00:00
Karl-Johan Alm
ff13f592c5 [wallet] Make sure pindex is non-null before possibly referencing in LogPrintf call.
Github-Pull: #10265
Rebased-From: c36ea693ee16611e0337aec682d1ce80b90e1bd3
2017-06-05 22:58:24 +00:00
Pieter Wuille
e23cef0c94 Fix some empty vector references
streams.h has some methods that can be tricked into dereferencing
null pointers or end() iterators. Fix this.

Github-Pull: #10250
Rebased-From: f478d98fe49d3c0c0f2c79b3f8d9dbfc1aafd407
2017-06-05 22:58:23 +00:00
Luke Dashjr
1b864c9820 Merge #9497 via remote-tracking branch 'origin-pull/9497/head' into 0.14.2_fixes 2017-06-05 22:58:00 +00:00
Luke Dashjr
77de9bbc57 Merge #10008 via branch 'fee_warning-0.14' into 0.14.2_fixes 2017-06-05 22:57:49 +00:00
Luke Dashjr
aca4b6dbcb Merge #9481 via remote-tracking branch 'jonas/2017/01/fee_warning' into 0.14.2_fixes 2017-06-05 22:57:35 +00:00
Luke Dashjr
e05799a381 Merge #10234, #10143 (fixes only), and #9853 via branch 'disconnect_ban_fixes-0.14' into 0.14.2_fixes 2017-06-05 22:57:27 +00:00
John Newbery
d289b564e3 [net] listbanned RPC and QT should show correct banned subnets
Github-Pull: #10234
Rebased-From: 77c54b270dd3b469d662c8f69e06f7b00fc4136d
2017-06-05 22:56:05 +00:00
Luke Dashjr
99e5dbd0aa Merge #9853 via branch 'fixerrorcodes-0.14' into 0.14.2_fixes 2017-06-05 19:33:18 +00:00
Luke Dashjr
74653a41fe Merge #10196 via branch 'prioritisetx_gbtcache-0.14' into 0.14.2_fixes 2017-06-05 19:33:01 +00:00
John Newbery
f5efe82a83 Return correct error codes in fundrawtransaction().
The fundrawtransaction() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when funding the transaction
failed). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.

That error code has been replaced with RPC_WALLET_ERROR.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: dab804c18a427901684ebe936b2069a97e04a268
2017-06-05 19:01:16 +00:00
John Newbery
4943d7a9fe Return correct error codes in setban().
The setban() RPC was returning misleading or incorrect error
codes (for example RPC_CLIENT_NODE_ALREADY_ADDED when an invalid IP
address was entered). This commit fixes those error codes:

- RPC_CLIENT_INVALID_IP_OR_SUBNET should be returned if the client
  enters an invalid IP address or subnet.

This commit also updates the test cases to explicitly test the error code.

This commit also adds a testcase for trying to setban on an invalid subnet.

Github-Pull: #9853
Rebased-From: a012087667edb35a36f25ae06b42b1644d80e649
2017-06-05 19:01:16 +00:00
John Newbery
18c109ddb1 Return correct error codes in removeprunedfunds().
The removeprunedfunds() RPC was returning misleading or incorrect error
codes (for example RPC_INTERNAL_ERROR when the transaction was
not found in the wallet). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
errors, only for genuine internal errors such as corrupted data.

This error code has been replaced with RPC_WALLET_ERROR.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: 960bc7f778d8dd618e65f1e37ec734e2d4734051
2017-06-05 19:01:16 +00:00
John Newbery
fe51c8924e Return correct error codes in blockchain.cpp.
RPCs in blockchain.cpp were returning misleading or incorrect error
codes (for example getblock() returning RPC_INTERNAL_ERROR when the
block had been pruned). This commit fixes those error codes:

- RPC_INTERNAL_ERROR should not be returned for application-level
  errors, only for genuine internal errors such as corrupted data.
- RPC_METHOD_NOT_FOUND should not be returned in response to a
  JSON request for an existing method.

Those error codes have been replaced with RPC_MISC_ERROR or
RPC_INVALID_PARAMETER as appropriate.

Github-Pull: #9853
Rebased-From: c1190963b388590dc0a346bf625c7e84f69cee8d
2017-06-05 19:01:16 +00:00
John Newbery
3ad00b4b32 Return correct error codes in bumpfee().
The bumpfee() RPC was returning misleading or incorrect error codes
(for example RPC_INVALID_ADDRESS_OR_KEY when the transaction was not
BIP125 replacable). This commit fixes those error codes:

- RPC_INVALID_ADDRESS_OR_KEY if an invalid address was provided:
    - Invalid change address given
- RPC_INVALID_PARAMETER if a single (non-address/key) parameter is incorrect
    - confTarget and totalFee options should not both be set.
    - Invalid confTarget
    - Insufficient totalFee (cannot be less than required fee)
- RPC_WALLET_ERROR for any other error
    - Transaction has descendants in the wallet
    - Transaction has descendants in the mempool
    - Transaction has been mined, or is conflicted with a mined transaction
    - Transaction is not BIP 125 replaceable
    - Transaction has already been bumped
    - Transaction contains inputs that don't belong to the wallet
    - Transaction has multiple change outputs
    - Transaction does not have a change output
    - Fee is higher than maxTxFee
    - New fee rate is less than the minimum fee rate
    - Change output is too small.

This commit also updates the test cases to explicitly test the error code.

Github-Pull: #9853
Rebased-From: 6d07c62322f60eb2702c6654e994fc353bcfcf8c
2017-06-05 19:01:16 +00:00
practicalswift
ef810c4cd4 [trivial] Fix a typo (introduced two days ago) in the default fee warning
Github-Pull: #10008
Rebased-From: a3ca43bb32520fdc049bc2112a29a554188126cc
2017-06-03 21:19:05 +00:00
Wladimir J. van der Laan
4a41de4585
build: bump version to 0.14.2 2017-06-02 07:39:56 +02:00
Cory Fields
9e3ad50078
net: only enforce the services required to connect
also once half of all outgoing nodes have our preferred flags, require only
minimal flags from the rest.

Github-Pull: #10441
Rebased-From: b6fbfc228236947eaea5c14dda299f5a01810e92
2017-06-01 13:26:12 +02:00
Gregory Sanders
18476423fb
[Wallet] unset change position when there is no change on exact match 2017-05-31 10:57:16 +02:00
Cory Fields
ae479bc45b
build: fix bitcoin-config.h regeneration after touching build files
This was a long-standing and annoying problem.

If autogen.sh was not manually run after touching configure.ac,
bitcoin-config.h would not be properly regenerated. This causes very subtle
problems when configure appears to enable a new value, but it does not end up
reflected in the build.
2017-05-31 10:54:19 +02:00
Jonas Schnelli
4bc99c3b28
Add missing <atomic> header in clientmodel.h 2017-05-31 10:53:47 +02:00
Jonas Schnelli
222f3775cf
Set both time/height header caches at the same time 2017-05-31 10:53:47 +02:00
Jonas Schnelli
7da133772d
Declare headers height/time cache mutable, re-set the methods const 2017-05-31 10:53:47 +02:00
Jonas Schnelli
9ac40e853c
Update the remaining blocks left in modaloverlay at init. 2017-05-31 10:53:47 +02:00
Jonas Schnelli
1e936d7e87
Reduce cs_main locks during modal overlay by adding an atomic cache 2017-05-31 10:53:46 +02:00
Matt Corallo
0aee4a132b
Check interruptNet during dnsseed lookups 2017-05-31 10:52:56 +02:00
Russell Yanofsky
321419bc06
Fix importwallet edge case rescan bug
Start importwallet rescans at the first block with timestamp greater or equal
to the wallet birthday instead of the last block with timestamp less or equal.
This fixes an edge case bug where importwallet could fail to start the rescan
early enough if there are blocks with decreasing timestamps or multiple blocks
with the same timestamp.

Github-Pull: #10410
Rebased-From: 2a8e35a11d4bd4828631654fc7b8b8fe8f0a2460
2017-05-23 17:09:42 +02:00
Alex Morcos
37a8fc54d4
Populate services in GetLocalAddress
Previously if we didn't have any local addresses, GetLocalAddress would return
0.0.0.0 and then we'd swap in a peer's notion of our address in AdvertiseLocal,
but then nServices would never get set.

Github-Pull: #10424
Rebased-From: 307013469f9a3b8f13d3eb9dbeea419a55148493
2017-05-22 12:56:13 +02:00
Warren Togami
51c787dfb4
Clarify importprivkey help text with example of blank label without rescan
Occasionally I waste a lot of time not remembering that the second parameter to importprivkey must be blank if you intend to stop rescan with "false" as the third parameter.

Github-Pull: #10207
Rebased-From: c9e31c36ffacedb85d4d9ce75a92e011a3e7d4b4
2017-04-20 08:18:50 +02:00
Suhas Daftuar
d28d583820 Bugfix: PrioritiseTransaction updates the mempool tx counter
The mempool's nTransactionsUpdated is used by getblocktemplate
to trigger new invocations of CreateNewBlock().

Github-Pull: #10196
Rebased-From: 909306cde3770ed7019e7b635e24cedbd9de66ce
2017-04-19 20:10:02 +00:00
Wladimir J. van der Laan
348a71701d
qt: translations update pre-rc2 2017-04-14 12:25:51 +02:00
Cory Fields
30fa231011
net: define NodeId as an int64_t
This should make occurances of NodeId wrapping essentially impossible for
real-world usage.

Github-Pull: #10176
Rebased-From: c851be4b25905977ca471c42435dc590fd2ff2f5
2017-04-14 10:35:49 +02:00
John Newbery
3c796026e5
[rpc] rename disconnectnode argument
Github-Pull: #10204
Rebased-From: 883154cbcb306dcc6205fe349c7056ced1f6c5fc
2017-04-14 10:19:06 +02:00
Wladimir J. van der Laan
47d24c85b7
Bump version to 0.14.1 2017-04-05 09:12:36 +02:00
Suhas Daftuar
ea060c7495
Bugfix: ancestor modifed fees were incorrect for descendants
If prioritisetransaction was called for a tx with in-mempool
descendants, the modified ancestor fee values for those descendants was
incorrect.

Github-Pull: #10144
Rebased-From: 9bef02e36525d0eed4e2e31678b3ff04bbb0b8cb
2017-04-05 08:37:12 +02:00
Alex Morcos
0e5133cb2e
Make threshold for flushing more conservative.
Always leave a reasonable buffer of 50MB for usage from newly connected block (once over 50%) and increase the high water mark buffer to 200MB.

Github-Pull: #10133
Rebased-From: 1b55e07b7a61a9e6c299cf4c40fde80fa715d440
2017-04-05 08:23:02 +02:00
Alex Morcos
d6867689d1
Lower default memory footprint slightly
Github-Pull: #10133
Rebased-From: f33afd3b2be1bcabeb10168a53835359c9ff4a3e
2017-04-05 08:23:01 +02:00
Alex Morcos
ab864d3e49
Make pcoinsTip memory calculations consistent
Since we are more accurately measuring pcoinsTip peak usage at twice the current in dynamic usage, it makes sense to double the default (this will lead to the same effective usage and peak usage as previously).
We should also double the buffer used to avoid flushing if above 90% but still sufficient space remaining.

Github-Pull: #10133
Rebased-From: 5b95a190e8d7059039ce61e808d494dcf89ebb3b
2017-04-05 08:23:01 +02:00
Gregory Maxwell
a44a6a15f9
Check transaction count early in submitblock.
There is no point in even hashing a submitted block which doesn't have
 a coinbase transaction.

This also results in more useful error reporting on corrupted input.

Thanks to rawodb for the bug report.

Github-Pull: #10146
Rebased-From: 4f15ea102d15eb237b63464725508dc509e98819
2017-04-04 09:01:03 +02:00
Gregory Maxwell
2fea10ad03
Make GetWitnessCommitmentIndex callable on blocks without a coinbase txn.
This isn't actually needed anywhere, but it's less brittle.

Github-Pull: #10146
Rebased-From: ada0caa165905b50db351a56ec124518c922085a
2017-04-04 09:01:03 +02:00
practicalswift
f15268db3b
[rpc] Remove auth cookie on shutdown
Accidentally removed in 40b556d3742a1f65d67e2d4c760d0b13fe8be5b7

Github-Pull: #10139
Rebased-From: 4b87973c32bcaa5fa7509793e4f0c4f4f981f21b
2017-04-03 08:54:53 +02:00
Pieter Wuille
0b5e162b84
Compensate for memory peak at flush time
Github-Pull: #10126
Rebased-From: 7228ce853de5670d559d752f04a7db79578990ea
2017-03-31 12:07:18 +02:00
Wladimir J. van der Laan
fa6b5fc1cc
Merge #10127: [0.14 backport] Mining: Prevent slowdown in CreateNewBlock on large mempools
a296c60 Update benchmarking with package statistics (Suhas Daftuar)
10028fb Add benchmarking for CreateNewBlock (Suhas Daftuar)
b5c3440 Mining: return early when block is almost full (Suhas Daftuar)

Tree-SHA512: 7c39d03a778abe00412743958981a1a55d22fc1843c9a3aef7a56506622e6f5d6b8962c586a339b6031e1ee4815d6981351cf527e8fbe5b265824c81d6c7199d
2017-03-31 12:06:56 +02:00