Commit graph

1840 commits

Author SHA1 Message Date
Gregory Maxwell 6a60c64c6b Don't retry a failing IRC nickname forever.
If our IRC nick is in use (because some other node thinks it has
the same address we think we have) don't fruitlessly try to reconnect
using that name forever. After three tries, give up and use a random
nick. Either we'll learn a new local address from IRC and switch
to that, or it was right and the other guy is advertising for us.

This avoids a pessimal case where a second testnet node behind
a nat is unable to get any peers because he can't get on IRC.
2012-08-28 22:04:38 -04:00
Gregory Maxwell 3595b18793 Don't force IRC off if not listening, do force it off if IPv4 is off.
Previously Bitcoin would refuse to use IRC if it was either not
accepting inbound connections or not making outbound. Instead this
changes it to not use IRC only if it's not doing either or if
IPv4 is off completely. If Bitcoin is not listening this will use
the default random nicks rather than the IP based ones.
2012-08-28 21:43:28 -04:00
Pieter Wuille af4da4be3d Bugfix: increase score, not port 2012-08-29 02:33:25 +02:00
Gavin Andresen 286dbba2d2 Give testnet it's own alert key. 2012-08-28 17:13:11 -04:00
Gavin Andresen f35c6c4fb9 Refactor: move alert code from main to alert.cpp/h 2012-08-28 17:04:54 -04:00
xanatos 9eb7fc5842 Changed nprev->pprev
It should be pprev, because the next one is pnext, and it's printing the memory address of the CBlockIndex (so pSomething).
2012-08-28 23:25:52 +03:00
Wladimir J. van der Laan ba7ba84f07 Add boost chrono lib for windows builds (required for boost 1.50) 2012-08-27 22:16:24 +02:00
Gavin Andresen 03fa53a640 Version numbers -> 0.7.0 2012-08-27 14:20:56 -04:00
Matt Corallo a1755ec426 Upgrade to Boost 1.50 2012-08-27 14:20:56 -04:00
Gavin Andresen fde5c34bd8 Merge branch 'alert_fix' of git://github.com/gavinandresen/bitcoin-git 2012-08-27 12:39:13 -04:00
Gavin Andresen ef8e821cf2 Fix compiler warning on mac 2012-08-27 12:37:35 -04:00
Gavin Andresen 8cd98a9a26 Merge branch 'bugfix_gitian' of git://github.com/luke-jr/bitcoin 2012-08-27 11:52:56 -04:00
Gavin Andresen ea2fda46c3 Special-case the last alert for alert-key-compromised case
Hard-code a special nId=max int alert, to be broadcast if the
alert key is ever compromised. It applies to all versions, never
expires, cancels all previous alerts, and has a fixed message:
   URGENT: Alert key compromised, upgrade required

Variations are not allowed (ignored), so an attacker with
the private key cannot broadcast empty-message nId=max alerts.
2012-08-27 10:22:57 -04:00
xanatos 028ec224b8 Removed duplicated lock
Around line 167 there is already a LOCK(bitdb.cs_db) that covers everything. Re-locking is useless.
2012-08-27 15:08:20 +03:00
Luke Dashjr 1837696580 Bugfix: Move boost::interprocess Win32 workaround to Bitcoin-Qt sources, rather than hacking boost in gitian 2012-08-27 00:49:23 +00:00
Gavin Andresen d5a52d9b3e Alert system DoS prevention
This fixes two alert system vulnerabilities found by
Sergio Lerner; you could send peers unlimited numbers
of invalid alert message to try to either fill up their
debug.log with messages and/or keep their CPU busy
checking signatures.

