Commit graph

5662 commits

Author SHA1 Message Date
Alex Morcos a9af415887 fix InvalidateBlock to repopulate setBlockIndexCandidates 2015-03-12 10:15:33 -04:00
Jonas Schnelli 50c72f23ad [Move Only] Move wallet related things to src/wallet/
could once be renamed from /src/wallet to /src/legacywallet.
2015-03-12 14:13:02 +01:00
Wladimir J. van der Laan dd4ffcec0e
Merge pull request #5859
9519a9a Add correct bool combiner for net signals (Pieter Wuille)
2015-03-12 11:14:03 +01:00
Wladimir J. van der Laan 92fd887fd4 tests: add a BasicTestingSetup and apply to all tests
Make sure that chainparams and logging is properly initialized. Doing
this for every test may be overkill, but this initialization is so
simple that that does not matter.

This should fix the travis issues.
2015-03-12 09:45:22 +01:00
Jonas Schnelli 89e70e931d [QT] fix OSX dock icon window reopening
fixes #5878
2015-03-12 00:16:23 +01:00
Wladimir J. van der Laan e564e63ef0
Merge pull request #5871
3aa0130 test: remove fSkipProofOfWork (Wladimir J. van der Laan)
59bd89f test: Remove UNITTEST params (Wladimir J. van der Laan)
2015-03-11 15:13:05 +01:00
dexX7 317e66c741
Initialization: set Boost path locale in main thread
The path locale is lazy initialized and to avoid deinitialization errors
in multithreading environments, it is set explicitly by the main thread.
2015-03-11 14:33:29 +01:00
Wladimir J. van der Laan d734d87b28
Merge pull request #5749
f754707 Fix - bitcoin-qt usage message (Luca Venturini)
1fdb9fa Help messages correctly formatted (79 chars) (Luca Venturini)
2015-03-11 10:20:59 +01:00
Wladimir J. van der Laan 45b7dc2c25
Merge pull request #5864
bb6acff fix possible block db breakage during re-index (Cory Fields)
2015-03-11 08:33:52 +01:00
Luca Venturini f75470794b Fix - bitcoin-qt usage message
. Closes the bug from commit e179eb3d9b
("bitcoin-qt -help" did not show any message)
. Move all the options in init.cpp (there were already some
options related to bitcoin-qt)
2015-03-10 22:07:17 -07:00
Luca Venturini 1fdb9fa3f9 Help messages correctly formatted (79 chars)
Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format works even if the translation of the strings
modifies the lenght of the message.

Sqashed 6 commits in a single one.
Help messages correctly formatted for SVGA text mode (132 chars)

Help messages are formatted programmatically with FormatParagraph
in order not to break existing strings in Transifex.

The new format should work even if the translation of the strings
modifies the lenght of the message.

Fix - syntax error

Correct formatting for 79 chars

Correctly based on C++ functions

Removed spare spaces from option strings

Fix - syntax error
2015-03-10 22:07:17 -07:00
Cory Fields bb6acff079 fix possible block db breakage during re-index
When re-indexing, there are a few cases where garbage data may be skipped in
the block files. In these cases, the indices are correctly written to the index
db, however the pointer to the next position for writing in the current block
file is calculated by adding the sizes of the valid blocks found.

As a result, when the re-index is finished, the index db is correct for all
existing blocks, but the next block will be written to an incorrect offset,
likely overwriting existing blocks.

Rather than using the sum of all valid blocks to determine the next write
position, use the end of the last block written to the file. Don't assume that
the current block is the last one in the file, since they may be read
out-of-order.
2015-03-10 13:59:46 -04:00
Wladimir J. van der Laan 3aa0130b96 test: remove fSkipProofOfWork
Not used, and REGTEST already allows creating blocks at
the lowerst possible difficulty.
2015-03-09 16:09:54 +01:00
Wladimir J. van der Laan 59bd89f116 test: Remove UNITTEST params
UNITTEST parameter are not used by any current tests, and the model
(modifyable parameters) is inconvenient when unit-testing. As
they are stored in a global structure eevery test
would have to (re)set up its own parameters.

