Commit Graph

7596 Commits

Author SHA1 Message Date
Suhas Daftuar 1de2a46632 Ignore GETBLOCKTXN requests for unknown blocks
Don't disconnect peers, or else we leak information that could be
used for fingerprinting.
2016-07-26 16:50:48 -04:00
Wladimir J. van der Laan 4b1a4d8810
Merge #8381: Make witness v0 outputs non-standard
c59c434 qa: Add test for standardness of segwit v0 outputs (Suhas Daftuar)
1ffaff2 Make witness v0 outputs non-standard before segwit activation (Johnson Lau)
2016-07-26 14:24:11 +02:00
Wladimir J. van der Laan 618c9dd8c6
Merge #8365: Treat high-sigop transactions as larger rather than rejecting them
ab942c1 Treat high-sigop transactions as larger rather than rejecting them (Pieter Wuille)
2016-07-26 11:27:30 +02:00
Wladimir J. van der Laan 517eee3e8f
Merge #8362: Scale legacy sigop count in CreateNewBlock
682aa0f Scale legacy sigop count in CreateNewBlock (Suhas Daftuar)
2016-07-25 18:08:09 +02:00
lizhi cc021ef486 remove outdated legacy code
CheckSignatureElement is not used,it be replaced by eccrypto::CheckSignatureElement.
2016-07-24 10:49:07 +08:00
NicolasDorier 122786d0e0 Consensus: Remove ISM 2016-07-23 01:02:53 +09:00
Suhas Daftuar c59c434b7d qa: Add test for standardness of segwit v0 outputs 2016-07-23 00:01:02 +08:00
Johnson Lau 1ffaff2f74 Make witness v0 outputs non-standard before segwit activation 2016-07-22 06:35:07 +00:00
Jonas Schnelli b50e1ac298
[Wallet] Correct hdmasterkeyid/masterkeyid name confusion 2016-07-21 21:58:12 +02:00
Wladimir J. van der Laan 381917f610
Merge #8347: Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock
6f3d616 Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock (Jorge Timón)
2016-07-21 14:31:40 +02:00
NicolasDorier 7821889bce Consensus: Remove calls to error() from ContextualCheckBlock 2016-07-21 20:57:08 +09:00
Wladimir J. van der Laan 6f4092da80
Merge #8342: Consensus: Trivial transform BOOST_FOREACH into for loop
a3e1984 Consensus: Trivial transform BOOST_FOREACH into for loop (NicolasDorier)
2016-07-21 11:56:33 +02:00
Patrick Strateman 6523fcaab2 Move SetMinVersion for FEATURE_HD to SetHDMasterKey 2016-07-19 22:30:17 -07:00
Pieter Wuille ab942c15bd Treat high-sigop transactions as larger rather than rejecting them 2016-07-19 12:31:49 +02:00
Wladimir J. van der Laan 045106b4f1
Merge #8367: [Wallet] Ensure <0.13 clients can't open HD wallets
a4f137f [Wallet] Ensure <0.13 clients can't open HD wallets (Jonas Schnelli)
2016-07-19 12:13:12 +02:00
Thomas Snider fbc60703a5 [trivial] Switched constants to sizeof() 2016-07-18 19:42:09 -07:00
Jonas Schnelli a4f137f367
[Wallet] Ensure <0.13 clients can't open HD wallets 2016-07-18 22:56:45 +02:00
Suhas Daftuar 2c06bae39e Rename "block cost" to "block weight" 2016-07-18 13:28:26 -04:00
Suhas Daftuar 682aa0f289 Scale legacy sigop count in CreateNewBlock 2016-07-18 12:42:41 -04:00
Wladimir J. van der Laan 6c0336c772
build: bump version to 0.13.99
Now that 0.13 branch has been split off, master is 0.13.99 (pre-0.14).
2016-07-18 12:22:18 +02:00
Wladimir J. van der Laan e4382fbef5
qt: periodic translations update 2016-07-18 12:13:08 +02:00
Wladimir J. van der Laan 8cef5bd58a mining: Improve `-blockmaxcost` help message
One-word replacement to #8354.
2016-07-18 10:56:25 +02:00
Wladimir J. van der Laan f5660d381a
Merge #8295: Mining-related fixups for 0.13.0
c1d61fb Add warning if -blockminsize is used. (Suhas Daftuar)
27362dd Remove -blockminsize option (Suhas Daftuar)
d2e46e1 Remove addScoreTxs() (Suhas Daftuar)
6dd4bc2 Exclude witness transactions in addPackageTxs() pre-segwit activation (Suhas Daftuar)
f15c2cd CreateNewBlock: add support for size-accounting to addPackageTxs (Suhas Daftuar)
2016-07-18 08:23:45 +02:00
Wladimir J. van der Laan 238300b398
Merge #8323: Add HD keypath to CKeyMetadata, report metadata in validateaddress
7945088 [Wallet] comsetic non-code changes for the HD feature (Jonas Schnelli)
68d7682 [Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() (Jonas Schnelli)
f708085 [QA] extend wallet-hd test to cover HD metadata (Jonas Schnelli)
986c223 [Wallet] print hd masterkeyid in getwalletinfo (Jonas Schnelli)
b1c7b24 [Wallet] report optional HDKeypath/HDMasterKeyId in validateaddress (Jonas Schnelli)
5b95dd2 [Wallet] extend CKeyMetadata with HD keypath (Jonas Schnelli)
2016-07-18 07:58:33 +02:00
Wladimir J. van der Laan 37303934fe
Merge #8305: Improve handling of unconnecting headers
e91cf4b Add test for handling of unconnecting headers (Suhas Daftuar)
96fa953 Improve handling of unconnecting headers (Suhas Daftuar)
2016-07-18 07:46:12 +02:00
Jorge Timón 38c4c8b701 Trivial: Segwit: Don't call IsWitnessEnabled from ContextualCheckBlock 2016-07-17 02:41:58 +02:00
Jorge Timón 6f3d616dc8 Trivial: Make CBlockIndex param const in ContextualCheckBlockHeader and ContextualCheckBlock 2016-07-17 01:43:15 +02:00
NicolasDorier a3e1984651 Consensus: Trivial transform BOOST_FOREACH into for loop 2016-07-16 11:08:52 +09:00
Jonas Schnelli 7945088d41
[Wallet] comsetic non-code changes for the HD feature 2016-07-15 10:34:08 +02:00
Jonas Schnelli 68d7682b9f
[Wallet] ensure CKeyMetadata.hdMasterKeyID will be cleared during SetNull() 2016-07-15 10:33:25 +02:00
Wladimir J. van der Laan bc94b87487
Merge #8324: [Wallet] keep HD seed during salvagewallet
b993671 [Wallet] keep HD seed during salvagewallet (Jonas Schnelli)
2016-07-14 11:37:48 +02:00
Wladimir J. van der Laan ca40ef6029
Merge #8312: Fix mempool DoS vulnerability from malleated transactions
46c9620 Test that unnecessary witnesses can't be used for mempool DoS (Suhas Daftuar)
bb66a11 Fix DoS vulnerability in mempool acceptance (Suhas Daftuar)
2016-07-14 08:21:13 +02:00
Wladimir J. van der Laan 4324bd237c
Merge #8311: Rename CTxinWitness -> CTxInWitness
36ae37a Rename CTxinWitness -> CTxInWitness (Bob McElrath)
2016-07-14 08:18:38 +02:00
Wladimir J. van der Laan 1bc9c8085f
Merge #8271: [bugfix] Do not send witnesses in cmpctblock
252675e Do not send witnesses in cmpctblock (Pieter Wuille)
2016-07-14 08:17:22 +02:00
Daniel Cousens e37b16a75c transaction: clarify witness branches 2016-07-14 13:40:50 +10:00
Suhas Daftuar 96fa95361f Improve handling of unconnecting headers
When processing a headers message that looks like a block announcement,
send peer a getheaders if the headers message won't connect.

Apply DoS points after too many consecutive unconnecting headers messages.
2016-07-12 13:12:40 -04:00
Wladimir J. van der Laan 4831a16223
qt: periodic translation update
Added languages:
- `bg_BG`: Bulgarian (Bulgaria)
2016-07-12 11:40:33 +02:00
Jonas Schnelli b993671921
[Wallet] keep HD seed during salvagewallet 2016-07-09 12:58:03 +02:00
Jonas Schnelli 986c223214
[Wallet] print hd masterkeyid in getwalletinfo 2016-07-09 12:12:36 +02:00
Jonas Schnelli b1c7b244e2
[Wallet] report optional HDKeypath/HDMasterKeyId in validateaddress 2016-07-09 12:12:32 +02:00
Jonas Schnelli 5b95dd2c25
[Wallet] extend CKeyMetadata with HD keypath 2016-07-09 11:52:17 +02:00
MarcoFalke 477777f250 [rpcwallet] Don't use floating point 2016-07-08 12:01:25 +02:00
Wladimir J. van der Laan ff46dd4a34
Merge #7540: Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY
18c975c Rename NOP3 to CHECSEQUENCEVERIFY in rpc tests (BtcDrak)
14d0130 Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY (BtcDrak)
2016-07-08 11:39:10 +02:00
Suhas Daftuar bb66a11396 Fix DoS vulnerability in mempool acceptance
Moves the IsStandard check to happen after the premature-witness check,
so that adding a witness to a transaction can't prevent mempool acceptance.

Note that this doesn't address the broader category of potential mempool DoS
issues that affect transactions after segwit activation.
2016-07-07 15:49:26 -04:00
Bob McElrath 36ae37a9f9 Rename CTxinWitness -> CTxInWitness 2016-07-06 19:46:46 -04:00
Jonas Schnelli 91abb77970
Merge #8288: qt: Network-specific example address
4f44cb6 qt: Network-specific example address (Wladimir J. van der Laan)
2016-07-06 15:45:17 +02:00
Wladimir J. van der Laan b978701ba1
qt: periodic translations update 2016-07-06 07:59:07 +02:00
Wladimir J. van der Laan 396f9d6296
Merge #8273: Bump `-dbcache` default to 300MiB
efd1d83 doc: Mention dbcache increase in release notes (Wladimir J. van der Laan)
32cab91 Bump `-dbcache` default to 300MiB (Wladimir J. van der Laan)
2016-07-06 07:46:47 +02:00
Wladimir J. van der Laan 32cab91278 Bump `-dbcache` default to 300MiB
Also cap the allocation for the leveldb-specific cache for the UTXO set
to 8MiB.
This avoids that the extra cache memory goes to the much less effective
leveldb cache instead of our application-level cache.
2016-07-06 07:44:51 +02:00
Wladimir J. van der Laan 042c323922
Merge #8275: Remove bad chain alert partition check
ab8be98 Remove bad chain alert partition check (BtcDrak)
2016-07-06 07:35:54 +02:00
Wladimir J. van der Laan aef381161f
Merge #8298: wallet: Revert input selection post-pruning
20f3cd7 wallet: Revert input selection post-pruning (Wladimir J. van der Laan)
2016-07-06 07:21:40 +02:00
Suhas Daftuar c1d61fbd08 Add warning if -blockminsize is used. 2016-07-05 19:57:45 -04:00
Gregory Maxwell 4fbdc4365b Revert "net: Avoid duplicate getheaders requests." PR #8054
This reverts commit f93c2a1b7e.

This can cause synchronization to get stuck.
2016-07-05 20:45:14 +00:00
Wladimir J. van der Laan 20f3cd75f6 wallet: Revert input selection post-pruning
This reverts PR #4906, "Coinselection prunes extraneous inputs from
ApproximateBestSubset".

Apparently the previous behavior of slightly over-estimating the set of
inputs was useful in cleaning up UTXOs.

See also #7664, #7657, as well as 2016-07-01 discussion on #bitcoin-core-dev IRC.
2016-07-01 13:26:01 +02:00
Suhas Daftuar 27362dda4d Remove -blockminsize option 2016-06-30 11:41:13 -04:00
Suhas Daftuar d2e46e1b5c Remove addScoreTxs() 2016-06-30 11:37:38 -04:00
Suhas Daftuar 6dd4bc289c Exclude witness transactions in addPackageTxs() pre-segwit activation 2016-06-30 11:24:32 -04:00
Wladimir J. van der Laan 975a41dcc2 windows: Add testnet icon for testnet link
Overhauled testnet icon by Jonas Schnelli
2016-06-30 17:17:58 +02:00
Wladimir J. van der Laan 4f44cb616d qt: Network-specific example address
Generate an (invalid) example address for in the bitcoin address
widgets, based on the network prefix, instead of hardcoding a mainnet
address.

- `1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L` for mainnet (same as now)
- `n2wxQmfexkjwEPgdD6iJA7T7RtzkmHxhFc` for testnet
2016-06-29 17:35:54 +02:00
Wladimir J. van der Laan a7897c02f7 qt: Remove client name from debug window
Remove the client name from the debug window in the GUI. It is already
part of the user agent, so adding it separately doesn't add anything.
2016-06-28 18:27:49 +02:00
BtcDrak 14d01309be Rename OP_NOP3 to OP_CHECKSEQUENCEVERIFY 2016-06-28 17:17:36 +01:00
Wladimir J. van der Laan 3685e0c1da
Merge #8261: The bit field is shown only when status is "started"
2129fce The bit field is shown only when status is "started" (Pavel Janík)
2016-06-28 16:06:40 +02:00
Wladimir J. van der Laan 3b2dadc8d5
qt: Periodic translations update 2016-06-28 11:49:38 +02:00
Pavel Janík 2129fcea69 The bit field is shown only when status is "started" 2016-06-28 10:25:27 +02:00
Wladimir J. van der Laan ff03c50c00
Merge #8257: Do not ask a UI question from bitcoind
1acf1db Do not ask a UI question from bitcoind (Pieter Wuille)
2016-06-28 10:12:01 +02:00
Wladimir J. van der Laan a5072a7730 util: Remove zero-argument versions of LogPrint and error
Changes in tinyformat, recently imported from upstream have made the
zero-argument versions of formatting functions unnecessary. Remove them.

This is a slight semantic change: `%` characters in the zero-argument
call are now regarded and need to be escaped. As for as I know, the only
use of this is in `main.cpp`.
2016-06-27 18:39:25 +02:00
Wladimir J. van der Laan 695041e495 util: Update tinyformat
Updates `tinyformat.h` to commit
3a33bbf654 upstream.

Makes sure that our local changes are kept:

- #3767 1b8fd35aad Make tinyformat errors raise an exception instead of assert()ing
- #4735 9b6d4c5cdc Move strprintf define to tinyformat.h
- #4748 6e5fd003e0 include stdexcept (for std::exception)
- #8000 9eaa0afa6e force USE_VARIADIC_TEMPLATES
- Add `std::string format(const std::string &fmt...` added this
  at the time, as we want to be able to do `strprintf(_(...), ...)`

Inspired by #8264.
2016-06-27 18:17:27 +02:00
Suhas Daftuar f15c2cde45 CreateNewBlock: add support for size-accounting to addPackageTxs
Includes a change to not continue to use size-accounting in addScoreTxs
or addPackageTxs just because addPriorityTxs() is used.
2016-06-27 10:58:58 -04:00
Wladimir J. van der Laan 5a06ebbf2d
Merge #8258: RPC: Hide softfork if timeout is 0
409f833 RPC: Hide softfork if timeout is 0 (jl2012)
2016-06-27 16:07:50 +02:00
Pieter Wuille 252675efc6 Do not send witnesses in cmpctblock 2016-06-26 20:19:00 +02:00
Wladimir J. van der Laan 1922e5a654
Merge #8244: remove unnecessary LOCK(cs_main) in getrawpmempool
27f8126 remove unnecessary LOCK(cs_main) (Daniel Cousens)
2016-06-25 16:10:10 +02:00
jl2012 409f83322e RPC: Hide softfork if timeout is 0 2016-06-25 00:55:07 +08:00
Wladimir J. van der Laan d612837814
Merge #8149: Segregated witness rebased
f852813 BIP9 parameters for testnet (Johnson Lau)
070dbc4 --- [SEGWIT] begin: deployment --- (Pieter Wuille)
fdb43df [qa] Add GetTransactionSigOpCost unit tests (Jonas Nick)
d846e02 [qa] script_tests: witness tests can specify tx amount (Suhas Daftuar)
330b0f3 [qa] p2p segwit tests (Suhas Daftuar)
4f7ff00 [qa] Add rpc test for segwit (Alex Morcos)
66cca79 [qa] Autogeneration support for witness in script_tests (Pieter Wuille)
06d3805 [qa] Add segwit support to script_tests (Pieter Wuille)
00f46cb [qa] Add transaction tests for segwit (NicolasDorier)
0aa9207 [qa] Witness version 0 signing unit tests (Pieter Wuille)
978e200 --- [SEGWIT] begin: tests --- (Pieter Wuille)
745eb67 [RPC] signrawtransaction can sign P2WSH (NicolasDorier)
f4691ab [RPC] Add wallet support for witness transactions (using P2SH) (Pieter Wuille)
605e847 BIP143: Signing logic (Pieter Wuille)
9757b57 --- [SEGWIT] begin: wallet --- (Pieter Wuille)
af87a67 Do not use compact blocks when segwit is enabled (Pieter Wuille)
6032f69 Add rewind logic to deal with post-fork software updates (Pieter Wuille)
b7dbeb2 [libconsensus] Script verification API with amounts (Thomas Kerin)
2b1f6f9 BIP141: Other consensus critical limits, and BIP145 (Pieter Wuille)
7c4bf77 [RPC] Return witness data in blockchain RPCs (Johnson Lau)
3dd4102 BIP143: Verification logic (Pieter Wuille)
0ef1dd3 Refactor script validation to observe amounts (Pieter Wuille)
b8a9749 BIP144: Handshake and relay (receiver side) (Pieter Wuille)
8b49040 BIP141: Commitment structure and deployment (Pieter Wuille)
449f9b8 BIP141: Witness program (Pieter Wuille)
7030d9e BIP144: Serialization, hashes, relay (sender side) (Pieter Wuille)
ecacfd9 --- [SEGWIT] begin: P2P/node/consensus --- (Pieter Wuille)
2016-06-24 18:07:44 +02:00
Pieter Wuille 1acf1db76f Do not ask a UI question from bitcoind 2016-06-24 16:45:12 +02:00
Wladimir J. van der Laan af2421c291
Merge #8256: BUG: bitcoin-qt crash
d7828ab check that transactionView->selectionModel()->selectedRows(0) exists (fsb4000)
2016-06-24 13:48:16 +02:00
fsb4000 d7828abd5b check that transactionView->selectionModel()->selectedRows(0) exists 2016-06-24 18:08:32 +07:00
Pieter Wuille 133deb83df Mark my dnsseed as supporting filtering 2016-06-23 15:44:35 +02:00
Wladimir J. van der Laan 08338942b5
Merge #8204: Update petertodd's testnet seed
d80efec Update petertodd's testnet seed (Peter Todd)
2016-06-23 13:04:42 +02:00
Wladimir J. van der Laan a1c92c29fd trivial: capitalize BIP32 in option help
For consistency, BIP32 should be in uppercase in translation message.

Reported by @pryds on Transifex.
2016-06-23 10:44:36 +00:00
Daniel Cousens 27f8126ff3 remove unnecessary LOCK(cs_main) 2016-06-23 12:44:53 +10:00
Johnson Lau f8528134fc BIP9 parameters for testnet 2016-06-22 15:43:02 +02:00
Jonas Nick fdb43df23e [qa] Add GetTransactionSigOpCost unit tests 2016-06-22 15:43:02 +02:00
Suhas Daftuar d846e02372 [qa] script_tests: witness tests can specify tx amount
Add tests that witness signatures cover value
2016-06-22 15:43:02 +02:00
Suhas Daftuar 330b0f31ee [qa] p2p segwit tests
mininode now supports witness transactions/blocks, blocktools
has a helper for adding witness commitments to blocks, and script
has a function to calculate hashes for signature under sigversion
1, used by segwit.

Py3 conversion by Marco Falke

Test to make sure upgraded nodes don't ask for non-wit blocks by
Gregory Sanders.
2016-06-22 15:43:02 +02:00
Alex Morcos 4f7ff00497 [qa] Add rpc test for segwit
Amended by Pieter Wuille to use multisig 1-of-1 for P2WSH tests, and BIP9
based switchover logic.

Fixes and py3 conversion by Marco Falke.
2016-06-22 15:43:01 +02:00
Pieter Wuille 66cca79130 [qa] Autogeneration support for witness in script_tests 2016-06-22 15:43:01 +02:00
Pieter Wuille 06d3805c1a [qa] Add segwit support to script_tests
Contains fix by Johnson Lau.
2016-06-22 15:43:01 +02:00
NicolasDorier 00f46cbcd9 [qa] Add transaction tests for segwit
Including BIP143 P2WSH examples by jl2012.
2016-06-22 15:43:01 +02:00
Pieter Wuille 0aa9207451 [qa] Witness version 0 signing unit tests 2016-06-22 15:43:01 +02:00
NicolasDorier 745eb678ef [RPC] signrawtransaction can sign P2WSH 2016-06-22 15:43:01 +02:00
Pieter Wuille f4691ab3a9 [RPC] Add wallet support for witness transactions (using P2SH)
Includes support for pushkeyhash wit v0 by Alex Morcos.
2016-06-22 15:43:01 +02:00
Pieter Wuille 605e8473a7 BIP143: Signing logic 2016-06-22 15:43:01 +02:00
Pieter Wuille af87a67eff Do not use compact blocks when segwit is enabled 2016-06-22 15:43:00 +02:00
Pieter Wuille 6032f6930a Add rewind logic to deal with post-fork software updates
Includes logic for dealing with pruning by Suhas Daftuar.
2016-06-22 15:43:00 +02:00
Thomas Kerin b7dbeb24eb [libconsensus] Script verification API with amounts
script_tests: always test bitcoinconsensus_verify_script_with_amount if VERIFY_WITNESS isn't set

Rename internal method + make it static

trim bitcoinconsensus_ prefix

Add SERIALIZE_TRANSACTION_WITNESS flag
2016-06-22 15:43:00 +02:00
Pieter Wuille 2b1f6f9ccf BIP141: Other consensus critical limits, and BIP145
Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
2016-06-22 15:43:00 +02:00
Johnson Lau 7c4bf779e8 [RPC] Return witness data in blockchain RPCs
Includes RPC field name changes by Luke-jr.
2016-06-22 15:43:00 +02:00
Pieter Wuille 3dd410294d BIP143: Verification logic
Includes simplifications by Eric Lombrozo.
2016-06-22 15:43:00 +02:00
Pieter Wuille 0ef1dd3e11 Refactor script validation to observe amounts
This is a preparation for BIP143 support.
2016-06-22 15:43:00 +02:00
Pieter Wuille b8a97498df BIP144: Handshake and relay (receiver side)
Service bit logic by Nicolas Dorier.

Only download blocks from witness peers after fork.
2016-06-22 15:42:59 +02:00