Fixed by disconnecting/banning peers if they send 10 or more
bad (invalid/expired/cancelled) alerts.
2012-08-26 17:08:18 -04:00
Gavin Andresen 772351b0d5 Merge branch '2012_08_progressbarwin' of git://github.com/laanwj/bitcoin 2012-08-25 11:14:11 -04:00
Gavin Andresen 9db9642db4 Merge branch 'nozeroout' of git://github.com/sipa/bitcoin 2012-08-25 11:05:59 -04:00
Gavin Andresen b9c078ea96 Merge branch 'checkpoint' 2012-08-25 11:05:24 -04:00
Wladimir J. van der Laan 12324c1693 Update Czech translation from Transifex 2012-08-25 10:19:35 +02:00
Luke Dashjr bc8d832335 Abstract all IPC communication to qtipcserver 2012-08-24 16:59:27 +00:00
Wladimir J. van der Laan 382b75f528 Override progress bar on platforms with segmented progress bars
Windows & WindowsXP style have a problem with displaying the block progress.
Add a custom stylesheet as workaround, but only when one of those renderers is active,
otherwise leave the theme alone (issue #1071).
2012-08-24 15:01:07 +02:00
Pieter Wuille af1c6b93b7 Merge pull request #1699 from laanwj/2012_08_securealloc
Handle locked pages more robustly (Fixes issue #1462)
2012-08-24 04:38:57 -07:00
Philip Kaufmann 9fd537965d Qt: add copyrightLabel to aboutdialog.ui
- add a new label, which can be updated independently from the whole
  license information stuff
- the benefit is, we don't need to re-translate that whole wall of text
  every year the copyright info changes
- update to the same copyright string we use in the source and in the
  bitcoin-qt.exe meta-data information
- removes an obsolete entry from the ui-file
2012-08-24 13:04:10 +02:00
Pieter Wuille 65ce215641 Make 0-value outputs non-standard 2012-08-24 12:15:12 +02:00
Gregory Maxwell c68c4bc7a4 Merge pull request #1672 from gmaxwell/filter_listunspent
Listunspent txout address filtering and listaddressgroupings
2012-08-24 00:46:24 -07:00
Gregory Maxwell b1093efa83 Change CWallet addressgrouping to use CTxDestination instead of strings.
This is cleanup for the listaddressgroupings code. Also add some
real help text.
2012-08-24 03:28:45 -04:00
Gregory Maxwell bdab0cf58c Avoid leaving return types or function attributes on their own lines. 2012-08-24 02:48:19 -04:00
Luke Dashjr e07c8e9123 Treat generation (mined) transactions less different from receive transactions
- Show address receiving the generation, and include it in the correct "account"
- Multiple entries in listtransactions output if the coinbase has multiple outputs to us
2012-08-23 23:20:01 +00:00
Gregory Maxwell 1bcd3f26c0 Merge pull request #1431 from luke-jr/opt_ipv6
Make IPv6 support optional again (defaults to enabled)
2012-08-23 14:17:35 -07:00
Luke Dashjr 9655d73f49 Allow building with IPv6 support, but it disabled by default 2012-08-23 21:01:01 +00:00
Luke Dashjr 45beb88966 Bugfix: Make USE_UPNP=- work with makefile.{linux-mingw,mingw,osx} too 2012-08-23 21:00:57 +00:00
Luke Dashjr e422bebbdc Make IPv6 support buildtime-optional again (defaults to enabled) 2012-08-23 20:49:51 +00:00
Wladimir J. van der Laan 05fa0de6d8 Add icon for "About Qt" in menu
Use the built-in icon that is also used in the dialog box itself.
2012-08-23 21:57:20 +02:00
Gregory Maxwell 92735bca31 Add txout address filtering to listunspent.
This applies on top of the coincontrol listaddressgroupings patch
and makes finding eligible outputs from the groups returned
by listaddressgroupings possible.
2012-08-23 15:55:50 -04:00
coderrr 22dfd73598 Add address groupings RPC from the coincontrol patches.
Signed-off-by: Gregory Maxwell <greg@xiph.org>
2012-08-23 15:55:42 -04:00
Luke Dashjr c3f95ef13f Choose reasonable "smart" times to display for transactions
Logic:
- If sending a transaction, assign its timestamp to the current time.
- If receiving a transaction outside a block, assign its timestamp to the current time.
- If receiving a block with a future timestamp, assign all its (not already known) transactions' timestamps to the current time.
- If receiving a block with a past timestamp, before the most recent known transaction (that we care about), assign all its (not already known) transactions' timestamps to the same timestamp as that most-recent-known transaction.
- If receiving a block with a past timestamp, but after the most recent known transaction, assign all its (not already known) transactions' timestamps to the block time.
2012-08-23 18:38:22 +00:00
Luke Dashjr bdbfd2329a JSON-RPC: Add "blocktime" and (for wallet transactions) "timereceived" to transaction Object outputs 2012-08-23 18:30:30 +00:00
Luke Dashjr 9c7722b7c5 Store a fixed order of transactions (and accounting) in the wallet
For backward compatibility, new accounting data is stored after a \0 in the comment string.
This way, old versions and third-party software should load and store them, but all actual use (listtransactions, for example) ignores it.
2012-08-23 18:18:20 +00:00
Jeff Garzik cf78183fad Merge pull request #1707 from xanatos/patch-7
Removed useless assignment
2012-08-23 06:41:02 -07:00
xanatos 331544bc37 Spaces in strings
One added space + one removed space.
2012-08-23 15:19:13 +03:00
xanatos b765385a3e Removed useless assignment
nLoadWalletRet is already equal to DB_NEED_REWRITE (we are in an if)
2012-08-23 14:47:00 +03:00
Wladimir J. van der Laan 0b886ad1bd Make CCrypter use LockedPageManager to manage locked pages
Replace direct calls to mlock.

Also, change the class to lock the memory areas in the constructor and unlock them again in the destructor. This makes sure that locked pages won't leak.
2012-08-23 06:55:35 +02:00
Wladimir J. van der Laan e95568b78d Handle locked pages more robustly (Fixes issue #1462)
Memory locks do not stack, that is, pages which have been locked several times by calls to mlock()
will be unlocked by a single call to munlock(). This can result in keying material ending up in swap when
those functions are used naively. In this commit a class "LockedPageManager" is added
that simulates stacking memory locks by keeping a counter per page.
2012-08-23 06:55:35 +02:00
Gregory Maxwell a159d6caf0 Merge pull request #1694 from sipa/fix_netloops
Fix infinite loops in connection logic
2012-08-22 07:15:03 -07:00
Wladimir J. van der Laan ba1cdb6883 Merge pull request #1701 from laanwj/2012_08_pull_transifex
Update translations from transifex
2012-08-22 05:09:29 -07:00
Wladimir J. van der Laan d9725378b0 Update translations from transifex 2012-08-22 14:05:01 +02:00
Pieter Wuille f161a2c211 Fix infinite loops in connection logic 2012-08-22 13:35:33 +02:00
Pieter Wuille 1a3dcca8f4 Merge pull request #1695 from sipa/noloadorphan
Do not accept orphan blocks in -loadblock mode
2012-08-22 04:32:39 -07:00
Gavin Andresen 80cfc3a485 Checkpoint at block 193,000 2012-08-21 22:50:00 -04:00
Gavin Andresen f39ab4c8d0 Merge branch 'testdata' of git://github.com/TheBlueMatt/bitcoin 2012-08-21 13:58:24 -04:00
Pieter Wuille 5c88e3c108 Do not accept orphan blocks in -loadblock mode 2012-08-21 19:18:53 +02:00
Jeff Garzik 1954d40691 Merge pull request #1493 from jgarzik/unlocked-rpc
RPC: add facility to enable RPCs to run outside cs_main, wallet locks
2012-08-21 09:22:13 -07:00
Jeff Garzik 0e1d3551da RPC: add facility to enable RPCs to run outside cs_main, wallet locks
Use with 'stop' and 'help' RPCs.

This provides a facility to individually evaluate the locking for an RPC, and
potentially make it more parallel.
2012-08-21 12:03:52 -04:00
Gavin Andresen cd58f05894 Restore OSX 10.5 compatibility (do not use pthread_setname_np) 2012-08-21 12:00:05 -04:00
Gavin Andresen b4b7ed1915 Fix 32-bit build error: include util.h to get int64 typedef 2012-08-21 11:59:59 -04:00
Jeff Garzik 5f2b41d54d Merge pull request #1693 from jgarzik/rpcwallet
Move code to new modules rpcwallet.cpp, rpcblockchain.cpp
2012-08-21 08:44:21 -07:00
Jeff Garzik c625ae04d2 RPC, cosmetic: move more RPC code to new rpcblockchain.cpp module 2012-08-21 11:03:38 -04:00
Jeff Garzik e3bc569865 RPC, cosmetic: move wallet-related RPCs to new rpcwallet.cpp module 2012-08-21 10:38:57 -04:00
Pieter Wuille 143acc7672 Merge pull request #1687 from gavinandresen/quietunit
Suppress output when running unit tests.
2012-08-21 07:07:51 -07:00
Gregory Maxwell 4a4a0c1196 Merge pull request #1690 from gavinandresen/signrawtx_null
Allow signrawtransaction '...' null null 'hashtype'
2012-08-21 06:40:50 -07:00
Jeff Garzik a2168d94c0 RPC: submitblock returns null on success, string on error 2012-08-21 02:41:46 -04:00
Jeff Garzik 7600e7fc39 RPC, cosmetic: Create rpcmining.cpp as new home for mining-related RPC code 2012-08-21 02:21:33 -04:00
Jeff Garzik ddd1ffb4f1 RPC, cosmetic: de-indent getblocktemplate() 2012-08-21 02:06:09 -04:00
Jeff Garzik 79f2525ab6 RPC: split new 'submitblock' out of 'getblocktemplate' 2012-08-21 02:02:06 -04:00
Gavin Andresen cc6dfd1f4b Allow signrawtransaction '...' null null 'hashtype'
Allows the user to pass null as the second or third parameter
to signrawtransaction, in case you need to (for example) fetch
private keys from the wallet but want to specify the hash type.
2012-08-20 17:19:13 -04:00
Gregory Maxwell b86da2abe8 Merge pull request #1689 from gavinandresen/rawtx_singlefix
When using SIGHASH_SINGLE, only sign inputs that have corresponding outputs
2012-08-20 12:59:50 -07:00
Gavin Andresen d5e7b61173 When using SIGHASH_SINGLE, do not sign inputs that have no corresponding outputs.
This fixes issue #1688
2012-08-20 14:06:27 -04:00
Matt Corallo da9e86c3b6 Allow setting a different linker than compiler in makefile.unix 2012-08-20 12:12:41 -04:00
Matt Corallo fc4743faa8 Add data-driven transaction tests. 2012-08-20 12:12:41 -04:00
Matt Corallo 336a0abbbb Add a few test cases to data-driven script tests. 2012-08-20 12:12:41 -04:00
Gavin Andresen 4d51be1cf3 Suppress output when running unit tests.
This does two things:
1) Now does not output to debug.log if -printtodebugger flag is passed
2) Unit tests set -printtodebugger so only test results are output to stdout

Note that -printtodebugger only actually prints to the debugger on Windows.
2012-08-20 11:33:20 -04:00
Gavin Andresen d18f2fd9d6 Reject block.nVersion<=1 blocks if network has upgraded to version=2
If 950 of the last 1,000 blocks are nVersion=2, reject nVersion=1
(or zero, but no bitcoin release has created block.nVersion=0) blocks
-- 75 of last 100 on testnet3.

This rule is being put in place now so that we don't have to go
through another "express support" process to get what we really
want, which is for every single new block to include the block height
in the coinbase.
2012-08-20 10:46:07 -04:00
Gavin Andresen de237cbfa4 Block height in coinbase as a new block rule
"Version 2" blocks are blocks that have nVersion=2 and
have the block height as the first item in their coinbase.
Block-height-in-the-coinbase is strictly enforced when
version=2 blocks are a supermajority in the block chain
(750 of the last 1,000 blocks on main net, 51 of 100 for
testnet). This does not affect old clients/miners at all,
which will continue producing nVersion=1 blocks, and
which will continue to be valid.
2012-08-20 10:46:07 -04:00
Gavin Andresen 3fcec0d4a0 Set block.nVersion to fix miner unit test 2012-08-20 10:46:07 -04:00
Jeff Garzik b3a570d158 Merge pull request #1641 from jgarzik/mempool
Add 'mempool' P2P command, and extend 'getdata' behavior
2012-08-20 07:21:34 -07:00
Philip Kaufmann 30c8a40847 fix a comment in addrman.cpp 2012-08-18 16:45:24 +02:00
Wladimir J. van der Laan 8765d20b1e Merge pull request #1680 from Diapolo/add_message_on_blockimport
add splashscreen message when importing blocks via -loadblock
2012-08-17 11:29:43 -07:00
Matt Corallo 8555a3e3cc Remove useless non-cross-platform tests. 2012-08-17 12:40:09 -04:00
Wladimir J. van der Laan a108d3defb Merge pull request #1607 from Diapolo/Qt_Win_exe_desc
Bitcoin-Qt (Windows only): extend Resource File
2012-08-17 08:55:54 -07:00
Jeff Garzik dabb95b892 Merge pull request #1678 from Diapolo/LoadExternalBlockFile_add_timer
log how long LoadExternalBlockFile() takes in ms (Benchmark)
2012-08-17 08:45:11 -07:00
Philip Kaufmann 2d914f89fe add splashscreen message when importing blocks via -loadblock 2012-08-17 14:21:17 +02:00
Philip Kaufmann 1e7027b41e fix a compiler sign warning in OpenBlockFile() 2012-08-17 10:35:51 +02:00
Philip Kaufmann 746f502a79 log how long LoadExternalBlockFile() takes in ms (Benchmark) 2012-08-17 00:14:40 +02:00
Philip Kaufmann 4b94f4e0ed Bitcoin-Qt (Windows only): extend Resource File
- extend bitcoin-qt.rc to include meta information, which is displayed on
  Windows, when looking in the executable properties and selecting
  "Details"
- does currently NOT include version information, this is scheduled
  for later releases
- for RC-file documentation see:
  http://msdn.microsoft.com/en-us/library/windows/desktop/aa381058%28v=vs.85%29.aspx
2012-08-14 11:16:46 +02:00
Wladimir J. van der Laan 0825aee8f4 Merge pull request #1649 from Diapolo/optionsdialog
small UX update for optionsdialog
2012-08-13 21:17:39 -07:00
Wladimir J. van der Laan a55ed9d5bb Merge pull request #1614 from Diapolo/Qt_Win_enable_DEP
Bitcoin-Qt (Windows only): enable DEP for bitcoin-qt.exe
2012-08-13 21:01:17 -07:00
Gregory Maxwell 14486dc0e2 Merge pull request #936 from luke-jr/gmp_bip
BIP22: getblocktemplate
2012-08-13 10:21:33 -07:00
Wladimir J. van der Laan c23b6fd688 Revert "Make this error message similar to the others"
This reverts commit dc1e5ad191.

The new error message was not correct, as it refers to the total balance, not an account.
2012-08-12 21:35:39 +02:00
Wladimir J. van der Laan 198947c19f Merge pull request #1661 from laanwj/2012_08_stringsupdate
Update English translation strings
2012-08-09 08:32:18 -07:00
Gregory Maxwell 765654dae8 Merge pull request #1655 from gmaxwell/signrawtransaction_fix_missing
Correctly handle missing inputs in signrawtransaction. Fixes #1654.
2012-08-09 05:56:03 -07:00
Jeff Garzik 2c006b0b3e Merge pull request #1658 from TheBlueMatt/qttest
Fix several issues in the Qt unit tests.
2012-08-07 17:59:06 -07:00
Matt Corallo c5f90cd88b Fix test_bitcoin build in makefile.linux-mingw 2012-08-08 00:20:48 +02:00
Wladimir J. van der Laan 3a50cd2193 Update English translation strings
This is the last time for 0.7.0. We should avoid message changes
until the release. Translators can use the remaining time to update their languages on
Transifex.

The other languages need to be merged from Transifex just before release.
2012-08-07 21:10:03 +02:00
Matt Corallo 2bc15836be Fix Qt test cases by moving address checks to parseBitcoinURI
Makes sense in case bitcoin URIs eventually allow invalid addresses
as a part of some larger future payment scheme.
2012-08-07 19:37:02 +02:00
Matt Corallo 319236afa2 Fix Win32 compiling of qt/test/uritests.cpp 2012-08-07 19:36:59 +02:00
Matt Corallo 026594e269 Return !0 when qt tests fail. 2012-08-07 19:36:54 +02:00
fanquake dc1e5ad191 Make this error message similar to the others 2012-08-07 22:39:19 +08:00
Gregory Maxwell 3557f99cf5 Correctly handle missing inputs in signrawtransaction. Fixes #1654.
Signrawtransaction rpc was crashing when some inputs were unknown,
and even with that fixed was failing to handle all the known inputs
if there were unknown inputs in front of them. This commit instead
attempts to fetch inputs one at a time.
2012-08-06 00:37:28 -04:00
Philip Kaufmann 3d88c9b4d3 Bitcoin-Qt (Windows only): enable DEP for bitcoin-qt.exe
- this enables DEP on all Windows version which support the
  SetProcessDEPPolicy() call in Kernel32.dll
- use a dynamic approach via GetProcAddress() to not rely on headers or
  compiler libs
- this is the same way the Tor-project does it
2012-08-03 14:51:51 +02:00