For consistency it is also better to test with MAIN parameters.
2015-03-09 16:06:14 +01:00
Wladimir J. van der Laan 8cbe1f4f58
tests: change main and wallet tests to BOOST_FIXTURE_TEST_SUITE
Avoid this travis error:

    test_bitcoin: chainparams.cpp:330: const CChainParams& Params():
    Assertion `pCurrentParams' failed.
    unknown location(0): fatal error in "subsidy_limit_test": signal:
    SIGABRT (application abort requested)
    test/allocator_tests.cpp(116): last checkpoint
2015-03-09 15:04:59 +01:00
Wladimir J. van der Laan cdae53e456
Merge pull request #5852
51598b2 Reinitialize state in between individual unit tests. (Pieter Wuille)
2015-03-09 12:51:07 +01:00
Wladimir J. van der Laan c1b723c30a
Merge pull request #5442
dca799e Ignore getaddr messages on Outbound connections. (Ivan Pustogarov)
2015-03-09 12:24:53 +01:00
Philip Kaufmann 8517e9709e [Qt] rework setNumBlocks to have blockDate as parameter
- reduces some functional overhead and simplifies the code
2015-03-09 10:58:17 +01:00
Wladimir J. van der Laan 513e025239
Merge pull request #5858
9bbb880 [Qt] fix a issue where "command line options"-action overwrite "Preference"-action (on OSX) (Jonas Schnelli)
2015-03-09 10:45:12 +01:00
Wladimir J. van der Laan d26f0b263c
Merge pull request #5793
6cb4a52 [Qt, Linux] honor current network when creating autostart link (Philip Kaufmann)
9673c35 [Qt, Win] honor current network when creating autostart link (Philip Kaufmann)
2015-03-09 09:55:49 +01:00
Pieter Wuille 2f10aa0fa1
Merge pull request #5151
eec3713 make CMessageHeader a dumb storage class (Cory Fields)
2015-03-07 05:38:34 -08:00
Wladimir J. van der Laan a0ae79d775 Replace CBlockHeader::GetHash with call to SerializeHash
Removes variability between LE and BE.
As suggested by @sipa.
2015-03-06 17:21:59 +01:00
Wladimir J. van der Laan 62b30f09ac Add serialize float/double tests 2015-03-06 17:21:59 +01:00
Wladimir J. van der Laan 9f4fac98c4 src/txmempool.cpp: make numEntries a uint32_t
Don't ever serialize a size_t or long, their sizes are platform
dependent.
2015-03-06 17:21:59 +01:00
Wladimir J. van der Laan f4e6487219 src/arith_256.cpp: bigendian compatibility 2015-03-06 17:21:59 +01:00
Wladimir J. van der Laan aac3205375 src/netbase.h: Fix endian in CNetAddr serialization
We've chosen to htons/ntohs explicitly on reading and writing
(I do not know why). But as READWRITE already does an endian swap
on big endian, this means the port number gets switched around,
which was what we were trying to avoid in the first place. So
to make this compatible, serialize it as FLATDATA.
2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan 01f9c3449a src/serialize.h: base serialization level endianness neutrality
Serialization type-safety and endianness compatibility.
2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan 4e853aa163 src/script/script.h: endian compatibility for PUSHDATA sizes 2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan 4f92773f92 src/primitives/transaction.h: endian compatibility in serialization 2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan 81aeb28436 src/primitives/block.cpp: endian compatibility in GetHash 2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan dec84cae2a src/net.cpp: endian compatibility in EndMessage 2015-03-06 17:21:58 +01:00
Wladimir J. van der Laan 556814ec4e src/main.cpp: endian compatibility in packet checksum check 2015-03-06 17:21:55 +01:00
Luke Dashjr 721cb557aa GUI: Display label rather than address on popups 2015-03-06 15:07:43 +00:00
Wladimir J. van der Laan 3ca5852dc2 src/hash.cpp: endian compatibility 2015-03-06 15:54:53 +01:00
Wladimir J. van der Laan 4414f5ffe1 build: Endian compatibility
- Detect endian instead of stopping configure on big-endian
- Add `byteswap.h` and `endian.h` header for compatibility with
  Windows and other operating systems that don't come with them
- Update `crypto/common.h` functions to use compat
  endian header
2015-03-06 15:54:53 +01:00
Wladimir J. van der Laan 51377c2dbe
Merge pull request #5843
ba04c4a Limit message sizes before transfer (Pieter Wuille)
2015-03-06 15:31:31 +01:00
Wladimir J. van der Laan ee9f2bfa7b
Merge pull request #5813
34e5015 Add unit tests for next difficulty calculations (Ross Nicoll)
2015-03-06 15:27:00 +01:00
Pieter Wuille ba04c4a780 Limit message sizes before transfer
This introduces a fixed limit for the size of p2p messages, and enforces it
before download.
2015-03-06 04:03:17 -08:00
Pieter Wuille 9519a9a420 Add correct bool combiner for net signals 2015-03-06 03:45:26 -08:00
Jonas Schnelli 9bbb880be4 [Qt] fix a issue where "command line options"-action overwrite "Preference"-action (on OSX)
- fixes #5800
2015-03-06 09:33:23 +01:00
Rob Van Mieghem 84a05b843b
QT: remove unused parameter 2015-03-05 12:20:49 -05:00
Wladimir J. van der Laan 215475aa00
Merge pull request #5830
6f1274c qt: Don't save geometry for options and about/help window (Wladimir J. van der Laan)
2015-03-05 14:42:20 +01:00
Cozz Lovan 90a43c1e93 [Qt] Code-movement-only: Format confirmation message in sendcoinsdialog 2015-03-05 13:25:12 +01:00
Pieter Wuille 51598b2631 Reinitialize state in between individual unit tests.
This changes the TestingSetup fixture to be per-unit-test rather than global.
Most tests don't need it, so it's only invoked in a few.
2015-03-03 09:01:46 -08:00
Wladimir J. van der Laan 3dfcdf46c2
Merge pull request #5775
deda3e1 [Qt] remove unused getNumBlocksAtStartup() from ClientModel (Philip Kaufmann)
47ee8cf [Qt] use qint64 in BitcoinGUI::setNumBlocks (Philip Kaufmann)
2015-03-03 16:57:30 +01:00
Wladimir J. van der Laan f8e68f7bfb
Merge pull request #5819
d23b0a2 depends: always use static qt5 for linux (Cory Fields)
3448b13 build: fix typo in configure help (Cory Fields)
c95ac83 gitian: fix x86_64 build with static libstdc++ (Cory Fields)
0671516 build: change reduce exports/static libstdc++ options for gitian and travis (Cory Fields)
aa36730 build: remove libstdc++ backwards-compat (Cory Fields)
3ee028f build: disable reduced exports by default (Cory Fields)
2015-03-03 16:27:50 +01:00
Pieter Wuille 86eb461c5b
Merge pull request #5839
16a58a8 keys: remove libsecp256k1 verification until it's actually supported (Cory Fields)
2015-03-03 04:08:15 -08:00
Cory Fields 16a58a8644 keys: remove libsecp256k1 verification until it's actually supported
This was added a while ago for testing purposes, but was never intended to be
used. Remove it until upstream libsecp256k1 decides that verification is
stable/ready.
2015-03-02 11:31:43 -05:00
Pieter Wuille 10a3ff07f5
Merge pull request #5832
9abbeea Remove obsolete pubsub method definitions (Pieter Wuille)
2015-03-01 03:13:09 -08:00
Luke Dashjr e96028c78e GUI: Clarify terminology; use "Label" heading for labels row, and "Node/Service" rather than [IP] "Address" 2015-02-26 20:56:42 +00:00
Wladimir J. van der Laan db4a1d598c
Merge pull request #5694
25cf6f3 minor rework of SendMoney in rpcwallet (Philip Kaufmann)
2015-02-26 17:20:29 +01:00
Wladimir J. van der Laan 59310f1c02
Merge pull request #5820
85da07a Better fingerprinting protection for non-main-chain getdatas. (Pieter Wuille)
2015-02-26 17:13:13 +01:00
Pieter Wuille 9abbeeabd7 Remove obsolete pubsub method definitions 2015-02-26 05:30:59 -08:00
Wladimir J. van der Laan 482783b341
Merge pull request #5801
de5403f [GUI] Move fee dialog minimise button away from "Transaction Fee" (Michael Ford)
2015-02-26 11:26:32 +01:00
Wladimir J. van der Laan 6f1274c8c9
qt: Don't save geometry for options and about/help window
These dialogs will be something that people occasionally open, not keep
open during their session, so just popping it up in a sensible place
is good enough. Remembering only creates potential issues, like spawning
it outside the current screen area.

On Ubuntu this causes the dialogs to be positioned in the
middle of the main dialog, so I didn't add code for that. YMMV.

Inspired by github pull #5777 by @L-Cranston-Shadow
2015-02-26 10:23:42 +01:00
Cory Fields eec37136fd make CMessageHeader a dumb storage class
It shouldn't know or care about bitcoind's chain param selection
2015-02-25 18:44:49 -05:00
21E14 32eaf8a3de WIN32 Seed Cleanup: Move nLastPerfmon behind win32 ifdef.
Code to avoid calling Perfmon too often is only needed when perfmon is actually going to get called.
This is not intended to make any functional difference in the addition of entropy to the random pool.
2015-02-25 18:37:06 -05:00
Pieter Wuille 85da07a5a0 Better fingerprinting protection for non-main-chain getdatas.
With headers-first we can compare against the best header timestamp, rather
than using checkpoints which require code updates to maintain.
2015-02-24 04:35:13 -08:00
Cory Fields aa3673064c build: remove libstdc++ backwards-compat
Backwards-compatibility for libstdc++ is not limited to straightforward abi
changes. Symbol visibility also needs to be taken into consideration, and
that really can't be addressed simply.

Instead, just static-link libstdc++ for backwards-compat.
2015-02-23 17:56:15 -05:00
Ross Nicoll 34e5015cd2
Add unit tests for next difficulty calculations
Split GetNextWorkRequired() into two functions to allow the difficulty calculations to
be tested without requiring a full blockchain.
Add unit tests to cover basic difficulty calculation, plus each of the min/max actual
time, and maximum difficulty target conditions.
2015-02-21 13:14:19 +00:00
Michael Ford de5403f878 [GUI] Move fee dialog minimise button away from "Transaction Fee"
Its original placement was causing confusion among some users.
2015-02-21 09:11:33 +08:00
Wladimir J. van der Laan a026a56c4e
Merge #5706: fix crash: RPC \
e5d9d77 fix crash: createmultisig and addmultisigaddress (fsb4000)
2015-02-20 09:51:38 +01:00
Wladimir J. van der Laan 07f4386b38
Merge #5689: openssl: abstract out OPENSSL_cleanse
1630219 openssl: abstract out OPENSSL_cleanse (Cory Fields)
2015-02-19 12:09:26 +01:00
Philip Kaufmann 6cb4a52535 [Qt, Linux] honor current network when creating autostart link 2015-02-19 12:08:47 +01:00
Philip Kaufmann 9673c35daf [Qt, Win] honor current network when creating autostart link
- creates a "Bitcoin (testnet).lnk" when on testnet or a "Bitcoin
  (regtest).lnk, when on regtest
- fixes #5778
2015-02-19 12:06:49 +01:00
Wladimir J. van der Laan 47a79bb880
Merge #5366: No longer check osx compatibility in RenameThread
850c570 No longer check osx compatibility in RenameThread (Michael Ford)
2015-02-18 17:36:39 +01:00
Wladimir J. van der Laan 8d0418720c
Merge #5799: Rename Interval() to DifficultyAdjustmentInterval()
e5ece05 Rename Interval() to DifficultyAdjustmentInterval() (Shaul Kfir)
2015-02-18 17:29:28 +01:00
Wladimir J. van der Laan e3a3cd7a28
Merge #5784: Fix usage of NegateSignatureS in script_tests
78c6bed Add test for DER-encoding edge case (Suhas Daftuar)
6f50dbd Fix NegateSignatureS to not duplicate last byte of S (Suhas Daftuar)
2015-02-18 09:52:59 +01:00
Shaul Kfir e5ece053da Rename Interval() to DifficultyAdjustmentInterval() 2015-02-17 08:46:51 -05:00
Pieter Wuille 175d86e633
Merge #5710: Add more information to errors in ReadBlockFromDisk
f5791c6 Add more information to errors in ReadBlockFromDisk (Wladimir J. van der Laan)
2015-02-16 11:58:35 -08:00
Cory Fields 1630219d90 openssl: abstract out OPENSSL_cleanse
This makes it easier for us to replace it if desired, since it's now only in
one spot. Also, it avoids the openssl include from allocators.h, which
essentially forced openssl to be included from every compilation unit.
2015-02-15 11:34:02 -05:00
Suhas Daftuar 78c6bedb9c Add test for DER-encoding edge case
The fix to NegateSignatureS caused a test which had been failing
in IsValidSignatureEncoding to then fail in IsLowDERSignature.
Add new test so the original check remains exercised.
2015-02-10 13:25:41 -05:00
Suhas Daftuar 6f50dbd2fd Fix NegateSignatureS to not duplicate last byte of S
NegateSignatureS is called with a signature without a hashtype, so
do not save the last byte and append it after S negation.

Updates the two tests which were affected by this bug.
2015-02-10 13:23:57 -05:00
Wladimir J. van der Laan d48ce48093
Merge #5548: [REST] add /rest/chaininfos
2c0f901 [REST] rest/chaininfos add documentation (Jonas Schnelli)
59582c8 [REST] add /rest/chaininfos (Jonas Schnelli)
2015-02-10 12:08:07 +01:00
Wladimir J. van der Laan a9565863e0
Merge #5629: [Qt] prevent amount overflow problem with payment requests
a651668 [Qt] prevent amount overflow problem with payment requests (Philip Kaufmann)
2015-02-09 13:50:56 +01:00
Wladimir J. van der Laan 183ca292bd
Merge #5699: Split logic to undo txin's off DisconnectBlock.
eb1c2cd Split logic to undo txin's off DisconnectBlock. (Daniel Kraft)
2015-02-09 13:22:35 +01:00
Wladimir J. van der Laan beff11a3a1
Merge #5679: Get rid of DetectShutdownThread
28ee7e8 Get rid of DetectShutdownThread (Wladimir J. van der Laan)
2015-02-09 12:57:09 +01:00
Wladimir J. van der Laan 7225577f6b
Merge pull request #5739
f4b2078 Replace difficulty readjustment blocks with Interval() (Shaul Kfir)
2015-02-09 12:48:38 +01:00
Wladimir J. van der Laan 0f44672437
Merge pull request #5753
d67a642 [Qt] add bitcoin logo to about screen (Jonas Schnelli)
2015-02-09 11:34:01 +01:00
Philip Kaufmann deda3e156d [Qt] remove unused getNumBlocksAtStartup() from ClientModel 2015-02-09 11:28:03 +01:00
Philip Kaufmann 47ee8cf091 [Qt] use qint64 in BitcoinGUI::setNumBlocks
- as QDateTime.secsTo() returns a qint64 also store in a qint64 and not in
  an integer
2015-02-09 11:21:26 +01:00
Gregory Maxwell 28d4cff0ed Sanitize command strings before logging them.
Normally bitcoin core does not display any network originated strings without
 sanitizing or hex encoding.  This wasn't done for strcommand in many places.

This could be used to play havoc with a terminal displaying the logs,
 especially with printtoconsole in use.

Thanks to Evil-Knievel for reporting this issue.
2015-02-08 19:58:59 +00:00
Ivan Pustogarov dca799e1db Ignore getaddr messages on Outbound connections.
The only time when a client sends a "getaddr" message is when he
esatblishes an Outbound connection (see ProcessMessage() in
src/main.cpp).  Another bitcoin client is expected to receive a
"getaddr" message only on Inbound connection. Ignoring "gettaddr"
requests on Outbound connections can resolve potential privacy issues
(and as was said such request normally do not happen anyway).
2015-02-06 22:03:42 +01:00
Wladimir J. van der Laan fb6140b54b
Merge pull request #5721
cf008ac Acquire CCheckQueue's lock to avoid race condition (Suhas Daftuar)
2015-02-06 16:51:39 +01:00
Wladimir J. van der Laan f5791c6ae3 Add more information to errors in ReadBlockFromDisk
A lot of times, disk corruption problems appear here.
To facilitate debugging and troubleshooting, add position information
to the error messages.
2015-02-05 14:21:25 +01:00
Jonas Schnelli d67a642392 [Qt] add bitcoin logo to about screen 2015-02-04 20:52:18 +01:00
Jonas Schnelli 17115d0a34 fix getblocktemplate lock issue
getblocktemplate didn't have a wallet lock before #5711 and IMO there is no need for LEAVE/ENTER critical section.
2015-02-04 16:34:34 +01:00
Philip Kaufmann 25cf6f3d41 minor rework of SendMoney in rpcwallet
- rework the function to not log errors but use throw JSONRPCError
- remove a check for IsLocked() that is done in sendtoaddress and
  sendfrom RPC calls already
- cache GetBalance() return value, because it's possibly used twice
2015-02-04 15:11:54 +01:00
Wladimir J. van der Laan 93b7544501
Merge pull request #5319
35f7227 Clean up wallet encryption code. (Daniel Kraft)
2015-02-04 13:56:57 +01:00
Philip Kaufmann a6516686dc [Qt] prevent amount overflow problem with payment requests
Bitcoin amounts are stored as uint64 in the protobuf messages (see
paymentrequest.proto), but CAmount is defined as int64_t. Because
of that we need to verify that single and accumulated amounts are
in a valid range and no variable overflow has happened.

- fixes #5624 (#5622)

Thanks @SergioDemianLerner for reporting that issue and also supplying us
with a possible solution.

- add static verifyAmount() function to PaymentServer and move the logging
  on error into the function
- also add a unit test to paymentservertests.cpp
2015-02-04 13:47:32 +01:00
Wladimir J. van der Laan 31dedb463b
Merge pull request #5509
7f991e3 c++11: These look like user-defined literals. (Cory Fields)
5a6155c c++11: don't forward-declare types used in maps (Cory Fields)
3447cf8 c++11: MOVEONLY: break circular dependency in wallet (Cory Fields)
bbacd88 c++11: MOVEONLY: move function definitions out of the header (Cory Fields)
a2b04dd build: fix newer boost build with c++11 (Cory Fields)
2015-02-04 13:06:16 +01:00
Wladimir J. van der Laan 87ecfb0f96
Merge pull request #5711
5ebe095 Trim RPC command table (Wladimir J. van der Laan)
4401b2d Removed main.h dependency from rpcserver.cpp (Eric Lombrozo)
2015-02-04 10:23:09 +01:00
Cory Fields 7f991e364e c++11: These look like user-defined literals.
Add a space to keep the compiler happy
2015-02-03 23:31:00 -05:00
Cory Fields 5a6155ccfa c++11: don't forward-declare types used in maps 2015-02-03 23:30:59 -05:00
Cory Fields 3447cf87e2 c++11: MOVEONLY: break circular dependency in wallet
c++11 (libc++'s stdlib implementation anyway) doesn't allow for map types to be
forward-declared. for example:

class foo;
std::map<int, foo> bar; // error, foo has not been defined.
class foo{};

Since CWallet and CWalletTx are inter-dependent, but only std::map<*,CWalletTx>
is used, forward-declare CWallet instead and define CWalletTx first.

Despite the mangled git diff, this change only amounts to moving ~320 lines in
a single chunk.
2015-02-03 23:30:59 -05:00
Cory Fields bbacd88204 c++11: MOVEONLY: move function definitions out of the header
These need to be moved out of the header in order to resolve a circular
dependency between CWallet and CTxWallet. See next commit.
2015-02-03 22:41:33 -05:00
Cory Fields a2b04ddfe6 build: fix newer boost build with c++11 2015-02-03 22:41:01 -05:00
Daniel Kraft eb1c2cd37f Split logic to undo txin's off DisconnectBlock.
Instead, create a separate function that applies the undo operation of a
CTxInUndo object onto a CCoinsViewCache.  This method is used from
DisconnectBlock.
2015-02-03 15:44:39 +01:00
Suhas Daftuar cf008ac8c3 Acquire CCheckQueue's lock to avoid race condition
This fixes a potential race condition in the CCheckQueueControl constructor,
which was looking directly at data in CCheckQueue without acquiring its lock.

Remove the now-unnecessary friendship for CCheckQueueControl
2015-02-03 08:53:08 -05:00
Wladimir J. van der Laan fcf646c9b0
Merge pull request #5286
44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon)
a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
2015-02-03 13:12:44 +01:00
Wladimir J. van der Laan e5f1f5a263
Merge pull request #5732
1371e6f Change "insane" to "absurd" (referring to high fees) in text strings and identifiers. (Daira Hopwood)
2015-02-03 13:12:12 +01:00
Wladimir J. van der Laan 6ee87f9bc5
Merge pull request #5647
3ff735c Increase block download timeout base from 10 to 20 minutes. (Gregory Maxwell)
2015-02-03 10:36:44 +01:00
Wladimir J. van der Laan 4e2b1fff98
Merge pull request #5675
2d9b0b7 Fix priority calculation in CreateTransaction (Alex Morcos)
2015-02-03 10:36:01 +01:00
Wladimir J. van der Laan 41e6e4caba
Merge pull request #5713
bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille)
819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille)
5a47811 BIP66 changeover logic (Pieter Wuille)
092e9fe Example unit tests from BIP66 (Pieter Wuille)
80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
2015-02-03 10:34:53 +01:00
Wladimir J. van der Laan 9c4a5a5067
Merge pull request #5729
fdf80ea [Qt] allow unit changes for read-only BitcoinAmountField (Philip Kaufmann)
2015-02-03 09:49:26 +01:00
Pieter Wuille 9fddceda44 Avoid storing a reference passed to SignatureChecker constructors 2015-02-02 20:19:46 -08:00
Pieter Wuille 858809a33e Use separate SignatureChecker for CMutableTransaction 2015-02-02 20:19:12 -08:00
Shaul Kfir f4b2078f72 Replace difficulty readjustment blocks with Interval() 2015-02-02 14:36:00 -05:00
Pieter Wuille bf6cdebdc5 Increase coverage of DERSIG edge cases 2015-02-01 17:51:25 -04:00
Pieter Wuille 5a47811da5 BIP66 changeover logic 2015-02-01 17:51:24 -04:00
Pieter Wuille 092e9fe5fb Example unit tests from BIP66 2015-02-01 17:47:21 -04:00
Pieter Wuille 80ad135a5e Change IsDERSignature to BIP66 implementation 2015-02-01 17:47:21 -04:00
Daira Hopwood 1371e6f5db Change "insane" to "absurd" (referring to high fees) in text strings and identifiers.
Note that this will also require translation changes in Transifex for the key
"A fee higher than %1 is considered an insanely high fee." which is now
"A fee higher than %1 is considered an absurdly high fee."

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2015-01-31 23:23:20 +00:00
bikinibabe ee932025c1 Changed pronouns for correctness and inclusivity 2015-01-31 17:38:28 -05:00
Vitalii Demianets bd2b73bb9b TRIVIAL: fix misleading comment 2015-01-31 17:38:28 -05:00
Pavel Janík 5262fde0ec Remove whitespaces before double colon in errors and logs 2015-01-31 17:38:28 -05:00
Pavel Janík 91a9fe094b Fix typo - sentence starts with capital letter 2015-01-31 17:37:01 -05:00
Manuel Araoz d6bed1514c remove sig_canonical.json and sig_noncanonical.json 2015-01-31 17:36:44 -05:00
Philip Kaufmann fdf80ea7b1 [Qt] allow unit changes for read-only BitcoinAmountField
- fixes #5725
2015-01-31 17:39:22 +01:00
Wladimir J. van der Laan 6af674ecdc
Merge pull request #5707
14d023f change hardcoded character constants to a set of descriptive named constants for database keys (Earlz)
2015-01-31 14:31:12 +01:00
randy-waterhouse 72ac792b4a Format build flags in src/Makefile.am. 2015-01-30 10:43:30 +13:00
Wladimir J. van der Laan 5f04d1d0d7
Merge pull request #5477
6bbca99 LSSharedFileListItemResolve() was deprecated in Mac OS X 10.10, use LSSharedFileListItemCopyResolvedURL() instead (Cory Fields)
2015-01-29 13:27:23 +01:00
Wladimir J. van der Laan 7823598fa4
Merge pull request #5620
6715efb [Qt] Payment request expiration bug fix (re-done) (Philip Kaufmann)
2015-01-29 12:48:27 +01:00
fsb4000 55eade9d46 Change Coin Control first column label 2015-01-29 15:07:08 +06:00
Wladimir J. van der Laan 5ebe0956b3 Trim RPC command table
- invalidateblock and reconsiderblock were defined doubly
- remove no-longer-used threadSafe, as locks have been pushed down
2015-01-28 07:41:54 +01:00
Eric Lombrozo 4401b2d7c5 Removed main.h dependency from rpcserver.cpp
Rebased by @laanwj:

- update for RPC methods added since 84d13ee: setmocktime,
  invalidateblock, reconsiderblock. Only the first, setmocktime, required a change,
  the other two are thread safe.
2015-01-28 07:41:54 +01:00
Wladimir J. van der Laan 6b5f5294bb
Merge pull request #5506
7873633 Squashed 'src/secp256k1/' changes from bccaf86..50cc6ab (Pieter Wuille)
1a9576d Use libsecp256k1's RFC6979 implementation (Pieter Wuille)
2015-01-26 13:04:29 +01:00
Wladimir J. van der Laan 2511a39cca
Merge pull request #5575
7b782f5 RPCWallet: Notate all account stuff as deprecated (Luke Dashjr)
2015-01-26 12:38:22 +01:00
Wladimir J. van der Laan ab0d7987c0
Merge pull request #5626
652eb90 [Qt] change transaction table column width (Jonas Schnelli)
af95b17 [Qt] resize oversized icons (Jonas Schnelli)
2015-01-26 12:36:41 +01:00
Wladimir J. van der Laan ca7880358c
Merge pull request #5628
785bb81 [Qt] remove size grip to get rid of the right margin (Jonas Schnelli)
2015-01-26 12:35:32 +01:00
Wladimir J. van der Laan 2fae1875ea
Merge pull request #5243
ff09e31 sleep-wait on genesis block during init with -reindex (Matt Corallo)
2015-01-26 12:29:15 +01:00
Wladimir J. van der Laan 8204e19abe
Merge pull request #4805
44bc988 [Wallet] Do not flush the wallet in AddToWalletIfInvolvingMe(..) (Cozz Lovan)
2015-01-26 12:19:12 +01:00
Wladimir J. van der Laan b01a435c34
Merge pull request #5627
2fa9a8e Make empty byte arrays pass CheckSignatureEncoding() (Peter Todd)
2015-01-26 12:09:11 +01:00
Earlz 14d023f1ae change hardcoded character constants to a set of descriptive named constants for database keys 2015-01-25 10:56:30 -05:00
fsb4000 e5d9d77df2 fix crash: createmultisig and addmultisigaddress 2015-01-25 18:11:57 +06:00
Wladimir J. van der Laan 40e96a3016
Merge pull request #5599
0cc0d8d Get rid of the internal miner's hashmeter (jtimon)
2015-01-24 16:00:40 +01:00
fsb4000 0eade74c78 fix crash: CoinControl "space" bug
Just like baf80c26a2
2015-01-23 20:01:07 +06:00
Cory Fields 6bbca99baa LSSharedFileListItemResolve() was deprecated in Mac OS X 10.10, use LSSharedFileListItemCopyResolvedURL() instead 2015-01-21 19:07:28 +01:00
Wladimir J. van der Laan 66b473457b
Delete RecvLine function
No longer necessary since #5161 / 845c86d128.
2015-01-20 18:03:20 +01:00
Wladimir J. van der Laan 7810a0a1e6
Merge pull request #5648
2ce63d3 MOVEONLY: Move struct CBlockTemplate to miner.h (from main.h) (Luke Dashjr)
2015-01-20 17:34:43 +01:00
Wladimir J. van der Laan 848f55d52f
Merge pull request #5651
1d84aea Coin Control: Use U+2248 "ALMOST EQUAL TO" rather than a simple tilde (which may be mistaken for a negative sign) (Luke Dashjr)
2015-01-20 16:28:10 +01:00
Wladimir J. van der Laan 28ee7e8b8c Get rid of DetectShutdownThread
The main thread spends time waiting for the DetectShutdownThread.
So why not just run this waiting loop function in the main thread?

One thread-stack less saves 4MB of virtual memory on 32-bit, and 8MB on
64-bit.
2015-01-19 15:37:48 +01:00
Wladimir J. van der Laan e1aecae33a
Merge pull request #5671
73cd4ed qt: avoid hard-coding font names (Cory Fields)
52954e6 qt: fix broken unicode chars on osx 10.10 (Cory Fields)
f5ad78b qt: fonts: allow SubstituteFonts to filter based on user's language (Cory Fields)
2015-01-19 12:31:54 +01:00
Cory Fields 73cd4edb4f qt: avoid hard-coding font names
They may not contain all necessary characters for a language
2015-01-17 03:31:27 -05:00
Cory Fields 52954e6efd qt: fix broken unicode chars on osx 10.10
The default font changed again.

The real fix is to compile qt against a >= 10.8 sdk, but this is simple enough
to backport to 0.10 to avoid having to do that there.

Note: NSAppKitVersionNumber is a double and there's no official value for
NSAppKitVersionNumber10_10. Since == isn't reliable for doubles, use Apple's
guidelines for testing versions here:
https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/

Chinese and Japanese fonts have been hard-coded as well, otherwise they fail to
show up at all.
2015-01-17 03:31:27 -05:00
Cory Fields f5ad78b34a qt: fonts: allow SubstituteFonts to filter based on user's language
SubstituteFonts() has been moved to after app identification so that QSettings
are accessible.
2015-01-16 16:11:01 -05:00
Alex Morcos 2d9b0b7f03 Fix priority calculation in CreateTransaction
Make this projection of priority in 1 block match the calculation in the low priority reject code.
2015-01-16 12:17:57 -05:00
Gregory Maxwell 7d2cb48511 Restore RPC HTTP keepalives to default.
This avoids a regression for issues like #334 where high speed
 repeated connections eventually run the HTTP client out of
 sockets because all of theirs end up in time_wait.

Maybe the trade-off here is suboptimal, but if both choices will
 fail then we prefer fewer changes until the root cause is solved.
2015-01-16 05:59:36 -08:00
Wladimir J. van der Laan 9fe53a85e0
Merge pull request #5632
98c222b [Qt] optimize helpmessage dialog (Jonas Schnelli)
2015-01-16 11:53:45 +01:00
Jonas Schnelli 652eb904df [Qt] change transaction table column width
make enought space for the new icons
2015-01-16 11:47:41 +01:00
Jonas Schnelli af95b17d0d [Qt] resize oversized icons 2015-01-16 11:47:41 +01:00
Wladimir J. van der Laan a353ad4cdb
Merge pull request #5636
851296a [Qt] add option to allow self signed root certs (for testing) (Philip Kaufmann)
2015-01-16 11:19:07 +01:00
Wladimir J. van der Laan c29568a686
Merge pull request #5666
0c03a93 [Qt] add debug logging for -rootcertificates option (Philip Kaufmann)
2015-01-16 10:53:31 +01:00
Philip Kaufmann 0c03a93e70 [Qt] add debug logging for -rootcertificates option
- now logs if -rootcertificates="" was used to disable payment request
  authentication via X.509 certificates
- also logs which file is used as trusted root cert, if -rootcertificates
  is set
2015-01-15 14:30:44 +01:00
Wladimir J. van der Laan 9ca6e04790
Merge pull request #5655
1dd8ee7 improve tests for #5655 (Jonas Schnelli)
56c1093 fix tests for #5655 (Wladimir J. van der Laan)
16a5c18 Add a -rpckeepalive and disable RPC use of HTTP persistent connections. (Gregory Maxwell)
2015-01-15 09:27:21 +01:00
Philip Kaufmann 6715efb9ca [Qt] Payment request expiration bug fix (re-done)
- this is based on #4122 (which can be closed)

Currently a payment request is only checked for expiration upon receipt.
It should be checked again immediately before sending coins to prevent
the user from paying to an expired invoice which would then require a
customer service interaction.

- add static verifyExpired() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
- extend unit tests to use that function and also add an unit test which
  overflows, because payment requests allow expires as uint64, whereas we
  use int64_t for verification of expired payment requests
2015-01-15 09:08:22 +01:00
Gregory Maxwell 16a5c18cea Add a -rpckeepalive and disable RPC use of HTTP persistent connections.
It turns out that some miners have been staying with old versions of
 Bitcoin Core because their software  behaves poorly with persistent
 connections and the Bitcoin Core thread and connection limits.

What happens is that underlying  HTTP libraries leave connections open
 invisibly to their users and then the user runs into the default four
 thread limit.  This looks like Bitcoin Core is unresponsive to RPC.

There are many things that should be improved in Bitcoin Core's behavior
 here, e.g. supporting more concurrent connections, not tying up threads
 for idle connections, disconnecting kept-alive  connections when limits
 are reached, etc. All are fairly big, risky changes.

Disabling keep-alive is a simple workaround. It's often not easy to turn
 off the keep-alive support in the client where it may be buried in some
 platform library.

If you are one of the few who really needs persistent connections you
 probably know that you want them and can find a switch; while if you
 don't and the misbehavior is hitting you it is hard to discover the
 source of your problems is keepalive related.  Given that it is best
 to default to off until they're handled better.
2015-01-14 09:49:57 -08:00
Wladimir J. van der Laan e0cd2f5523
Merge pull request #5649
301cd2a Use text-color icons for system tray Send/Receive menu entries (Luke Dashjr)
2015-01-14 18:11:11 +01:00
Luke Dashjr 301cd2a3a9 Use text-color icons for system tray Send/Receive menu entries 2015-01-14 17:01:00 +00:00
Wladimir J. van der Laan d1aa3c67f0
Merge pull request #5489
905711f contrib: improve optimize-pngs.py (Wladimir J. van der Laan)
42f6a0c [Qt] optimize PNG files (Jonas Schnelli)
2015-01-14 17:22:37 +01:00
Jonas Schnelli 42f6a0c2b9 [Qt] optimize PNG files
- provide a python script
- add optimized png files
2015-01-14 17:18:48 +01:00
Wladimir J. van der Laan eec81cbb80
Merge pull request #5637
80dd50c [Qt] group variables below initial if-clauses in AmountSpinBox::stepEnabled (Philip Kaufmann)
0fd9e2b [Qt] don't allow amount changes when AmountSpinBox is read-only (Philip Kaufmann)
2015-01-14 16:54:28 +01:00
Philip Kaufmann 17005bc0fc [Qt] add payment request unit test for non matching networks
- verify that payment request network matches client network
- add static verifyNetwork() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
2015-01-14 13:15:26 +01:00
Philip Kaufmann 080da96c7c [Qt] prepare paymentservertests for new unit tests
- add a second PaymentRequest Test CA certificate to paymentrequestdata.h
  (serial number f0:da:97:e4:38:d7:64:16) as caCert2_BASE64
- rename existing Test CA certificate to caCert1_BASE64
- rename existing payment request data to know they belong to
  caCert1_BASE64
- update comments to reflect the changes and add a missing comment to one
  of the payment requests
2015-01-13 15:46:27 +01:00
Philip Kaufmann 80dd50ccba [Qt] group variables below initial if-clauses in AmountSpinBox::stepEnabled 2015-01-13 11:51:45 +01:00
Wladimir J. van der Laan c5380a9045
Merge pull request #5144
b468e81 Qt: Clarify sign/verify dialog text to specifically state that these messages only prove one receives with the address in question, and makes no claim to sender of transactions (Luke Dashjr)
2015-01-13 10:02:35 +01:00
Jonas Schnelli 785bb81c6b [Qt] remove size grip to get rid of the right margin
IMO nobody needs a size grip and it looks bad
2015-01-13 08:38:57 +01:00
Luke Dashjr 1d84aead21 Coin Control: Use U+2248 "ALMOST EQUAL TO" rather than a simple tilde (which may be mistaken for a negative sign) 2015-01-12 22:26:29 +00:00
Gregory Maxwell 3ff735c99a Increase block download timeout base from 10 to 20 minutes.
This harmonizes the block fetch timeout with the existing ping timeout
 and eliminates a guaranteed eventual failure from congestion collapse
 for a network operating right at its limit.

It's unlikely that we wouldn't suffer other failures if we were really
 anywhere near the network's limit, and a complete avoidance of congestion
 collapse risk requires (I think) an exponential back-off. So this isn't
 a major concern, but I think it's also useful for reducing the complexity
 of understanding out timeouts.
2015-01-12 11:58:17 -08:00
Luke Dashjr 2ce63d395f MOVEONLY: Move struct CBlockTemplate to miner.h (from main.h) 2015-01-12 20:47:44 +01:00
Wladimir J. van der Laan 868da0f40a
Merge pull request #5619
13cdce4 Catch UTXO set read errors and shutdown (Pieter Wuille)
2015-01-12 11:26:41 +01:00
Wladimir J. van der Laan de8b9ab757
Merge pull request #5608
9161303 Introduce 10 minute block download timeout (Pieter Wuille)
2015-01-12 11:24:47 +01:00
Wladimir J. van der Laan c6b7b29f23 Improve robustness of DER recoding code
Add some defensive programming on top of #5634.

This copies the respective OpenSSL code in ECDSA_verify in
OpenSSL pre-1.0.1k (e.g. https://github.com/openssl/openssl/blob/OpenSSL_1_0_1j/crypto/ecdsa/ecs_vrf.c#L89)
more closely.

As reported by @sergiodemianlerner.
2015-01-12 08:59:03 +01:00
Philip Kaufmann 851296a72f [Qt] add option to allow self signed root certs (for testing)
- it is helpful to be able to test and verify payment request processing
  by allowing self signed root certificates (e.g. generated by Gavins
  "certificate authority in a box")
- This option is just shown in the UI options, if -help-debug is enabled.
2015-01-11 19:16:57 +01:00
Philip Kaufmann 0fd9e2bf43 [Qt] don't allow amount changes when AmountSpinBox is read-only
- before it was possible to use the steps to change e.g. amouns of
  authenticated or unauthenticated payment requests (AmountSpinBox is
  already set to read-only here) - this is now fixed
- also move the reimplemented stepEnabled() function to the
  protected section of our class, where it belongs (see Qt doc)
2015-01-10 15:02:12 +01:00
Cory Fields 8dccba6a45 fail immediately on an empty signature 2015-01-09 22:06:55 -05:00
Cory Fields 488ed32f2a consensus: guard against openssl's new strict DER checks
New versions of OpenSSL will reject non-canonical DER signatures. However,
it'll happily decode them. Decode then re-encode before verification in order
to ensure that it is properly consumed.
2015-01-09 21:31:31 -05:00
Jonas Schnelli 98c222b5aa [Qt] optimize helpmessage dialog
- enlarge standard size
- remove fixed 10px font
- remove left mood image
- ensure that table has no ugly line-breaks on OSX, Linux
2015-01-09 21:11:47 +01:00
Peter Todd 2fa9a8ec86
Make empty byte arrays pass CheckSignatureEncoding()
Makes it possible to compactly provide a delibrately invalid signature
for use with CHECK(MULTI)SIG. For instance with BIP19 if m != n invalid
signatures need to be provided in the scriptSig; prior to this change
those invalid signatures would need to be large DER-encoded signatures.

Note that we may want to further expand on this change in the future by
saying that only OP_0 is a "valid" invalid signature; BIP19 even with
this change is inherently malleable as the invalid signatures can be any
validly encoded DER signature.
2015-01-09 06:03:22 -05:00
Pieter Wuille 13cdce4336 Catch UTXO set read errors and shutdown 2015-01-08 15:51:15 +01:00
Wladimir J. van der Laan c6a5ad4819
Fix tests after #5413
Pull #5413 was not rebased after deterministic signing was merged
(#5227), so the testcases had to be regenerated using UPDATE_JSON_TESTS.
2015-01-08 12:53:05 +01:00
Wladimir J. van der Laan c8183bf8ea
Merge pull request #5589
23f3435 Rename MAX_TX_SIGOPS to MAX_STANDARD_TX_SIGOPS to match similar policy constant MAX_STANDARD_TX_SIZE (Luke Dashjr)
2015-01-08 12:38:10 +01:00
Wladimir J. van der Laan c5e0aef5c4
Merge pull request #5604
d58c5d6 tests: run sanity checks in tests too (Cory Fields)
2015-01-08 12:07:06 +01:00
Wladimir J. van der Laan 48e1765e27
Merge pull request #5143
da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille)
b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille)
ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
2015-01-08 12:01:22 +01:00
Wladimir J. van der Laan 83be8fda6d
Merge pull request #5559
e179eb3 Make the command-line-args dialog better (Thomas Zander)
2015-01-08 10:04:15 +01:00
Wladimir J. van der Laan 204d41a821
Merge pull request #5542
2ecd294 Bugfix: configure: Correctly detect "nothing to build" condition (Luke Dashjr)
b7a4ecc Bugfix: Only check for boost when building code that requires it (Luke Dashjr)
a19eeac Bugfix: configure: Check for openssl/ec.h (Luke Dashjr)
fe925e2 Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code (Cory Fields)
2015-01-08 09:32:36 +01:00
Pieter Wuille 916130348c Introduce 10 minute block download timeout
This will disconnect peers that do not transfer a block in 10 minutes, plus
5 minutes for every previously queued block with validated headers
(accomodating downstream bandwidth down to a few kilobytes per second - below
that the node would have trouble staying synchronized anyway).
2015-01-07 17:09:24 +01:00
Wladimir J. van der Laan 8e4578af0f
Merge pull request #5521
0ea28ba Reject non-final txs even in testnet/regtest (Peter Todd)
2015-01-07 16:27:33 +01:00
Wladimir J. van der Laan 37b185c4af
Merge pull request #5611
f0b8afc tests: fix spurious windows test failures after 012598880c (Cory Fields)
2015-01-07 15:02:52 +01:00
Wladimir J. van der Laan 7625f7ff94
Merge pull request #5597
e413457 Catch LevelDB errors during flush (Pieter Wuille)
02bced1 Bugfix: only track UTXO modification after lookup (Pieter Wuille)
2015-01-07 13:03:41 +01:00
Wladimir J. van der Laan d79adc1ab1
Merge pull request #5535
1c52aad Require sufficent priority for relay of free transactions (Pieter Wuille)
2015-01-07 13:01:56 +01:00
Cory Fields f0b8afc88b tests: fix spurious windows test failures after 012598880c
on rare occasions, rand() was returning duped values, causing duplicate
transactions.

BuildMerkleTree happily used these, but CPartialMerkleTree caught them and
returned a null merkle root.

Rather than taking changes with rand(), use the loop counter to guarantee
unique values.

At sipa's request, also remove the remaining uses of rand().
2015-01-06 20:18:12 -05:00
Cory Fields fe925e221f Use EXTRA_LIBRARIES instead of noinst_LIBRARIES so we can avoid building unused code 2015-01-06 20:00:25 +00:00
Wladimir J. van der Laan 729ba31749
Merge pull request #5513
856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields)
9b1ab86 namespace: drop boost::assign altogether here (Cory Fields)
a324199 namespace: remove boost namespace pollution (Cory Fields)
2015-01-06 20:32:45 +01:00
Wladimir J. van der Laan 3b95808428
Merge pull request #5520
bdb6a71 IsNull doesn't change CBlockLocator, add const hint (Pavel Janík)
1b37333 Remove no longer needed declaration of CBlockLocator (Pavel Janík)
2015-01-06 20:01:00 +01:00
Wladimir J. van der Laan de70dd4904
Merge pull request #5598
eb0d34b Remove unused chainparam networkID (jtimon)
2015-01-06 18:12:58 +01:00
Wladimir J. van der Laan a89b8371d6
Merge pull request #5564
de236f5 clarify obscure uses of EvalScript() (Pavel Vasin)
2015-01-06 11:51:18 +01:00
Wladimir J. van der Laan 7b879d3493
Merge pull request #5532
be22b3d Update seed IPs, based on bitcoin.sipa.be crawler data (Pieter Wuille)
2015-01-06 11:00:02 +01:00
Cory Fields d58c5d6f21 tests: run sanity checks in tests too
If these are going to fail in bitcoind, they should fail in the tests as well.
2015-01-05 22:34:47 -05:00
Pieter Wuille 7268f7b120 Move arith_uint256 out of consensus and util 2015-01-06 00:42:27 +01:00
Pieter Wuille 7873633b57 Squashed 'src/secp256k1/' changes from bccaf86..50cc6ab
50cc6ab Merge pull request #178
941e221 Add tests for handling of the nonce function in signing.
10c81ff Merge pull request #177
7688e34 Add magnitude limits to secp256k1_fe_verify to ensure that it's own tests function correctly.
4ee4f7a Merge pull request #176
70ae0d2 Use secp256k1_fe_equal_var in secp256k1_fe_sqrt_var.
7767b4d Merge pull request #175
9ab9335 Add a reference consistency test to ge_tests.
60571c6 Rework group tests
d26e26f Avoid constructing an invalid signature with probability 1:2^256.
b450c34 Merge pull request #163
d57cae9 Merge pull request #154
49ee0db Add _normalizes_to_zero_var variant
eed599d Add _fe_normalizes_to_zero method
d7174ed Weak normalization for secp256k1_fe_equal
0295f0a weak normalization
bbd5ba7 Use rfc6979 as default nonce generation function
b37fbc2 Implement SHA256 / HMAC-SHA256 / RFC6979.
c6e7f4e [API BREAK] Use a nonce-generation function instead of a nonce
cf0c48b Merge pull request #169
603c33b Make signing fail if a too small buffer is passed.
6d16606 Merge pull request #168
7277fd7 Remove GMP field implementation
e99c4c4 Merge pull request #123
13278f6 Add explanation about how inversion can be avoided
ce7eb6f Optimize verification: avoid field inverse
a098f78 Merge pull request #160
38acd01 Merge pull request #165
6a59012 Make git ignore bench_recover when configured with benchmark enabled
1ba4a60 Configure options reorganization
3c0f246 Merge pull request #157
808dd9b Merge pull request #156
8dc75e9 Merge pull request #158
28ade27 build: nuke bashisms
5190079 build: use subdir-objects for automake
8336040 build: disable benchmark by default

git-subtree-dir: src/secp256k1
git-subtree-split: 50cc6ab0625efda6dddf1dc86c1e2671f069b0d8
2015-01-06 00:28:47 +01:00
Pieter Wuille 602ebf5279 Update libsecp256k1 2015-01-06 00:28:47 +01:00
Pieter Wuille 1a9576de9d Use libsecp256k1's RFC6979 implementation 2015-01-06 00:28:44 +01:00
Thomas Zander e179eb3d9b Make the command-line-args dialog better
Instead of using a fixed-width font in a label, which virtually
guarentees a horizontal scrollbar, use a proper text-document
that can re-layout based on user input.
2015-01-05 21:17:45 +01:00
Pieter Wuille be22b3da1d Update seed IPs, based on bitcoin.sipa.be crawler data 2015-01-05 17:23:23 +01:00
Wladimir J. van der Laan 6bd0dc2a84 arith_uint256: remove initialization from byte vector
Remove initialization from vector (as this is only used in the tests).

Also implement SetHex and GetHex in terms of uint256, to avoid
duplicate code as well as avoid endianness issues (as they
work in term of bytes).
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan 30007fda76 Remove now-unused methods from arith_uint256 and base_uint
- Methods that access the guts of arith_uint256 are removed,
as these are incompatible between endians. Use uint256 instead

- Serialization is no longer needed as arith_uint256's are never
read or written

- GetHash is never used on arith_uint256
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan edc720479d Remove arith_uint160
We never do 160-bit arithmetic.
2015-01-05 15:45:36 +01:00
Wladimir J. van der Laan dba2e9141a Add tests for new uint256 2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 92cdb1aace Add conversion functions arith_uint256<->uint_256 2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan bfc6070342 uint256->arith_uint256 blob256->uint256
Introduce new opaque implementation of `uint256`, move old
"arithmetic" implementation to `arith_uint256.
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 734f85c4f0 Use arith_uint256 where necessary
Also add conversion from/to uint256 where needed.
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 34cdc41128 String conversions uint256 -> uint256S
If uint256() constructor takes a string, uint256(0) will become
dangerous when uint256 does not take integers anymore (it will go
through std::string(const char*) making a NULL string, and the explicit
keyword is no help).
2015-01-05 15:45:35 +01:00
Wladimir J. van der Laan 2eae3157f6 Replace uint256(1) with static constant
SignatureHash and its test function SignatureHashOld
return uint256(1) as a special error signaling value.
Return a local static constant with the same value instead.
2015-01-05 15:45:34 +01:00
Wladimir J. van der Laan 807658549c Replace GetLow64 with GetCheapHash 2015-01-05 15:45:34 +01:00
Wladimir J. van der Laan 4f1524966a Replace direct use of 0 with SetNull and IsNull
Replace x=0 with .SetNull(),
x==0 with IsNull(), x!=0 with !IsNull().
Replace uses of uint256(0) with uint256().
2015-01-05 15:45:34 +01:00
Wladimir J. van der Laan 5d3064bc44 Temporarily add SetNull/IsNull/GetCheapHash to base_uint
Also add a stub for arith_uint256 and its conversion functions,
for now completely based on uint256.

Eases step-by-step migration to blob.
2015-01-05 15:14:47 +01:00
Wladimir J. van der Laan a043facf5a
Merge pull request #5594
7eeeac0 Remove dead BitcoinUnits::id code and update assets-attribution for non-image unit selector (Luke Dashjr)
2015-01-05 08:57:04 +01:00
jtimon 0cc0d8d60b Get rid of the internal miner's hashmeter 2015-01-04 21:04:55 +01:00
Peter Todd 0ea28baeb8
Reject non-final txs even in testnet/regtest
Previous behavior with IsFinalTx() being an IsStandard() rule was rather
confusing and interferred with testing of protocols that depended on
nLockTime.
2015-01-04 14:17:39 -05:00
Pieter Wuille e41345790f Catch LevelDB errors during flush 2015-01-04 19:12:00 +01:00
Pieter Wuille 02bced1661 Bugfix: only track UTXO modification after lookup
Otherwise, if CCoinsViewCache::ModifyCoins throws an exception in between
setting hasModifier and constructing the CCoinsModifier, the cache ends up
in an inconsistent state, resulting in an assert failure in the next
modification.

Bug discovered by Wladimir J. van der Laan.
2015-01-04 17:16:43 +01:00
Pieter Wuille 84eba479a1
Merge pull request #5540
12d927a RPC test for immature balance (Jonas Schnelli)
8024d67 Add immature balances to getwalletinfo. (Gregory Maxwell)
d44c545 Add unconfirmedbalance field to getwalletinfo (azeteki)
2015-01-04 17:06:17 +01:00
Pieter Wuille 9a5cabf3da
Merge pull request #5508
146c0a7 Add RandAddSeedPerfmon to MakeNewKey (21E14)
2015-01-04 16:37:24 +01:00
Luke Dashjr 7eeeac0ff5 Remove dead BitcoinUnits::id code and update assets-attribution for non-image unit selector 2015-01-03 15:43:04 +00:00
Thomas Zander 70477a0bdf
On close of splashscreen interrupt verifyDB
With the splashscreen being able to be closed it is possible to
shutdown during the lengthy verifyDB method. (Takes about a minute
on my machine). This change allows us to shutdown much sooner.

Github-Pull: #5557
2015-01-03 10:22:02 +01:00
Cory Fields 856e862f4a namespace: drop most boost namespaces and a few header cleanups
A few boost::asio were left around because they're very wordy otherwise.
2015-01-02 15:12:03 -05:00
Cory Fields 9b1ab860ff namespace: drop boost::assign altogether here
Standard functions are even simpler
2015-01-02 15:12:03 -05:00
Cory Fields a3241998e1 namespace: remove boost namespace pollution 2015-01-02 15:12:03 -05:00
Wladimir J. van der Laan f55c5e9749
Merge pull request #5349
0125988 Implement test for merkle tree malleability in CPartialMerkleTree (Pieter Wuille)
2015-01-02 18:06:52 +01:00
Wladimir J. van der Laan c986972ad7
Merge pull request #5476
73caf47 Display time offset in the debug window's Peers tab (Pavel Janík)
26a6bae Add time offset to getpeerinfo output (Pavel Janík)
2015-01-02 17:54:21 +01:00
Wladimir J. van der Laan 40d65eb66d
Merge pull request #5580
1b178a7 Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly (Luke Dashjr)
228d238 Make CCoinsViewCache's copy constructor private (Luke Dashjr)
2015-01-02 17:35:45 +01:00
Wladimir J. van der Laan 269d8ba0d2
Remove declaration of no longer existent CheckWork
Also make ProcessBlockFound static as it is not used outside
miner.cpp.

Alternative implementation of #5549.
2015-01-02 17:30:00 +01:00
Wladimir J. van der Laan fe39ce6b23
Merge pull request #5583
643415a [Qt] update a translation string and argument counts (Philip Kaufmann)
2015-01-02 11:18:28 +01:00
Wladimir J. van der Laan edbc9045cb
Bump project-wide COPYRIGHT_YEAR to 2015
There is still a redundancy here between configure.ac and
clientversion.h.
2015-01-02 10:53:13 +01:00
Wladimir J. van der Laan e6df2bb48f Remove redundant copyright notices from README files
The normative place for these for the entire project is COPYING,
and the main README already has a MIT license section.
2015-01-02 10:46:23 +01:00
Wladimir J. van der Laan 9adfacdb8b
Merge pull request #5551
dd3f697 Use real text rather than image-rendered text for unit selector (Luke Dashjr)
2015-01-02 10:04:48 +01:00
Luke Dashjr 23f3435962 Rename MAX_TX_SIGOPS to MAX_STANDARD_TX_SIGOPS to match similar policy constant MAX_STANDARD_TX_SIZE 2015-01-01 11:35:51 +00:00
Jeff Garzik 39d6b5fd42
Merge #5528 from
branch 'bitcoin-tx-copy-paste' of git://github.com/ers35/bitcoin into merge-5528
2014-12-31 08:57:55 -05:00
Jeff Garzik 664999eb87
Merge #5578 from
branch 'error_typos' of git://github.com/paveljanik/bitcoin into merge-5578
2014-12-31 08:00:37 -05:00
Jeff Garzik 95ecc0a857
Merge #4964 from
branch 'validateaddress-return-scriptpubkey' of git://github.com/petertodd/bitcoin into merge-4964
2014-12-31 07:05:14 -05:00
Jeff Garzik aa5c0d34b7
Merge #5111 from
branch 'core2' of git://github.com/jtimon/bitcoin into merge-5111
2014-12-31 06:48:42 -05:00
Philip Kaufmann 643415aade [Qt] update a translation string and argument counts 2014-12-31 12:03:00 +01:00
Wladimir J. van der Laan a5eb61d9ef
Merge pull request #5499
7f71813 Bugfix: prioritisetransaction: Do some basic sanity checking on txid (Luke Dashjr)
2014-12-31 10:50:06 +01:00
Wladimir J. van der Laan 639c79a41f
Merge pull request #5545
a094b3d Remove bitnodes.io from dnsseeds. (Gregory Maxwell)
2014-12-31 10:42:58 +01:00
Wladimir J. van der Laan 6e557c2b9d
Merge pull request #5571
06206bb Correct tooltip on address book page (Michael Ford)
2014-12-31 10:35:52 +01:00
Wladimir J. van der Laan 0a42036ded
Merge pull request #5576
8f6860a Bugfix: RPCWallet: Docs: Booleans aren't quoted (Luke Dashjr)
2014-12-31 09:46:00 +01:00
Luke Dashjr 1b178a7f96 Bugfix: ConnectBlock: In case the genesis block gets in with fJustCheck, behave correctly 2014-12-31 03:28:05 +00:00
Luke Dashjr 228d238525 Make CCoinsViewCache's copy constructor private
It is easily confused with CCoinsViewCache(CCoinsView*), which creates a sub-cache, but instead of creating a sub-cache, the copy constructor would copy the original and use that original's base, defeating the intended isolation.
2014-12-31 03:19:24 +00:00
Pavel Janík 4f1ee565b5 Clean AcceptToMemoryPool error messages 2014-12-30 23:02:46 +01:00