Compare commits

...

161 Commits

Author SHA1 Message Date
Luke Dashjr
d05c03ab4e Merge branch '0.5.0.x' into 0.5.x 2012-03-11 22:21:06 -04:00
Luke Dashjr
b4f8c8f5f9 Merge branch '0.4.x' into 0.5.0.x 2012-03-11 22:20:31 -04:00
Gregory Maxwell
11c34e0f6c Resolves issue #922 - "wallet passphrase timeout of several years doesn't work"
2^31 milliseconds is only about 25 days. Also clamps Sleep() to 10 years,
because it currently sleeps for 0 seconds when the sleep time would cross
2^31 seconds since the epoch. Hopefully boost will be fixed by 2028.
2012-03-11 21:53:47 -04:00
nomnombtc
b3b4b008e3 fix typo src/net.cpp 2012-03-06 10:28:49 -05:00
Luke Dashjr
9cf600e6da Merge branch '0.5.0.x' into 0.5.x 2012-03-03 13:59:31 -05:00
Luke Dashjr
7013cc3d97 Merge branch '0.4.x' into 0.5.0.x 2012-03-03 13:59:19 -05:00
Luke Dashjr
88aa771536 Bugfix: Fix possible buffer overflow (#901)
Upstream commit: 21ae37d (partial)
2012-03-03 13:51:10 -05:00
Luke Dashjr
4fc8c042a2 Bugfix: Check return value of SHGetSpecialFolderPath in MyGetSpecialFolderPath
Upstream commit: 21ae37d (partial)
2012-03-03 13:45:44 -05:00
Luke Dashjr
e9865a41d6 Merge remote branch 'sipa/nooverwritetx_v0.4.0' into 0.4.x 2012-03-03 12:59:09 -05:00
Pieter Wuille
d7962747c4 Do not allow overwriting unspent transactions (BIP 30)
Introduce the following network rule:
 * a block is not valid if it contains a transaction whose hash
   already exists in the block chain, unless all that transaction's
   outputs were already spent before said block.

Warning: this is effectively a network rule change, with potential
risk for forking the block chain. Leaving this unfixed carries the
same risk however, for attackers that can cause a reorganisation
in part of the network.

Thanks to Russell O'Connor and Ben Reeves.
2012-03-03 18:51:18 +01:00
Gavin Andresen
3108aed0f2 DoS fix for mapOrphanTransactions 2012-03-02 13:04:39 -05:00
Wladimir J. van der Laan
ef48e9b7df In UI, handle cases in which the last received block was generated in the future (secs<0)
Fixes #874.
2012-02-27 13:07:26 -05:00
Chris Moore
0b11082d36 Don't show splash screen when -min is specified on the command line. 2012-02-27 13:07:10 -05:00
Gavin Andresen
feb3c15335 Checkpoint block 168,000 2012-02-27 13:00:23 -05:00
Pieter Wuille
1be5779124 ProcessBlock is sometimes called with pfrom==NULL 2012-02-27 12:58:53 -05:00
Pieter Wuille
ab2be34059 Fix #616: remove base_uint::operator&=(uint64 b) 2012-02-27 12:55:15 -05:00
Pieter Wuille
54fee2d0ce Fix #626: RecvLine wrong error message 2012-02-27 12:54:06 -05:00
Wladimir J. van der Laan
001a64c71c On windows, show message box with help, as there is no stderr (fixes #702)
(partial)
2012-02-27 12:48:28 -05:00
Wladimir J. van der Laan
b085138f89 Only fill in label from address book, if no label is filled in yet, fixes #840 2012-02-27 12:45:25 -05:00
Pieter Wuille
471e0bdc7c Fix #650: CKey::SetSecret BIGNUM leak 2012-02-27 12:42:48 -05:00
Pieter Wuille
caad1add4f Free pwalletdbEncryption after encryping wallet
Fixes a memory leak.
2012-02-27 12:36:56 -05:00
Wladimir J. van der Laan
33e0c3a866 Restructure IPC URL handling (fixes #851) 2012-02-27 12:28:39 -05:00
Wladimir J. van der Laan
82705af1eb Change #ifdef GUI to #ifdef QT_GUI, GUI is not defined anymore... 2012-02-17 12:05:09 -05:00
Pieter Wuille
69ce70866d Extra wallet locking fixes
* Fix sign error in calculation of seconds to sleep
* Do not mix GetTime() (seconds) and Sleep() (milliseconds)
* Do not sleep forever if walletlock() is called
* Do locking within critical section
2012-02-17 10:52:28 -05:00
Luke Dashjr
6fb186f4bb Merge branch '0.5.0.x' into 0.5.x 2012-02-17 09:40:00 -05:00
Luke Dashjr
fdb365df0e Merge branch '0.4.x' into 0.5.0.x 2012-02-17 09:39:54 -05:00
Pieter Wuille
8960f2fc33 Fix wallet locking locking 2012-02-17 09:38:20 -05:00
Pieter Wuille
43163a5a4d Macros for manual critical sections 2012-02-17 09:38:13 -05:00
Luke Dashjr
fb811c31fd Merge branch '0.5.0.x' into 0.5.x
Conflicts:
	src/qt/bitcoingui.cpp
2012-02-17 09:16:19 -05:00
Luke Dashjr
0365f19dec Merge branch '0.4.x' into 0.5.0.x 2012-02-17 09:15:21 -05:00
Wladimir J. van der Laan
25be0597ca don't allow -daemon in bitcoin-qt (changes only #defines) 2012-02-17 09:14:38 -05:00
Matt Corallo
6928794f56 Properly include $*_LIB_PATH in makefile.unix 2012-02-17 09:04:53 -05:00
Pieter Wuille
d52397b3c0 Several shutdown-related fixes
* do not let vnThreadsRunning[1] go negative
* do not perform locking operations while vnThreadsRunning[1] is decreased
* check vnThreadsRunning[1] at exit
2012-02-17 09:02:21 -05:00
Pieter Wuille
622f1438de Bugfix: do not create CAddress for invalid accepts 2012-02-17 09:00:48 -05:00
Janne Pulkkinen
41cde5bbdc Fix Minimize to the tray instead of the taskbar 2012-02-17 08:50:34 -05:00
Wladimir J. van der Laan
6ebb141bf9 Prevent window from being shown momentarily when using -min
- In a previous patch, show() was added to all the page switcher functions. As the contructor calls showOverviewPage(), this means the window is shown in the constructor.
- This change prevents this by connecting show() to the signal instead.
2012-02-17 08:49:46 -05:00
Wladimir J. van der Laan
4c38fbae95 Enable accessible widgets Qt module on win32, so that people with screen readers such as NVDA can make sense of it. 2012-02-14 17:13:28 -05:00
Luke Dashjr
9ab932b769 Merge branch '0.5.0.x' into 0.5.x 2012-02-11 21:26:22 -05:00
Luke Dashjr
8ad6996cc3 Merge branch '0.4.x' into 0.5.0.x 2012-02-11 21:26:11 -05:00
Matt Corallo
888ac4e7a3 Get ext. IP from UPnP, make sure addrMe IsRoutable() in version.
This fixes a potential bug where some NATs may replace the node's
interal IP with its external IP in version messages, causing
incorrect checksums when version messages begin being checksummed
on February 14, 2012.
2012-02-11 21:25:35 -05:00
Pieter Wuille
76e707a44e Fix #822 2012-02-11 20:50:43 -05:00
Luke Dashjr
84d228ed83 Bugfix: Capitalize kB correctly (upstream: 9d4b05c) 2012-02-07 22:50:31 -05:00
Luke Dashjr
a21e4da901 Merge branch '0.5.0.x' into 0.5.x
Conflicts:
	src/qt/locale/bitcoin_ru.ts
	src/qt/locale/bitcoin_zh_TW.ts
2012-02-07 22:49:03 -05:00
Luke Dashjr
b5d9c7d9fb Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/bitcoinrpc.cpp
2012-02-07 22:46:07 -05:00
Luke Dashjr
4bbd72cca1 Update copyrights to 2012 for files modified this year 2012-02-07 22:43:39 -05:00
Gregory Maxwell
da6a3919a9 Have bitcoind recommend a secure RPC password. Increase invalid password delay.
Help users avoid insecure configurations a bit by recommending a
secure RPC password and increasing the incorrect password delay.

This may open up a RPC DOS for users with exposed RPC ports and
short passwords. Since users shouldn't have exposed RPC ports OR
short passwords, the DOS risk is preferable to the compromise
risk.

Also logs the client IP address for incorrect attempts.
2012-02-07 22:39:09 -05:00
Wladimir J. van der Laan
e7c3e6e4b4 Restructure credit transaction decomposition (solves issue #689)
When a transaction has multiple outputs that go to the wallet, list these
as multiple transactions in the UI. This is also applied to generated
(coinbase) transactions. Also makes the code shorter and easier
to understand.
2012-02-07 22:36:03 -05:00
Luke Dashjr
ccd69c7d22 Bugfix: Capitalize kB correctly (upstream: 9d4b05c) 2012-02-07 22:35:57 -05:00
Luke Dashjr
4664aae3fe Update copyrights to 2012 for files modified this year 2012-02-07 22:30:50 -05:00
Gregory Maxwell
cac23a5a0b Have bitcoind recommend a secure RPC password. Increase invalid password delay.
Help users avoid insecure configurations a bit by recommending a
secure RPC password and increasing the incorrect password delay.

This may open up a RPC DOS for users with exposed RPC ports and
short passwords. Since users shouldn't have exposed RPC ports OR
short passwords, the DOS risk is preferable to the compromise
risk.

Also logs the client IP address for incorrect attempts.
2012-02-07 22:21:13 -05:00
Luke Dashjr
06e0f79ae5 Merge branch '0.5.0.x' into 0.5.x 2012-02-02 20:17:56 -05:00
Luke Dashjr
882e00e215 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/main.cpp
2012-02-02 20:17:41 -05:00
Gavin Andresen
c11e2b8679 Only store transactions with missing inputs in the orphan pool.
All previous versions of bitcoin could store some types of
invalid transactions in the orphan-transaction list.
2012-02-02 20:03:33 -05:00
Pieter Wuille
d841fc969a Full checking of all loaded keys 2012-02-02 20:03:26 -05:00
Wladimir J. van der Laan
c13d50d861 Revert to global progress indication (see #753) 2012-02-02 17:50:13 -05:00
Pieter Wuille
c1c6de6ad4 Check consistency of private keys
Reported by onlineproof on IRC: Bitcoin does not verify whether private
keys and public keys correspond, when loading a wallet.
2012-02-02 17:49:39 -05:00
Wladimir J. van der Laan
7120874983 Remove loose amp; from Portugese translation (issue #701) 2012-02-02 17:48:15 -05:00
Gavin Andresen
1b6d8f3fca Allow -upnp to override setting in wallet (and simplify logic a bit) 2012-02-02 17:45:04 -05:00
Matt Corallo
e5b031f5d2 Fix UPnP by reannouncing every 20 minutes. 2012-02-02 17:44:42 -05:00
Gavin Andresen
edb563e8a5 Testnet difficulty calculation changes, to take effect Feb 15 2012
Allow mining of min-difficulty blocks if 20 minutes have gone by without mining a regular-difficulty block.
Normal rules apply every 2016 blocks, though, so there may be a very-slow-to-confirm block at the difficulty-adjustment blocks.
2012-02-02 17:44:04 -05:00
Matt Corallo
bccbc5f4c3 Automatically refocus on new SendCoinsEntrys and scroll to them. 2012-02-02 17:37:55 -05:00
Gavin Andresen
22388eac08 Support makefile.osx building test_bitcoin with dynamic boost 2012-02-02 17:34:29 -05:00
Luke Dashjr
1677743fca Rename src/obj/test to src/obj-test to workaround bug in older GNU Make 2012-02-02 17:29:50 -05:00
Luke Dashjr
d1e56838dc Bugfix: Support building test_bitcoin with shared-object boost test framework
Conflicts:

	src/makefile.unix
2012-02-02 17:27:44 -05:00
Luke Dashjr
a0db9a79e5 Merge branch '0.5.0.x' into 0.5.x 2012-01-23 22:45:47 -05:00
Luke Dashjr
8f378e98c5 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	doc/release-process.txt
2012-01-23 22:45:36 -05:00
Luke Dashjr
3d3f9cd120 Various updates to the release process 2012-01-23 22:44:02 -05:00
Luke Dashjr
5df1a22c2e Various updates to the release process 2012-01-23 22:43:47 -05:00
Daniel Folkinshteyn
54ed0a0432 Update seednodes, pick long-uptime nodes with version >= 0.4.0 2012-01-23 22:39:21 -05:00
Lars Rasmusson
b0870346f2 Replace tabs with four spaces to comply with coding standard in doc/coding.txt 2012-01-23 22:38:30 -05:00
Lars Rasmusson
1181bf86d1 Replace tabs with four spaces to comply with coding standard in doc/coding.txt 2012-01-23 22:37:48 -05:00
Luke Dashjr
382e613ef5 Merge branch '0.5.0.x' into 0.5.x 2012-01-16 22:30:10 -05:00
Luke Dashjr
c144672045 Code tidyups, fixing various warnings.
Partial cherry pick of:

Compile with extra warnings turned on. And more makefile/code tidying up.

This turns on most gcc warnings, and removes some unused variables and other code that triggers warnings.
Exceptions are:
 -Wno-sign-compare : triggered by lots of comparisons of signed integer to foo.size(), which is unsigned.
 -Wno-char-subscripts : triggered by the convert-to-hex functions (I may fix this in a future commit).

Conflicts:

	src/makefile.osx
	src/makefile.unix
	src/netbase.cpp
2012-01-16 22:29:54 -05:00
Luke Dashjr
a5b875f47b Merge branch '0.5.0.x' into 0.5.x 2012-01-16 22:28:14 -05:00
Luke Dashjr
70550ed81b Merge branch '0.4.x' into 0.5.0.x 2012-01-16 22:27:59 -05:00
Janne Pulkkinen
5df96269d3 *Clear all has a tooltip now *About dialog updated 2012-01-16 22:26:54 -05:00
Luke Dashjr
948072c39f Code tidyups, fixing various warnings.
Partial cherry pick of:

Compile with extra warnings turned on. And more makefile/code tidying up.

This turns on most gcc warnings, and removes some unused variables and other code that triggers warnings.
Exceptions are:
 -Wno-sign-compare : triggered by lots of comparisons of signed integer to foo.size(), which is unsigned.
 -Wno-char-subscripts : triggered by the convert-to-hex functions (I may fix this in a future commit).

Conflicts:

	src/makefile.osx
	src/makefile.unix
	src/netbase.cpp
	src/rpc.cpp
2012-01-16 22:18:51 -05:00
Pieter Wuille
880c478635 Remove unused definition 2012-01-10 19:46:04 -05:00
Luke Dashjr
98811f6ad4 Bump version to 0.5.3 2012-01-10 15:58:29 -05:00
Luke Dashjr
83201b12ae Merge branch '0.5.0.x' into 0.5.x
Conflicts:
	bitcoin-qt.pro
	contrib/debian/changelog
	doc/README
	doc/README_windows.txt
	share/setup.nsi
	src/serialize.h
2012-01-10 15:55:40 -05:00
Luke Dashjr
507848b63d Bump version to 0.5.0.4 2012-01-10 15:54:38 -05:00
Luke Dashjr
cc19ba76e4 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	contrib/Bitcoin.app/Contents/Info.plist
	doc/README
	doc/README_windows.txt
	share/setup.nsi
	src/serialize.h
2012-01-10 15:54:25 -05:00
Luke Dashjr
6e1e62a04c Bump version to 0.4.4 2012-01-10 15:50:37 -05:00
Luke Dashjr
9b53650a45 Merge branch '0.5.0.x' into 0.5.x
Conflicts:
	contrib/debian/changelog
2012-01-09 12:15:32 -05:00
Wladimir J. van der Laan
2d8bc0e6da Add "About Qt" menu option to show built-in Qt About dialog
- Most Qt programs do this, and it can be useful to find out what version of Qt was built against.
2012-01-09 12:13:58 -05:00
Wladimir J. van der Laan
21aa161453 make transaction description read-only (UI fix) 2012-01-09 12:10:52 -05:00
Matt Corallo
09308a3882 Remove mentions on anonymity in debian folder.
These should never have been there, bitcoin isnt anonymous without
a ton of work that virtually no users will ever be willing and
capable of doing.
2012-01-09 12:10:16 -05:00
Luke Dashjr
7de7913abd Merge branch '0.5.0.x' into 0.5.x 2012-01-05 18:19:29 -05:00
Luke Dashjr
780a182317 Merge branch '0.4.x' into 0.5.0.x 2012-01-05 18:17:58 -05:00
Matt Corallo
99e9601e80 Fix horrific performance found by gmaxwell. 2012-01-05 12:11:28 -05:00
Wladimir J. van der Laan
45099b19da Fix transaction type in UI: not all tx'es with "from"/"to" field are necessarily IP tx'es
- Also, prepare for OP_EVAL by calling all transactions without bitcoin address "SendToOther"/"RecvFromOther",
 (IP tx'es are so rare they can be put together with funky EV_EVAL scripts)
2012-01-04 01:09:09 -05:00
Luke Dashjr
a2e9767225 Merge branch '0.5.0.x' into 0.5.x 2012-01-03 12:23:09 -05:00
Wladimir J. van der Laan
20e3f2aefc Fix typo (#734) 2012-01-03 12:23:07 -05:00
Luke Dashjr
fb88f1cc97 Fix typo (#734)
Conflicts:

	src/qt/locale/bitcoin_hu.ts
	src/qt/locale/bitcoin_it.ts
	src/qt/locale/bitcoin_pt_BR.ts
	src/qt/locale/bitcoin_uk.ts
	src/qt/locale/bitcoin_zh_CN.ts
2012-01-03 12:21:04 -05:00
Luke Dashjr
eb2a10afd6 Merge branch '0.4.x' into 0.5.0.x
Conflicts:
	src/util.cpp
2012-01-03 12:19:48 -05:00
Gavin Andresen
cc6bd19660 I broke -testnet with my TOR option-parsing fixes. 2012-01-03 12:17:54 -05:00
Gavin Andresen
84393f15b6 Fix issue #659, and cleanup wallet/command-line argument handling a bit
Conflicts:
	src/init.cpp
	src/util.cpp
2012-01-03 11:48:44 -05:00
Pieter Wuille
b52b6f2e38 Fix some address-handling deadlocks
Made three critical blocks for cs_mapAddresses smaller, and moved
writing to the database out of them. This should also improve the
concurrency of the code.
2012-01-02 20:05:58 -05:00
Luke Dashjr
a91a40febd Merge branch '0.5.0.x' into 0.5.x 2011-12-25 09:56:55 -05:00
Luke Dashjr
3b8051864b Be more conservative: check all transactions in blocks after last checkpoint. 2011-12-25 09:26:12 -05:00
Luke Dashjr
961cf14ab3 Merge branch '0.5.0.x' into 0.5.x 2011-12-23 10:09:13 -05:00
Matt Corallo
8632383161 Fix #722. 2011-12-23 10:09:02 -05:00
Luke Dashjr
ab4b52a239 Merge branch '0.4.x' into 0.5.0.x 2011-12-23 10:08:53 -05:00
Dylan Noblesmith
96f1723bb1 Implement an mlock()'d string class for storing passphrases
SecureString is identical to std::string except with secure_allocator
substituting for std::allocator. This makes casting between them
impossible, so converting between the two at API boundaries requires
calling ::c_str() for now.
2011-12-20 18:42:30 -05:00
Luke Dashjr
027d149352 Bugfix: fForRelay should be false when deciding required fee to include in blocks
During the rushed transition from 0.01 BTC to 0.0005 BTC fees, we took the
approach of dropping the relay and block-inclusion fee to 0.0005 BTC
immediately, and only delayed adjusting the sending fee for the next release.
Afterward, the relay fee was lowered to 0.0001 BTC to avoid having the same
problem in the future. However, the block inclusion code was left setting
fForRelay to true! This fixes that, so the lower 0.0001 BTC allowance is (as
intended) only permitted for real relaying.
2011-12-20 17:05:04 -05:00
Luke Dashjr
96c700f5e4 Merge branch '0.5.0.x' into 0.5.x 2011-12-19 16:05:32 -05:00
Luke Dashjr
f503a1486a Merge branch '0.4.x' into 0.5.0.x 2011-12-19 16:05:15 -05:00
Luke Dashjr
987f26aa1a Add my DNS seed domain 2011-12-19 14:38:26 -05:00
Matt Corallo
6be2c9b5b4 Add sipa's new dnsseed. 2011-12-19 14:38:22 -05:00
Luke Dashjr
7aa253d3ec Bump version to 0.5.2 2011-12-16 17:58:40 -05:00
Matt Corallo
9ea0699278 Update debian changelog to 0.5.1. 2011-12-16 17:55:44 -05:00
Luke Dashjr
f1a6d74775 Merge branch '0.5.0.x' into 0.5.x 2011-12-16 17:54:53 -05:00
Luke Dashjr
5fe2dbd7b6 Update debian changelog to 0.5.0.3. 2011-12-16 17:47:50 -05:00
Luke Dashjr
ace5ce05be Bump version to 0.5.0.3 2011-12-15 19:34:37 -05:00
Luke Dashjr
98c0b8b85e Bump version to 0.5.0.2 2011-12-15 19:32:15 -05:00
Luke Dashjr
1f53204045 Bump version to 0.4.3 2011-12-15 19:25:29 -05:00
Matt Corallo
181b863d22 Fix status bar not displaying Alerts. 2011-12-13 16:17:58 -05:00
Wladimir J. van der Laan
142e5056cd Enable wordwrap for long message in passphrase dialog
- Remove explicit resizing from constructor to prevent potential hang
2011-12-13 12:46:58 -05:00
Matt Corallo
9a7f4948c6 Re-enable RPCSSL in gitian builds. 2011-12-12 14:39:49 -05:00
Luke Dashjr
12c69167e3 Merge branch '0.4.x' into 0.5.x 2011-12-12 14:34:47 -05:00
Luke Dashjr
b379bc5eef Merge branch 'restore_old_miniupnp_compat' into 0.4.x 2011-12-12 14:33:47 -05:00
Matt Corallo
16e7c05de7 Move -lgdi32 after -lcrypto (fixes #681). 2011-12-05 11:08:48 -05:00
Matt Corallo
4c519a47a9 Move DNS Seed lookup to a new thread. 2011-12-02 12:56:26 -05:00
Matt Corallo
ba56a88ca5 Move DNS Seed lookup to a new thread. 2011-12-02 12:55:14 -05:00
Luke Dashjr
fe5cc3b7f8 Merge branch '0.4.x' into 0.5.x
(no actual changes)
2011-12-01 23:22:12 -05:00
Gavin Andresen
5d901f1ba0 Orphan block fill-up-memory attack prevention 2011-12-01 23:20:32 -05:00
Gavin Andresen
0e6425da4a Moved checkpoints out of main, to prep for using them to help prevent DoS attacks 2011-12-01 23:12:47 -05:00
Gavin Andresen
f8c3eb9568 Orphan block fill-up-memory attack prevention 2011-12-01 15:48:27 -05:00
Gavin Andresen
d27be1f557 Moved checkpoints out of main, to prep for using them to help prevent DoS attacks 2011-12-01 15:48:20 -05:00
Wladimir J. van der Laan
3741185a51 Make home and addressbook icon more consistent with other toolbar icons (make it blue and flip light source direction) 2011-12-01 03:56:33 -05:00
Gavin Andresen
cba18514c0 Add missing command-line arguments to --help/-? output 2011-12-01 03:55:59 -05:00
Gavin Andresen
a7d735dcc2 Add missing command-line arguments to --help/-? output 2011-12-01 03:55:26 -05:00
Wladimir J. van der Laan
094c35cffc allow for filtering addresses and labels by searching for the typed string anywhere, not just at the beginning (#641) 2011-11-25 09:05:58 -05:00
Luke Dashjr
b683118cd0 Merge branch '0.4.x' into 0.5.x
The only practical change here is updating the gitian URIs to the stable repository.
Otherwise, it just enables merging bugfixes from 0.4.x into 0.5.x properly.

Conflicts:
	contrib/Bitcoin.app/Contents/Info.plist
	doc/README
	doc/README_windows.txt
	doc/release-process.txt
	share/setup.nsi
	src/bitcoinrpc.cpp
	src/headers.h
	src/makefile.unix
	src/serialize.h
	src/ui.cpp
2011-11-24 19:26:52 -05:00
Nils Schneider
1c4be55a99 update translation: de 2011-11-24 19:20:49 -05:00
Alex B
7597fcd92f Small fixes in both spanish translations 2011-11-24 19:20:14 -05:00
Gavin Andresen
adb9f7ddde Don't forget to bump release numbers in READMEs next time 2011-11-21 15:36:15 -05:00
Gavin Andresen
99fe0af2fe Bump version numbers to 0.5.1 2011-11-21 15:36:10 -05:00
Gavin Andresen
45593c271a Don't forget to bump release numbers in READMEs next time 2011-11-21 15:34:20 -05:00
Luke Dashjr
d885aba347 Bump version to 0.4.2 2011-11-21 13:59:38 -05:00
Pieter Wuille
36b1eb7631 close old db when rewriting 2011-11-20 13:53:07 -05:00
Gavin Andresen
76ef6d89b9 Never remove database files on shutdown, it caused unreadable wallets on some testers' machines. 2011-11-20 13:52:59 -05:00
Gavin Andresen
c4a3bf9e55 Only remove database log files on shutdown after wallet encryption/rewrite 2011-11-17 14:29:18 -05:00
Gavin Andresen
90de05e88e Create new keypool for newly encrypted wallets. 2011-11-17 14:29:12 -05:00
Jeff Garzik
2bf36b4e7d Remove vladimir's DNS seed, at his request. 2011-11-15 17:39:38 -05:00
Gavin Andresen
831d24a19d Tweak handling of boost filesystem versions
(partial cherry pick)
2011-11-15 17:00:38 -05:00
Gavin Andresen
1aafd7464f Fix crash-on-osx-on-shutdown bug. And cleanup CDB handling in Rewrite. 2011-11-15 16:59:52 -05:00
Luke Dashjr
586ea168c2 add message about restarting bitcoin after encrypting wallet succesfully 2011-11-15 11:48:41 -05:00
Luke Dashjr
1179f6373d Update gitian descriptors to point at stable git repo 2011-11-15 10:33:26 -05:00
Gavin Andresen
0143c024af Fix boost filesystem incompatibility problem 2011-11-15 10:12:45 -05:00
Gavin Andresen
2744ea8c1f Obsolete keypool and make sure database removes log files on shutdown. 2011-11-15 10:11:53 -05:00
Pieter Wuille
00eae584a2 Resilvering 2011-11-15 10:03:31 -05:00
Matt Corallo
ef4280e08b Add returns to avoid annoying compile-time warnings. 2011-11-02 11:04:13 -04:00
Matt Corallo
ed176ba584 Only define __STDC_LIMIT_MACROS if not already defined. 2011-11-02 11:02:13 -04:00
cjdelisle
38a976d5bb Added a workaround for an Ubuntu bug which causes -fstack-protector-all to be disregarded. 2011-11-02 10:59:48 -04:00
Gavin Andresen
b526cbaa71 bitcoind does not need to link with gthread-2.0 2011-10-10 16:18:58 -04:00
Luke Dashjr
aec5c5fe26 Bump version to 0.4.1 2011-10-10 14:22:31 -04:00
Victor Leschuk
600dc62559 Fix for 64bit build 2011-10-07 11:04:04 -04:00
Luke Dashjr
030d7acf7d Merge commit '65ba3e2f5024e1e38e119a0c25d5fc30c896cd65' into 0.4.x 2011-10-05 11:06:55 -04:00
Wladimir J. van der Laan
20cff2ade4 remove possibility of 63 bit overflow in ParseMoney 2011-10-01 19:04:24 -04:00
Luke Dashjr
7944d81567 Merge commit '3f94dfa' into stable 2011-09-26 15:37:57 -04:00
65 changed files with 893 additions and 488 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2011 Bitcoin Developers
Copyright (c) 2009-2012 Bitcoin Developers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET =
VERSION = 0.5.1
VERSION = 0.5.3
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB
CONFIG += no_include_pwd
@@ -62,7 +62,7 @@ contains(USE_SSL, 1) {
contains(BITCOIN_NEED_QT_PLUGINS, 1) {
DEFINES += BITCOIN_NEED_QT_PLUGINS
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs
QTPLUGIN += qcncodecs qjpcodecs qtwcodecs qkrcodecs qtaccessiblewidgets
}
!windows {

View File

@@ -1,3 +1,30 @@
bitcoin (0.5.3-natty0) natty; urgency=low
* New upstream release.
-- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Tue, 10 Jan 2012 15:57:00 -0500
bitcoin (0.5.2-natty1) natty; urgency=low
* Remove mentions on anonymity in package descriptions and manpage.
These should never have been there, bitcoin isnt anonymous without
a ton of work that virtually no users will ever be willing and
capable of doing
-- Matt Corallo <matt@bluematt.me> Sat, 7 Jan 2012 13:37:00 -0500
bitcoin (0.5.2-natty0) natty; urgency=low
* New upstream release.
-- Luke Dashjr <luke+bitcoin+deb@dashjr.org> Fri, 16 Dec 2011 17:57:00 -0500
bitcoin (0.5.1-natty0) natty; urgency=low
* New upstream release.
-- Matt Corallo <matt@bluematt.me> Fri, 16 Dec 2011 13:27:00 -0500
bitcoin (0.5.0-natty0) natty; urgency=low
* New upstream release.

View File

@@ -24,7 +24,7 @@ Vcs-Browser: http://github.com/bitcoin/bitcoin
Package: bitcoind
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: peer-to-peer network based anonymous digital currency - daemon
Description: peer-to-peer network based digital currency - daemon
Bitcoin is a free open source peer-to-peer electronic cash system that
is completely decentralized, without the need for a central server or
trusted parties. Users hold the crypto keys to their own money and
@@ -42,7 +42,7 @@ Description: peer-to-peer network based anonymous digital currency - daemon
Package: bitcoin-qt
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: peer-to-peer network based anonymous digital currency - QT GUI
Description: peer-to-peer network based digital currency - QT GUI
Bitcoin is a free open source peer-to-peer electronic cash system that
is completely decentralized, without the need for a central server or
trusted parties. Users hold the crypto keys to their own money and

View File

@@ -1,6 +1,6 @@
.TH BITCOIND "1" "January 2011" "bitcoind 3.19"
.SH NAME
bitcoind \- peer-to-peer network based anonymous digital currency
bitcoind \- peer-to-peer network based digital currency
.SH SYNOPSIS
bitcoin [options] <command> [params]
.TP

View File

@@ -13,7 +13,7 @@ packages:
- "wine"
reference_datetime: "2011-01-30 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git"
"dir": "bitcoin"
files:
- "qt-win32-4.7.4-gitian.zip"

View File

@@ -18,7 +18,7 @@ packages:
- "unzip"
reference_datetime: "2011-01-30 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
- "url": "https://git.gitorious.org/+bitcoin-stable-developers/bitcoin/bitcoind-stable.git"
"dir": "bitcoin"
files:
- "miniupnpc-1.6.tar.gz"
@@ -39,7 +39,7 @@ script: |
cp $OUTDIR/src/COPYING $OUTDIR
cd src
sed 's/$(DEBUGFLAGS)//' -i makefile.unix
make -f makefile.unix STATIC=1 DEFS="-I$INSTDIR/include -L$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 USE_SSL=1
make -f makefile.unix STATIC=1 OPENSSL_INCLUDE_PATH="$INSTDIR/include" OPENSSL_LIB_PATH="$INSTDIR/lib" $MAKEOPTS bitcoind USE_UPNP=0 USE_SSL=1
mkdir -p $OUTDIR/bin/$GBUILD_BITS
install -s bitcoind $OUTDIR/bin/$GBUILD_BITS
cd ..

View File

@@ -1,6 +1,6 @@
Bitcoin 0.5.1 BETA
Bitcoin 0.5.3 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Copyright (c) 2009-2012 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in

View File

@@ -1,6 +1,6 @@
Bitcoin 0.5.1 BETA
Bitcoin 0.5.3 BETA
Copyright (c) 2009-2011 Bitcoin Developers
Copyright (c) 2009-2012 Bitcoin Developers
Distributed under the MIT/X11 software license, see the accompanying
file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in

View File

@@ -1,3 +1,5 @@
* update translations (ping tcatm on IRC for now)
* update (commit) version in sources
bitcoin-qt.pro
src/serialize.h
@@ -77,9 +79,9 @@
Build output expected:
Bitcoin-Qt.dmg
* upload source and builds to SourceForge
* upload builds to SourceForge
* create SHA1SUMS for builds, and PGP-sign it
* create SHA256SUMS for builds, and PGP-sign it
* update bitcoin.org version

View File

@@ -5,7 +5,7 @@ SetCompressor /SOLID lzma
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.5.1
!define VERSION 0.5.3
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
@@ -45,13 +45,13 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.5.1-win32-setup.exe
OutFile bitcoin-0.5.3-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
VIProductVersion 0.5.1.0
VIProductVersion 0.5.3.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -318,7 +318,7 @@ Value getinfo(const Array& params, bool fHelp)
obj.push_back(Pair("keypoolsize", pwalletMain->GetKeyPoolSize()));
obj.push_back(Pair("paytxfee", ValueFromAmount(nTransactionFee)));
if (pwalletMain->IsCrypted())
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime));
obj.push_back(Pair("unlocked_until", (boost::int64_t)nWalletUnlockTime / 1000));
obj.push_back(Pair("errors", GetWarnings("statusbar")));
return obj;
}
@@ -1316,7 +1316,7 @@ Value listsinceblock(const Array& params, bool fHelp)
CBlockIndex *block;
for (block = pindexBest;
block && block->nHeight > target_height;
block = block->pprev);
block = block->pprev) { }
lastblock = block ? block->GetBlockHash() : 0;
}
@@ -1407,37 +1407,43 @@ void ThreadTopUpKeyPool(void* parg)
void ThreadCleanWalletPassphrase(void* parg)
{
int64 nMyWakeTime = GetTime() + *((int*)parg);
int64 nMyWakeTime = GetTimeMillis() + *((int64*)parg) * 1000;
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
if (nWalletUnlockTime == 0)
{
CRITICAL_BLOCK(cs_nWalletUnlockTime)
nWalletUnlockTime = nMyWakeTime;
do
{
nWalletUnlockTime = nMyWakeTime;
}
if (nWalletUnlockTime==0)
break;
int64 nToSleep = nWalletUnlockTime - GetTimeMillis();
if (nToSleep <= 0)
break;
while (GetTime() < nWalletUnlockTime)
Sleep(GetTime() - nWalletUnlockTime);
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
Sleep(nToSleep);
ENTER_CRITICAL_SECTION(cs_nWalletUnlockTime);
CRITICAL_BLOCK(cs_nWalletUnlockTime)
} while(1);
if (nWalletUnlockTime)
{
nWalletUnlockTime = 0;
pwalletMain->Lock();
}
}
else
{
CRITICAL_BLOCK(cs_nWalletUnlockTime)
{
if (nWalletUnlockTime < nMyWakeTime)
nWalletUnlockTime = nMyWakeTime;
}
free(parg);
return;
if (nWalletUnlockTime < nMyWakeTime)
nWalletUnlockTime = nMyWakeTime;
}
pwalletMain->Lock();
LEAVE_CRITICAL_SECTION(cs_nWalletUnlockTime);
delete (int*)parg;
delete (int64*)parg;
}
Value walletpassphrase(const Array& params, bool fHelp)
@@ -1472,7 +1478,7 @@ Value walletpassphrase(const Array& params, bool fHelp)
"Stores the wallet decryption key in memory for <timeout> seconds.");
CreateThread(ThreadTopUpKeyPool, NULL);
int* pnSleepTime = new int(params[1].get_int());
int64* pnSleepTime = new int64(params[1].get_int64());
CreateThread(ThreadCleanWalletPassphrase, pnSleepTime);
return Value::null;
@@ -1525,9 +1531,9 @@ Value walletlock(const Array& params, bool fHelp)
if (!pwalletMain->IsCrypted())
throw JSONRPCError(-15, "Error: running with an unencrypted wallet, but walletlock was called.");
pwalletMain->Lock();
CRITICAL_BLOCK(cs_nWalletUnlockTime)
{
pwalletMain->Lock();
nWalletUnlockTime = 0;
}
@@ -2161,16 +2167,23 @@ void ThreadRPCServer2(void* parg)
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
if (strRPCUserColonPass == ":")
{
unsigned char rand_pwd[32];
RAND_bytes(rand_pwd, 32);
string strWhatAmI = "To use bitcoind";
if (mapArgs.count("-server"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-server\"");
else if (mapArgs.count("-daemon"))
strWhatAmI = strprintf(_("To use the %s option"), "\"-daemon\"");
PrintConsole(
_("Error: %s, you must set rpcpassword=<password>\nin the configuration file: %s\n"
_("Error: %s, you must set a rpcpassword in the configuration file:\n %s\n"
"It is recommended you use the following random password:\n"
"rpcuser=bitcoinrpc\n"
"rpcpassword=%s\n"
"(you do not need to remember this password)\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"),
strWhatAmI.c_str(),
GetConfigFile().c_str());
GetConfigFile().c_str(),
EncodeBase58(&rand_pwd[0],&rand_pwd[0]+32).c_str());
#ifndef QT_GUI
CreateThread(Shutdown, NULL);
#endif
@@ -2259,12 +2272,14 @@ void ThreadRPCServer2(void* parg)
}
if (!HTTPAuthorized(mapHeaders))
{
// Deter brute-forcing short passwords
if (mapArgs["-rpcpassword"].size() < 15)
Sleep(50);
printf("ThreadRPCServer incorrect password attempt from %s\n",peer.address().to_string().c_str());
/* Deter brute-forcing short passwords.
If this results in a DOS the user really
shouldn't have their RPC port exposed.*/
if (mapArgs["-rpcpassword"].size() < 20)
Sleep(250);
stream << HTTPReply(401, "") << std::flush;
printf("ThreadRPCServer incorrect password attempt\n");
continue;
}

View File

@@ -1,4 +1,4 @@
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -30,6 +30,7 @@ namespace Checkpoints
(118000, uint256("0x000000000000774a7f8a7a12dc906ddb9e17e75d684f15e00f8767f9e8f36553"))
(134444, uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe"))
(140700, uint256("0x000000000000033b512028abb90e1626d8b346fd0ed598ac0a3c371138dce2bd"))
(168000, uint256("0x000000000000099e61ea72015e79632f216fe6cb33d7899acb35b75c8303b763"))
;
bool CheckBlock(int nHeight, const uint256& hash)
@@ -52,7 +53,6 @@ namespace Checkpoints
{
if (fTestNet) return NULL;
int64 nResult;
BOOST_REVERSE_FOREACH(const MapCheckpoints::value_type& i, mapCheckpoints)
{
const uint256& hash = i.second;

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -861,12 +861,16 @@ int CWalletDB::LoadWallet(CWallet* pwallet)
CPrivKey pkey;
ssValue >> pkey;
key.SetPrivKey(pkey);
if (key.GetPubKey() != vchPubKey || !key.IsValid())
return DB_CORRUPT;
}
else
{
CWalletKey wkey;
ssValue >> wkey;
key.SetPrivKey(wkey.vchPrivKey);
if (key.GetPubKey() != vchPubKey || !key.IsValid())
return DB_CORRUPT;
}
if (!pwallet->LoadKey(key))
return DB_CORRUPT;

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -83,8 +83,6 @@
#endif
#pragma hdrstop
#include "serialize.h"
#include "uint256.h"
#include "util.h"

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
@@ -20,6 +20,7 @@ Q_IMPORT_PLUGIN(qcncodecs)
Q_IMPORT_PLUGIN(qjpcodecs)
Q_IMPORT_PLUGIN(qtwcodecs)
Q_IMPORT_PLUGIN(qkrcodecs)
Q_IMPORT_PLUGIN(qtaccessiblewidgets)
#endif
using namespace std;
@@ -190,6 +191,7 @@ bool AppInit2(int argc, char* argv[])
" -maxconnections=<n>\t " + _("Maintain at most <n> connections to peers (default: 125)\n") +
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
" -connect=<ip> \t\t " + _("Connect only to the specified node\n") +
" -noirc \t " + _("Don't find peers using internet relay chat\n") +
" -nolisten \t " + _("Don't accept connections from outside\n") +
" -nodnsseed \t " + _("Don't bootstrap list of peers using DNS\n") +
" -banscore=<n> \t " + _("Threshold for disconnecting misbehaving peers (default: 100)\n") +
@@ -203,11 +205,11 @@ bool AppInit2(int argc, char* argv[])
" -upnp \t " + _("Attempt to use UPnP to map the listening port\n") +
#endif
#endif
" -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send\n") +
#ifdef GUI
" -paytxfee=<amt> \t " + _("Fee per kB to add to transactions you send\n") +
#ifdef QT_GUI
" -server \t\t " + _("Accept command line and JSON-RPC commands\n") +
#endif
#ifndef WIN32
#if !defined(WIN32) && !defined(QT_GUI)
" -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
#endif
" -testnet \t\t " + _("Use the test network\n") +
@@ -239,14 +241,19 @@ bool AppInit2(int argc, char* argv[])
// Remove tabs
strUsage.erase(std::remove(strUsage.begin(), strUsage.end(), '\t'), strUsage.end());
#if defined(QT_GUI) && defined(WIN32)
// On windows, show a message box, as there is no stderr
wxMessageBox(strUsage, "Usage");
#else
fprintf(stderr, "%s", strUsage.c_str());
#endif
return false;
}
fTestNet = GetBoolArg("-testnet");
fDebug = GetBoolArg("-debug");
fAllowDNS = GetBoolArg("-dns");
#ifndef WIN32
#if !defined(WIN32) && !defined(QT_GUI)
fDaemon = GetBoolArg("-daemon");
#else
fDaemon = false;
@@ -263,10 +270,6 @@ bool AppInit2(int argc, char* argv[])
#endif
fPrintToConsole = GetBoolArg("-printtoconsole");
fPrintToDebugger = GetBoolArg("-printtodebugger");
fTestNet = GetBoolArg("-testnet");
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
fNoListen = GetBoolArg("-nolisten") || fTOR;
fLogTimestamps = GetBoolArg("-logtimestamps");
#ifndef QT_GUI
@@ -281,7 +284,7 @@ bool AppInit2(int argc, char* argv[])
}
#endif
#ifndef WIN32
#if !defined(WIN32) && !defined(QT_GUI)
if (fDaemon)
{
// Daemonize
@@ -328,16 +331,7 @@ bool AppInit2(int argc, char* argv[])
return false;
}
// Bind to the port early so we can tell if another instance is already running.
string strErrors;
if (!fNoListen)
{
if (!BindListenPort(strErrors))
{
wxMessageBox(strErrors, "Bitcoin");
return false;
}
}
//
// Load data files
@@ -424,6 +418,10 @@ bool AppInit2(int argc, char* argv[])
// Add wallet transactions that aren't already in a block to mapTransactions
pwalletMain->ReacceptWalletTransactions();
// Note: Bitcoin-QT stores several settings in the wallet, so we want
// to load the wallet BEFORE parsing command-line arguments, so
// the command-line/bitcoin.conf settings override GUI setting.
//
// Parameters
//
@@ -476,6 +474,37 @@ bool AppInit2(int argc, char* argv[])
}
}
bool fTor = (fUseProxy && addrProxy.port == htons(9050));
if (fTor)
{
// Use SoftSetArg here so user can override any of these if they wish.
// Note: the GetBoolArg() calls for all of these must happen later.
SoftSetArg("-nolisten", true);
SoftSetArg("-noirc", true);
SoftSetArg("-nodnsseed", true);
SoftSetArg("-noupnp", true);
SoftSetArg("-upnp", false);
SoftSetArg("-dns", false);
}
fAllowDNS = GetBoolArg("-dns");
fNoListen = GetBoolArg("-nolisten");
// Command-line args override in-wallet settings:
if (mapArgs.count("-upnp"))
fUseUPnP = GetBoolArg("-upnp");
else if (mapArgs.count("-noupnp"))
fUseUPnP = !GetBoolArg("-noupnp");
if (!fNoListen)
{
if (!BindListenPort(strErrors))
{
wxMessageBox(strErrors, "Bitcoin");
return false;
}
}
if (mapArgs.count("-addnode"))
{
BOOST_FOREACH(string strAddr, mapMultiArgs["-addnode"])
@@ -498,17 +527,6 @@ bool AppInit2(int argc, char* argv[])
wxMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), "Bitcoin", wxOK | wxICON_EXCLAMATION);
}
if (fHaveUPnP)
{
#if USE_UPNP
if (GetBoolArg("-noupnp"))
fUseUPnP = false;
#else
if (GetBoolArg("-upnp"))
fUseUPnP = true;
#endif
}
//
// Start the node
//

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -110,14 +110,14 @@ bool RecvLine(SOCKET hSocket, string& strLine)
if (nBytes == 0)
{
// socket closed
printf("IRC socket closed\n");
printf("socket closed\n");
return false;
}
else
{
// socket error
int nErr = WSAGetLastError();
printf("IRC recv failed: %d\n", nErr);
printf("recv failed: %d\n", nErr);
return false;
}
}
@@ -264,19 +264,14 @@ void ThreadIRCSeed2(void* parg)
int nErrorWait = 10;
int nRetryWait = 10;
bool fNameInUse = false;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
while (!fShutdown)
{
//CAddress addrConnect("216.155.130.130:6667"); // chat.freenode.net
CAddress addrConnect("92.243.23.21", 6667); // irc.lfnet.org
if (!fTOR)
{
//struct hostent* phostent = gethostbyname("chat.freenode.net");
CAddress addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
}
CAddress addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
@@ -406,10 +401,6 @@ void ThreadIRCSeed2(void* parg)
closesocket(hSocket);
hSocket = INVALID_SOCKET;
// IRC usually blocks TOR, so only try once
if (fTOR)
return;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_KEY_H
@@ -229,10 +229,13 @@ public:
if (vchSecret.size() != 32)
throw key_error("CKey::SetSecret() : secret must be 32 bytes");
BIGNUM *bn = BN_bin2bn(&vchSecret[0],32,BN_new());
if (bn == NULL)
if (bn == NULL)
throw key_error("CKey::SetSecret() : BN_bin2bn failed");
if (!EC_KEY_regenerate_key(pkey,bn))
{
BN_clear_free(bn);
throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed");
}
BN_clear_free(bn);
fSet = true;
return true;
@@ -387,6 +390,17 @@ public:
{
return CBitcoinAddress(GetPubKey());
}
bool IsValid()
{
if (!fSet)
return false;
CSecret secret = GetSecret();
CKey key2;
key2.SetSecret(secret);
return GetPubKey() == key2.GetPubKey();
}
};
#endif

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
@@ -30,7 +30,6 @@ map<COutPoint, CInPoint> mapNextTx;
map<uint256, CBlockIndex*> mapBlockIndex;
uint256 hashGenesisBlock("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f");
static CBigNum bnProofOfWorkLimit(~uint256(0) >> 32);
const int nInitialBlockThreshold = 120; // Regard blocks up until N-threshold as "initial download"
CBlockIndex* pindexGenesisBlock = NULL;
int nBestHeight = -1;
CBigNum bnBestChainWork = 0;
@@ -167,13 +166,14 @@ void static ResendWalletTransactions()
// mapOrphanTransactions
//
void static AddOrphanTx(const CDataStream& vMsg)
void AddOrphanTx(const CDataStream& vMsg)
{
CTransaction tx;
CDataStream(vMsg) >> tx;
uint256 hash = tx.GetHash();
if (mapOrphanTransactions.count(hash))
return;
CDataStream* pvMsg = mapOrphanTransactions[hash] = new CDataStream(vMsg);
BOOST_FOREACH(const CTxIn& txin, tx.vin)
mapOrphanTransactionsByPrev.insert(make_pair(txin.prevout.hash, pvMsg));
@@ -201,6 +201,23 @@ void static EraseOrphanTx(uint256 hash)
mapOrphanTransactions.erase(hash);
}
int LimitOrphanTxSize(int nMaxOrphans)
{
int nEvicted = 0;
while (mapOrphanTransactions.size() > nMaxOrphans)
{
// Evict a random orphan:
std::vector<unsigned char> randbytes(32);
RAND_bytes(&randbytes[0], 32);
uint256 randomhash(randbytes);
map<uint256, CDataStream*>::iterator it = mapOrphanTransactions.lower_bound(randomhash);
if (it == mapOrphanTransactions.end())
it = mapOrphanTransactions.begin();
EraseOrphanTx(it->first);
++nEvicted;
}
return nEvicted;
}
@@ -419,10 +436,11 @@ bool CTransaction::AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs, bool* pfMi
// Check against previous transactions
map<uint256, CTxIndex> mapUnused;
int64 nFees = 0;
if (!ConnectInputs(txdb, mapUnused, CDiskTxPos(1,1,1), pindexBest, nFees, false, false))
bool fInvalid = false;
if (!ConnectInputs(txdb, mapUnused, CDiskTxPos(1,1,1), pindexBest, nFees, false, false, 0, fInvalid))
{
if (pfMissingInputs)
*pfMissingInputs = true;
if (fInvalid)
return error("AcceptToMemoryPool() : FetchInputs found invalid tx %s", hash.ToString().substr(0,10).c_str());
return error("AcceptToMemoryPool() : ConnectInputs failed %s", hash.ToString().substr(0,10).c_str());
}
@@ -669,6 +687,11 @@ static const int64 nInterval = nTargetTimespan / nTargetSpacing;
//
unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
{
// Testnet has min-difficulty blocks
// after nTargetSpacing*2 time between blocks:
if (fTestNet && nTime > nTargetSpacing*2)
return bnProofOfWorkLimit.GetCompact();
CBigNum bnResult;
bnResult.SetCompact(nBase);
while (nTime > 0 && bnResult < bnProofOfWorkLimit)
@@ -683,16 +706,36 @@ unsigned int ComputeMinWork(unsigned int nBase, int64 nTime)
return bnResult.GetCompact();
}
unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast)
unsigned int static GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlock *pblock)
{
unsigned int nProofOfWorkLimit = bnProofOfWorkLimit.GetCompact();
// Genesis block
if (pindexLast == NULL)
return bnProofOfWorkLimit.GetCompact();
return nProofOfWorkLimit;
// Only change once per interval
if ((pindexLast->nHeight+1) % nInterval != 0)
{
// Special rules for testnet after 15 Feb 2012:
if (fTestNet && pblock->nTime > 1329264000)
{
// If the new block's timestamp is more than 2* 10 minutes
// then allow mining of a min-difficulty block.
if (pblock->nTime - pindexLast->nTime > nTargetSpacing*2)
return nProofOfWorkLimit;
else
{
// Return the last non-special-min-difficulty-rules-block
const CBlockIndex* pindex = pindexLast;
while (pindex->pprev && pindex->nHeight % nInterval != 0 && pindex->nBits == nProofOfWorkLimit)
pindex = pindex->pprev;
return pindex->nBits;
}
}
return pindexLast->nBits;
}
// Go back by what we want to be 14 days worth of blocks
const CBlockIndex* pindexFirst = pindexLast;
@@ -750,7 +793,7 @@ int GetNumBlocksOfPeers()
bool IsInitialBlockDownload()
{
if (pindexBest == NULL || nBestHeight < (Checkpoints::GetTotalBlocksEstimate()-nInitialBlockThreshold))
if (pindexBest == NULL || nBestHeight < Checkpoints::GetTotalBlocksEstimate())
return true;
static int64 nLastUpdate;
static CBlockIndex* pindexLastBest;
@@ -814,16 +857,25 @@ bool CTransaction::DisconnectInputs(CTxDB& txdb)
}
// Remove transaction from index
if (!txdb.EraseTxIndex(*this))
return error("DisconnectInputs() : EraseTxPos failed");
// This can fail if a duplicate of this transaction was in a chain that got
// reorganized away. This is only possible if this transaction was completely
// spent, so erasing it would be a no-op anway.
txdb.EraseTxIndex(*this);
return true;
}
bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee)
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee,
bool& fInvalid)
{
// FetchInputs can return false either because we just haven't seen some inputs
// (in which case the transaction should be stored as an orphan)
// or because the transaction is malformed (in which case the transaction should
// be dropped). If tx is definitely invalid, fInvalid will be set to true.
fInvalid = false;
// Take over previous transactions' spent pointers
// fBlock is true when this is called from AcceptBlock when a new best-block is added to the blockchain
// fMiner is true when called from the internal bitcoin miner
@@ -873,7 +925,12 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
}
if (prevout.n >= txPrev.vout.size() || prevout.n >= txindex.vSpent.size())
{
// Revisit this if/when transaction replacement is implemented and allows
// adding inputs:
fInvalid = true;
return DoS(100, error("ConnectInputs() : %s prevout.n out of range %d %d %d prev tx %s\n%s", GetHash().ToString().substr(0,10).c_str(), prevout.n, txPrev.vout.size(), txindex.vSpent.size(), prevout.hash.ToString().substr(0,10).c_str(), txPrev.ToString().c_str()));
}
// If prev is coinbase, check that it's matured
if (txPrev.IsCoinBase())
@@ -881,10 +938,10 @@ bool CTransaction::ConnectInputs(CTxDB& txdb, map<uint256, CTxIndex>& mapTestPoo
if (pindex->nBlockPos == txindex.pos.nBlockPos && pindex->nFile == txindex.pos.nFile)
return error("ConnectInputs() : tried to spend coinbase at depth %d", pindexBlock->nHeight - pindex->nHeight);
// Skip ECDSA signature verification when connecting blocks (fBlock=true) during initial download
// (before the last blockchain checkpoint). This is safe because block merkle hashes are
// Skip ECDSA signature verification when connecting blocks (fBlock=true)
// before the last blockchain checkpoint. This is safe because block merkle hashes are
// still computed and checked, and any change will be caught at the next checkpoint.
if (!(fBlock && IsInitialBlockDownload()))
if (!(fBlock && (nBestHeight < Checkpoints::GetTotalBlocksEstimate())))
// Verify signature
if (!VerifySignature(txPrev, *this, i))
return DoS(100,error("ConnectInputs() : %s VerifySignature failed", GetHash().ToString().substr(0,10).c_str()));
@@ -1013,6 +1070,26 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
if (!CheckBlock())
return false;
// Do not allow blocks that contain transactions which 'overwrite' older transactions,
// unless those are already completely spent.
// If such overwrites are allowed, coinbases and transactions depending upon those
// can be duplicated to remove the ability to spend the first instance -- even after
// being sent to another address.
// See BIP30 and http://r6.ca/blog/20120206T005236Z.html for more information.
// This logic is not necessary for memory pool transactions, as AcceptToMemoryPool
// already refuses previously-known transaction id's entirely.
// This rule applies to all blocks whose timestamp is after March 15, 2012, 0:00 UTC.
// On testnet it is enabled as of februari 20, 2012, 0:00 UTC.
if (pindex->nTime > 1331769600 || (fTestNet && pindex->nTime > 1329696000))
BOOST_FOREACH(CTransaction& tx, vtx)
{
CTxIndex txindexOld;
if (txdb.ReadTxIndex(tx.GetHash(), txindexOld))
BOOST_FOREACH(CDiskTxPos &pos, txindexOld.vSpent)
if (pos.IsNull())
return false;
}
//// issue here: it doesn't know the version
unsigned int nTxPos = pindex->nBlockPos + ::GetSerializeSize(CBlock(), SER_DISK) - 1 + GetSizeOfCompactSize(vtx.size());
@@ -1023,7 +1100,8 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex)
CDiskTxPos posThisTx(pindex->nFile, pindex->nBlockPos, nTxPos);
nTxPos += ::GetSerializeSize(tx, SER_DISK);
if (!tx.ConnectInputs(txdb, mapQueuedChanges, posThisTx, pindex, nFees, true, false))
bool fInvalid;
if (!tx.ConnectInputs(txdb, mapQueuedChanges, posThisTx, pindex, nFees, true, false, 0, fInvalid))
return false;
}
// Write queued txindex changes
@@ -1312,7 +1390,7 @@ bool CBlock::AcceptBlock()
int nHeight = pindexPrev->nHeight+1;
// Check proof of work
if (nBits != GetNextWorkRequired(pindexPrev))
if (nBits != GetNextWorkRequired(pindexPrev, this))
return DoS(100, error("AcceptBlock() : incorrect proof of work"));
// Check timestamp against prev
@@ -1368,7 +1446,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
int64 deltaTime = pblock->GetBlockTime() - pcheckpoint->nTime;
if (deltaTime < 0)
{
pfrom->Misbehaving(100);
if (pfrom)
pfrom->Misbehaving(100);
return error("ProcessBlock() : block with timestamp before last checkpoint");
}
CBigNum bnNewBlock;
@@ -1377,7 +1456,8 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
bnRequired.SetCompact(ComputeMinWork(pcheckpoint->nBits, deltaTime));
if (bnNewBlock > bnRequired)
{
pfrom->Misbehaving(100);
if (pfrom)
pfrom->Misbehaving(100);
return error("ProcessBlock() : block with too little proof-of-work");
}
}
@@ -2184,6 +2264,11 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
printf("storing orphan tx %s\n", inv.hash.ToString().substr(0,10).c_str());
AddOrphanTx(vMsg);
// DoS prevention: do not allow mapOrphanTransactions to grow unbounded
int nEvicted = LimitOrphanTxSize(MAX_ORPHAN_TRANSACTIONS);
if (nEvicted > 0)
printf("mapOrphan overflow, removed %d tx\n", nEvicted);
}
if (tx.nDoS) pfrom->Misbehaving(tx.nDoS);
}
@@ -2828,12 +2913,13 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
// Transaction fee required depends on block size
bool fAllowFree = (nBlockSize + nTxSize < 4000 || CTransaction::AllowFree(dPriority));
int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree, true);
int64 nMinFee = tx.GetMinFee(nBlockSize, fAllowFree);
// Connecting shouldn't fail due to dependency on other memory pool transactions
// because we're already processing them in order of dependency
map<uint256, CTxIndex> mapTestPoolTmp(mapTestPool);
if (!tx.ConnectInputs(txdb, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, nFees, false, true, nMinFee))
bool fInvalid;
if (!tx.ConnectInputs(txdb, mapTestPoolTmp, CDiskTxPos(1,1,1), pindexPrev, nFees, false, true, nMinFee, fInvalid))
continue;
swap(mapTestPool, mapTestPoolTmp);
@@ -2864,7 +2950,7 @@ CBlock* CreateNewBlock(CReserveKey& reservekey)
pblock->hashPrevBlock = pindexPrev->GetBlockHash();
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
pblock->nTime = max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime());
pblock->nBits = GetNextWorkRequired(pindexPrev);
pblock->nBits = GetNextWorkRequired(pindexPrev, pblock.get());
pblock->nNonce = 0;
return pblock.release();

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_MAIN_H
@@ -30,6 +30,7 @@ class CBlockIndex;
static const unsigned int MAX_BLOCK_SIZE = 1000000;
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/2;
static const int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
static const int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100;
static const int64 COIN = 100000000;
static const int64 CENT = 1000000;
static const int64 MIN_TX_FEE = 50000;
@@ -637,7 +638,8 @@ public:
bool ReadFromDisk(COutPoint prevout);
bool DisconnectInputs(CTxDB& txdb);
bool ConnectInputs(CTxDB& txdb, std::map<uint256, CTxIndex>& mapTestPool, CDiskTxPos posThisTx,
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee=0);
CBlockIndex* pindexBlock, int64& nFees, bool fBlock, bool fMiner, int64 nMinFee,
bool& fInvalid);
bool ClientConnectInputs();
bool CheckTransaction() const;
bool AcceptToMemoryPool(CTxDB& txdb, bool fCheckInputs=true, bool* pfMissingInputs=NULL);

View File

@@ -22,6 +22,8 @@ USE_UPNP:=1
LIBS= -dead_strip
ifdef STATIC
# Build STATIC if you are redistributing the bitcoind binary
TESTLIBS += \
$(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
LIBS += \
$(DEPSDIR)/lib/db48/libdb_cxx-4.8.a \
$(DEPSDIR)/lib/libboost_system-mt.a \
@@ -29,8 +31,11 @@ LIBS += \
$(DEPSDIR)/lib/libboost_program_options-mt.a \
$(DEPSDIR)/lib/libboost_thread-mt.a \
$(DEPSDIR)/lib/libssl.a \
$(DEPSDIR)/lib/libcrypto.a
$(DEPSDIR)/lib/libcrypto.a \
-lz
else
TESTLIBS += \
-lboost_unit_test_framework-mt
LIBS += \
-ldb_cxx-4.8 \
-lboost_system-mt \
@@ -38,7 +43,9 @@ LIBS += \
-lboost_program_options-mt \
-lboost_thread-mt \
-lssl \
-lcrypto
-lcrypto \
-lz
TESTDEFS += -DBOOST_TEST_DYN_LINK
endif
DEFS=-DMAC_OSX -DMSG_NOSIGNAL=0 -DUSE_SSL
@@ -98,7 +105,7 @@ all: bitcoind
# auto-generated dependencies:
-include obj/nogui/*.P
-include obj/test/*.P
-include obj-test/*.P
obj/nogui/%.o: %.cpp
$(CXX) -c $(CFLAGS) -MMD -o $@ $<
@@ -111,20 +118,20 @@ bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
obj/test/%.o: test/%.cpp
$(CXX) -c $(CFLAGS) -MMD -o $@ $<
$(CXX) -c $(TESTDEFS) $(CFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) $(DEPSDIR)/lib/libboost_unit_test_framework-mt.a
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) $(TESTLIBS)
clean:
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f obj/test/*.o
-rm -f obj-test/*.o
-rm -f obj/*.P
-rm -f obj/nogui/*.P
-rm -f obj/test/*.P
-rm -f obj-test/*.P

View File

@@ -7,7 +7,7 @@ USE_UPNP:=0
DEFS=-DNOPCH
DEFS += $(addprefix -I,$(BOOST_INCLUDE_PATH) $(BDB_INCLUDE_PATH) $(OPENSSL_INCLUDE_PATH))
LIBS += $(addprefix -l,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
LIBS = $(addprefix -L,$(BOOST_LIB_PATH) $(BDB_LIB_PATH) $(OPENSSL_LIB_PATH))
LMODE = dynamic
LMODE2 = dynamic
@@ -16,10 +16,12 @@ ifdef STATIC
ifeq (${STATIC}, all)
LMODE2 = static
endif
else
TESTDEFS += -DBOOST_TEST_DYN_LINK
endif
# for boost 1.37, add -mt to the boost libraries
LIBS= \
LIBS += \
-Wl,-B$(LMODE) \
-l boost_system$(BOOST_LIB_SUFFIX) \
-l boost_filesystem$(BOOST_LIB_SUFFIX) \
@@ -127,7 +129,7 @@ all: bitcoind
# auto-generated dependencies:
-include obj/nogui/*.P
-include obj/test/*.P
-include obj-test/*.P
obj/nogui/%.o: %.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
@@ -139,21 +141,21 @@ obj/nogui/%.o: %.cpp
bitcoind: $(OBJS:obj/%=obj/nogui/%)
$(CXX) $(xCXXFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
obj/test/%.o: test/%.cpp
$(CXX) -c $(xCXXFLAGS) -MMD -o $@ $<
obj-test/%.o: test/%.cpp
$(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -o $@ $<
@cp $(@:%.o=%.d) $(@:%.o=%.P); \
sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
-e '/^$$/ d' -e 's/$$/ :/' < $(@:%.o=%.d) >> $(@:%.o=%.P); \
rm -f $(@:%.o=%.d)
test_bitcoin: obj/test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
$(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-Bstatic -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
test_bitcoin: obj-test/test_bitcoin.o $(filter-out obj/nogui/init.o,$(OBJS:obj/%=obj/nogui/%))
$(CXX) $(xCXXFLAGS) -o $@ $(LIBPATHS) $^ -Wl,-B$(LMODE) -lboost_unit_test_framework $(LDFLAGS) $(LIBS)
clean:
-rm -f bitcoind test_bitcoin
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f obj/test/*.o
-rm -f obj-test/*.o
-rm -f obj/*.P
-rm -f obj/nogui/*.P
-rm -f obj/test/*.P
-rm -f obj-test/*.P

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
@@ -496,21 +496,25 @@ bool AddAddress(CAddress addr, int64 nTimePenalty, CAddrDB *pAddrDB)
void AddressCurrentlyConnected(const CAddress& addr)
{
CAddress *paddrFound = NULL;
CRITICAL_BLOCK(cs_mapAddresses)
{
// Only if it's been published already
map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey());
if (it != mapAddresses.end())
paddrFound = &(*it).second;
}
if (paddrFound)
{
int64 nUpdateInterval = 20 * 60;
if (paddrFound->nTime < GetAdjustedTime() - nUpdateInterval)
{
CAddress& addrFound = (*it).second;
int64 nUpdateInterval = 20 * 60;
if (addrFound.nTime < GetAdjustedTime() - nUpdateInterval)
{
// Periodically update most recently seen time
addrFound.nTime = GetAdjustedTime();
CAddrDB addrdb;
addrdb.WriteAddress(addrFound);
}
// Periodically update most recently seen time
paddrFound->nTime = GetAdjustedTime();
CAddrDB addrdb;
addrdb.WriteAddress(*paddrFound);
}
}
}
@@ -927,13 +931,17 @@ void ThreadSocketHandler2(void* parg)
struct sockaddr_in sockaddr;
socklen_t len = sizeof(sockaddr);
SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len);
CAddress addr(sockaddr);
CAddress addr;
int nInbound = 0;
if (hSocket != INVALID_SOCKET)
addr = CAddress(sockaddr);
CRITICAL_BLOCK(cs_vNodes)
BOOST_FOREACH(CNode* pnode, vNodes)
if (pnode->fInbound)
nInbound++;
if (hSocket == INVALID_SOCKET)
{
if (WSAGetLastError() != WSAEWOULDBLOCK)
@@ -945,7 +953,7 @@ void ThreadSocketHandler2(void* parg)
}
else if (CNode::IsBanned(addr.ip))
{
printf("connetion from %s dropped (banned)\n", addr.ToString().c_str());
printf("connection from %s dropped (banned)\n", addr.ToString().c_str());
closesocket(hSocket);
}
else
@@ -1129,7 +1137,6 @@ void ThreadMapPort2(void* parg)
char port[6];
sprintf(port, "%d", GetListenPort());
const char * rootdescurl = 0;
const char * multicastif = 0;
const char * minissdpdpath = 0;
struct UPNPDev * devlist = 0;
@@ -1151,17 +1158,35 @@ void ThreadMapPort2(void* parg)
r = UPNP_GetValidIGD(devlist, &urls, &data, lanaddr, sizeof(lanaddr));
if (r == 1)
{
char intClient[16];
char intPort[6];
if (!addrLocalHost.IsRoutable())
{
char externalIPAddress[40];
r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, externalIPAddress);
if(r != UPNPCOMMAND_SUCCESS)
printf("UPnP: GetExternalIPAddress() returned %d\n", r);
else
{
if(externalIPAddress[0])
{
printf("UPnP: ExternalIPAddress = %s\n", externalIPAddress);
CAddress addrExternalFromUPnP(externalIPAddress, 0, false, nLocalServices);
if (addrExternalFromUPnP.IsRoutable())
addrLocalHost = addrExternalFromUPnP;
}
else
printf("UPnP: GetExternalIPAddress failed.\n");
}
}
string strDesc = "Bitcoin " + FormatFullVersion();
#ifndef UPNPDISCOVER_SUCCESS
/* miniupnpc 1.5 */
/* miniupnpc 1.5 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, strDesc.c_str(), "TCP", 0);
port, port, lanaddr, strDesc.c_str(), "TCP", 0);
#else
/* miniupnpc 1.6 */
/* miniupnpc 1.6 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
#endif
if(r!=UPNPCOMMAND_SUCCESS)
@@ -1169,6 +1194,7 @@ void ThreadMapPort2(void* parg)
port, port, lanaddr, r, strupnperror(r));
else
printf("UPnP Port Mapping successful.\n");
int i = 1;
loop {
if (fShutdown || !fUseUPnP)
{
@@ -1178,7 +1204,26 @@ void ThreadMapPort2(void* parg)
FreeUPNPUrls(&urls);
return;
}
if (i % 600 == 0) // Refresh every 20 minutes
{
#ifndef UPNPDISCOVER_SUCCESS
/* miniupnpc 1.5 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, strDesc.c_str(), "TCP", 0);
#else
/* miniupnpc 1.6 */
r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype,
port, port, lanaddr, strDesc.c_str(), "TCP", 0, "0");
#endif
if(r!=UPNPCOMMAND_SUCCESS)
printf("AddPortMapping(%s, %s, %s) failed with code %d (%s)\n",
port, port, lanaddr, r, strupnperror(r));
else
printf("UPnP Port Mapping successful.\n");;
}
Sleep(2000);
i++;
}
} else {
printf("No valid UPnP IGDs found\n");
@@ -1225,6 +1270,8 @@ void MapPort(bool /* unused fMapPort */)
static const char *strDNSSeed[] = {
"bitseed.xf2.org",
"dnsseed.bluematt.me",
"seed.bitcoin.sipa.be",
"dnsseed.bitcoin.dashjr.org",
};
void ThreadDNSAddressSeed(void* parg)
@@ -1254,13 +1301,13 @@ void ThreadDNSAddressSeed2(void* parg)
if (!fTestNet)
{
printf("Loading addresses from DNS seeds (could take a while)\n");
CAddrDB addrDB;
addrDB.TxnBegin();
for (int seed_idx = 0; seed_idx < ARRAYLEN(strDNSSeed); seed_idx++) {
vector<CAddress> vaddr;
if (Lookup(strDNSSeed[seed_idx], vaddr, NODE_NETWORK, -1, true))
{
CAddrDB addrDB;
addrDB.TxnBegin();
BOOST_FOREACH (CAddress& addr, vaddr)
{
if (addr.GetByte(3) != 127)
@@ -1270,10 +1317,9 @@ void ThreadDNSAddressSeed2(void* parg)
found++;
}
}
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
}
}
addrDB.TxnCommit(); // Save addresses (it's ok if this fails)
}
printf("%d addresses found from DNS seeds\n", found);
@@ -1292,70 +1338,83 @@ void ThreadDNSAddressSeed2(void* parg)
unsigned int pnSeed[] =
{
0x6884ac63, 0x3ffecead, 0x2919b953, 0x0942fe50, 0x7a1d922e, 0xcdd6734a, 0x953a5bb6, 0x2c46922e,
0xe2a5f143, 0xaa39103a, 0xa06afa5c, 0x135ffd59, 0xe8e82863, 0xf61ef029, 0xf75f042e, 0x2b363532,
0x29b2df42, 0x16b1f64e, 0xd46e281b, 0x5280bf58, 0x60372229, 0x1be58e4f, 0xa8496f45, 0x1fb1a057,
0x756b3844, 0x3bb79445, 0x0b375518, 0xcccb0102, 0xb682bf2e, 0x46431c02, 0x3a81073a, 0xa3771f1f,
0x213a121f, 0x85dc2c1b, 0x56b4323b, 0xb34e8945, 0x3c40b33d, 0xfa276418, 0x1f818d29, 0xebe1e344,
0xf6160a18, 0xf4fa384a, 0x34b09558, 0xb882b543, 0xe3ce2253, 0x6abf56d8, 0xe91b1155, 0x688ee6ad,
0x2efc6058, 0x4792cd47, 0x0c32f757, 0x4c813a46, 0x8c93644a, 0x37507444, 0x813ad218, 0xdac06d4a,
0xe4c63e4b, 0x21a1ea3c, 0x8d88556f, 0x30e9173a, 0x041f681b, 0xdc77ba50, 0xc0072753, 0xceddd44f,
0x052d1743, 0xe3c77a4a, 0x13981c3a, 0x5685d918, 0x3c0e4e70, 0x3e56fb54, 0xb676ae0c, 0xac93c859,
0x22279f43, 0x975a4542, 0xe527f071, 0xea162f2e, 0x3c65a32e, 0x5be5713b, 0x961ec418, 0xb202922e,
0x5ef7be50, 0xce49f53e, 0x05803b47, 0x8463b055, 0x78576153, 0x3ec2ae3a, 0x4bbd7118, 0xafcee043,
0x56a3e8ba, 0x6174de4d, 0x8d01ba4b, 0xc9af564e, 0xdbc9c547, 0xa627474d, 0xdada9244, 0xd3b3083a,
0x523e071f, 0xd6b96f18, 0xbd527c46, 0xdf2bbb4d, 0xd37b4a4b, 0x3a6a2158, 0xc064b055, 0x18a8e055,
0xec4dae3b, 0x0540416c, 0x475b4fbe, 0x064803b2, 0x48e9f062, 0x2898524b, 0xd315ff43, 0xf786d247,
0xc7ea2f3e, 0xc087f043, 0xc163354b, 0x8250284d, 0xed300029, 0xbf36e05c, 0x8eb3ae4c, 0xe7aa623e,
0x7ced0274, 0xdd362c1b, 0x362b995a, 0xca26b629, 0x3fc41618, 0xb97b364e, 0xa05b8729, 0x0f5e3c43,
0xdf942618, 0x6aeb9b5b, 0xbf04762e, 0xfaaeb118, 0x87579958, 0x76520044, 0xc2660c5b, 0x628b201b,
0xf193932e, 0x1c0ad045, 0xff908346, 0x8da9d4da, 0xed201c1f, 0xa47a2b1b, 0x330007d4, 0x8ba1ed47,
0xb2f02d44, 0x7db62c1b, 0x781c454b, 0xc0300029, 0xb7062a45, 0x88b52e3a, 0x78dd6b63, 0x1cb9b718,
0x5d358e47, 0x59912c3b, 0x79607544, 0x5197f759, 0xc023be48, 0xd1013743, 0x0f354057, 0x8e3aac3b,
0x4114693e, 0x22316318, 0xe27dda50, 0x878eac3b, 0x4948a21f, 0x5db7f24c, 0x8ccb6157, 0x26a5de18,
0x0a11bd43, 0x27bb1e41, 0x60a7a951, 0x3e16b35e, 0x07888b53, 0x5648a853, 0x0149fe50, 0xd070a34f,
0x6454c96d, 0xd6e54758, 0xa96dc152, 0x65447861, 0xf6bdf95e, 0x10400202, 0x2c29d483, 0x18174732,
0x1d840618, 0x12e61818, 0x089d3f3c, 0x917e931f, 0xd1b0c90e, 0x25bd3c42, 0xeb05775b, 0x7d550c59,
0x6cfacb01, 0xe4224444, 0xa41dd943, 0x0f5aa643, 0x5e33731b, 0x81036d50, 0x6f46a0d1, 0x7731be43,
0x14840e18, 0xf1e8d059, 0x661d2b1f, 0x40a3201b, 0x9407b843, 0xedf0254d, 0x7bd1a5bc, 0x073dbe51,
0xe864a97b, 0x2efd947b, 0xb9ca0e45, 0x4e2113ad, 0xcc305731, 0xd39ca63c, 0x733df918, 0xda172b1f,
0xaa03b34d, 0x7230fd4d, 0xf1ce6e3a, 0x2e9fab43, 0xa4010750, 0xa928bd18, 0x6809be42, 0xb19de348,
0xff956270, 0x0d795f51, 0xd2dec247, 0x6df5774b, 0xbac11f79, 0xdfb05c75, 0x887683d8, 0xa1e83632,
0x2c0f7671, 0x28bcb65d, 0xac2a7545, 0x3eebfc60, 0x304ad7c4, 0xa215a462, 0xc86f0f58, 0xcfb92ebe,
0x5e23ed82, 0xf506184b, 0xec0f19b7, 0x060c59ad, 0x86ee3174, 0x85380774, 0xa199a562, 0x02b507ae,
0x33eb2163, 0xf2112b1f, 0xb702ba50, 0x131b9618, 0x90ccd04a, 0x08f3273b, 0xecb61718, 0x64b8b44d,
0x182bf4dc, 0xc7b68286, 0x6e318d5f, 0xfdb03654, 0xb3272e54, 0xe014ad4b, 0x274e4a31, 0x7806375c,
0xbc34a748, 0x1b5ad94a, 0x6b54d10e, 0x73e2ae6e, 0x5529d483, 0x8455a76d, 0x99c13f47, 0x1d811741,
0xa9782a78, 0x0b00464d, 0x7266ea50, 0x532dab46, 0x33e1413e, 0x780d0c18, 0x0fb0854e, 0x03370155,
0x2693042e, 0xfa3d824a, 0x2bb1681b, 0x37ea2a18, 0x7fb8414b, 0x32e0713b, 0xacf38d3f, 0xa282716f,
0xb1a09d7b, 0xa04b764b, 0x83c94d18, 0x05ee4c6d, 0x0e795f51, 0x46984352, 0xf80fc247, 0x3fccb946,
0xd7ae244b, 0x0a8e0a4c, 0x57b141bc, 0x3647bed1, 0x1431b052, 0x803a8bbb, 0xfc69056b, 0xf5991862,
0x14963b2e, 0xd35d5dda, 0xc6c73574, 0xc8f1405b, 0x0ca4224d, 0xecd36071, 0xa9461754, 0xe7a0ed72,
0x559e8346, 0x1c9beec1, 0xc786ea4a, 0x9561b44d, 0x9788074d, 0x1a69934f, 0x23c5614c, 0x07c79d4b,
0xc7ee52db, 0xc72df351, 0xcb135e44, 0xa0988346, 0xc211fc4c, 0x87dec34b, 0x1381074d, 0x04a65cb7,
0x4409083a, 0x4a407a4c, 0x92b8d37d, 0xacf50b4d, 0xa58aa5bc, 0x448f801f, 0x9c83762e, 0x6fd5734a,
0xfe2d454b, 0x84144c55, 0x05190e4c, 0xb2151448, 0x63867a3e, 0x16099018, 0x9c010d3c, 0x962d8f3d,
0xd51ee453, 0x9d86801f, 0x68e87b47, 0x6bf7bb73, 0x5fc7910e, 0x10d90118, 0x3db04442, 0x729d3e4b,
0xc397d842, 0x57bb15ad, 0x72f31f4e, 0xc9380043, 0x2bb24e18, 0xd9b8ab50, 0xb786801f, 0xf4dc4847,
0x85f4bb51, 0x4435995b, 0x5ba07e40, 0x2c57392e, 0x3628124b, 0x9839b64b, 0x6fe8b24d, 0xaddce847,
0x75260e45, 0x0c572a43, 0xfea21902, 0xb9f9742e, 0x5a70d443, 0x8fc5910e, 0x868d4744, 0x56245e02,
0xd7eb5f02, 0x35c12c1b, 0x4373034b, 0x8786554c, 0xa6facf18, 0x4b11a31f, 0x3570664e, 0x5a64bc42,
0x0b03983f, 0x8f457e4c, 0x0fd874c3, 0xb6cf31b2, 0x2bbc2d4e, 0x146ca5b2, 0x9d00b150, 0x048a4153,
0xca4dcd43, 0xc1607cca, 0x8234cf57, 0x9c7daead, 0x3dc07658, 0xea5c6e4c, 0xf1a0084e, 0x16d2ee53,
0x1b849418, 0xfe913a47, 0x1e988f62, 0x208b644c, 0xc55ee980, 0xbdbce747, 0xf59a384e, 0x0f56091b,
0x7417b745, 0x0c37344e, 0x2c62ab47, 0xf8533a4d, 0x8030084d, 0x76b93c4b, 0xda6ea0ad, 0x3c54f618,
0x63b0de1f, 0x7370d858, 0x1a70bb4c, 0xdda63b2e, 0x60b2ba50, 0x1ba7d048, 0xbe1b2c1b, 0xabea5747,
0x29ad2e4d, 0xe8cd7642, 0x66c80e18, 0x138bf34a, 0xc6145e44, 0x2586794c, 0x07bc5478, 0x0da0b14d,
0x8f95354e, 0x9eb11c62, 0xa1545e46, 0x2e7a2602, 0x408c9c3d, 0x59065d55, 0xf51d1a4c, 0x3bbc6a4e,
0xc71b2a2e, 0xcdaaa545, 0x17d659d0, 0x5202e7ad, 0xf1b68445, 0x93375961, 0xbd88a043, 0x066ad655,
0x890f6318, 0x7b7dca47, 0x99bdd662, 0x3bb4fc53, 0x1231efdc, 0xc0a99444, 0x96bbea47, 0x61ed8748,
0x27dfa73b, 0x8d4d1754, 0x3460042e, 0x551f0c4c, 0x8d0e0718, 0x162ddc53, 0x53231718, 0x1ecd65d0,
0x944d28bc, 0x3b79d058, 0xaff97fbc, 0x4860006c, 0xc101c90e, 0xace41743, 0xa5975d4c, 0x5cc2703e,
0xb55a4450, 0x02d18840, 0xee2765ae, 0xd6012fd5, 0x24c94d7d, 0x8c6eec47, 0x7520ba5d, 0x9e15e460,
0x8510b04c, 0x75ec3847, 0x1dfa6661, 0xe172b3ad, 0x5744c90e, 0x52a0a152, 0x8d6fad18, 0x67b74b6d,
0x93a089b2, 0x0f3ac5d5, 0xe5de1855, 0x43d25747, 0x4bad804a, 0x55b408d8, 0x60a36441, 0xf553e860,
0xdb2fa2c8, 0x03152b32, 0xdd27a7d5, 0x3116a8b8, 0x0a1d708c, 0xeee2f13c, 0x6acf436f, 0xce6eb4ca,
0x101cd3d9, 0x1c48a6b8, 0xe57d6f44, 0x93dcf562,
0x959bd347, 0xf8de42b2, 0x73bc0518, 0xea6edc50, 0x21b00a4d, 0xc725b43d, 0xd665464d, 0x1a2a770e,
0x27c93946, 0x65b2fa46, 0xb80ae255, 0x66b3b446, 0xb1877a3e, 0x6ee89e3e, 0xc3175b40, 0x2a01a83c,
0x95b1363a, 0xa079ad3d, 0xe6ca801f, 0x027f4f4a, 0x34f7f03a, 0xf790f04a, 0x16ca801f, 0x2f4d5e40,
0x3a4d5e40, 0xc43a322e, 0xc8159753, 0x14d4724c, 0x7919a118, 0xe0bdb34e, 0x68a16b2e, 0xff64b44d,
0x6099115b, 0x9b57b05b, 0x7bd1b4ad, 0xdf95944f, 0x29d2b73d, 0xafa8db79, 0xe247ba41, 0x24078348,
0xf722f03c, 0x33567ebc, 0xace64ed4, 0x984d3932, 0xb5f34e55, 0x27b7024d, 0x94579247, 0x8894042e,
0x9357d34c, 0x1063c24b, 0xcaa228b1, 0xa3c5a8b2, 0x5dc64857, 0xa2c23643, 0xa8369a54, 0x31203077,
0x00707c5c, 0x09fc0b3a, 0x272e9e2e, 0xf80f043e, 0x9449ca3e, 0x5512c33e, 0xd106b555, 0xe8024157,
0xe288ec29, 0xc79c5461, 0xafb63932, 0xdb02ab4b, 0x0e512777, 0x8a145a4c, 0xb201ff4f, 0x5e09314b,
0xcd9bfbcd, 0x1c023765, 0x4394e75c, 0xa728bd4d, 0x65331552, 0xa98420b1, 0x89ecf559, 0x6e80801f,
0xf404f118, 0xefd62b51, 0x05918346, 0x9b186d5f, 0xacabab46, 0xf912e255, 0xc188ea62, 0xcc55734e,
0xc668064d, 0xd77a4558, 0x46201c55, 0xf17dfc80, 0xf7142f2e, 0x87bfb718, 0x8aa54fb2, 0xc451d518,
0xc4ae8831, 0x8dd44d55, 0x5bbd206c, 0x64536b5d, 0x5c667e60, 0x3b064242, 0xfe963a42, 0xa28e6dc8,
0xe8a9604a, 0xc989464e, 0xd124a659, 0x50065140, 0xa44dfe5e, 0x1079e655, 0x3fb986d5, 0x47895b18,
0x7d3ce4ad, 0x4561ba50, 0x296eec62, 0x255b41ad, 0xaed35ec9, 0x55556f12, 0xc7d3154d, 0x3297b65d,
0x8930121f, 0xabf42e4e, 0x4a29e044, 0x1212685d, 0x676c1e40, 0xce009744, 0x383a8948, 0xa2dbd0ad,
0xecc2564d, 0x07dbc252, 0x887ee24b, 0x5171644c, 0x6bb798c1, 0x847f495d, 0x4cbb7145, 0x3bb81c32,
0x45eb262e, 0xc8015a4e, 0x250a361b, 0xf694f946, 0xd64a183e, 0xd4f1dd59, 0x8f20ffd4, 0x51d9e55c,
0x09521763, 0x5e02002e, 0x32c8074d, 0xe685762e, 0x8290b0bc, 0x762a922e, 0xfc5ee754, 0x83a24829,
0x775b224d, 0x6295bb4d, 0x38ec0555, 0xbffbba50, 0xe5560260, 0x86b16a7c, 0xd372234e, 0x49a3c24b,
0x2f6a171f, 0x4d75ed60, 0xae94115b, 0xcb543744, 0x63080c59, 0x3f9c724c, 0xc977ce18, 0x532efb18,
0x69dc3b2e, 0x5f94d929, 0x1732bb4d, 0x9c814b4d, 0xe6b3762e, 0xc024f662, 0x8face35b, 0x6b5b044d,
0x798c7b57, 0x79a6b44c, 0x067d3057, 0xf9e94e5f, 0x91cbe15b, 0x71405eb2, 0x2662234e, 0xcbcc4a6d,
0xbf69d54b, 0xa79b4e55, 0xec6d3e51, 0x7c0b3c02, 0x60f83653, 0x24c1e15c, 0x1110b62e, 0x10350f59,
0xa56f1d55, 0x3509e7a9, 0xeb128354, 0x14268e2e, 0x934e28bc, 0x8e32692e, 0x8331a21f, 0x3e633932,
0xc812b12e, 0xc684bf2e, 0x80112d2e, 0xe0ddc96c, 0xc630ca4a, 0x5c09b3b2, 0x0b580518, 0xc8e9d54b,
0xd169aa43, 0x17d0d655, 0x1d029963, 0x7ff87559, 0xcb701f1f, 0x6fa3e85d, 0xe45e9a54, 0xf05d1802,
0x44d03b2e, 0x837b692e, 0xccd4354e, 0x3d6da13c, 0x3423084d, 0xf707c34a, 0x55f6db3a, 0xad26e442,
0x6233a21f, 0x09e80e59, 0x8caeb54d, 0xbe870941, 0xb407d20e, 0x20b51018, 0x56fb152e, 0x460d2a4e,
0xbb9a2946, 0x560eb12e, 0xed83dd29, 0xd6724f53, 0xa50aafb8, 0x451346d9, 0x88348e2e, 0x7312fead,
0x8ecaf96f, 0x1bda4e5f, 0xf1671e40, 0x3c8c3e3b, 0x4716324d, 0xdde24ede, 0xf98cd17d, 0xa91d4644,
0x28124eb2, 0x147d5129, 0xd022042e, 0x61733d3b, 0xad0d5e02, 0x8ce2932e, 0xe5c18502, 0x549c1e32,
0x9685801f, 0x86e217ad, 0xd948214b, 0x4110f462, 0x3a2e894e, 0xbd35492e, 0x87e0d558, 0x64b8ef7d,
0x7c3eb962, 0x72a84b3e, 0x7cd667c9, 0x28370a2e, 0x4bc60e7b, 0x6fc1ec60, 0x14a6983f, 0x86739a4b,
0x46954e5f, 0x32e2e15c, 0x2e9326cf, 0xe5801c5e, 0x379607b2, 0x32151145, 0xf0e39744, 0xacb54c55,
0xa37dfb60, 0x83b55cc9, 0x388f7ca5, 0x15034f5f, 0x3e94965b, 0x68e0ffad, 0x35280f59, 0x8fe190cf,
0x7c6ba5b2, 0xa5e9db43, 0x4ee1fc60, 0xd9d94e5f, 0x04040677, 0x0ea9b35e, 0x5961f14f, 0x67fda063,
0xa48a5a31, 0xc6524e55, 0x283d325e, 0x3f37515f, 0x96b94b3e, 0xacce620e, 0x6481cc5b, 0xa4a06d4b,
0x9e95d2d9, 0xe40c03d5, 0xc2f4514b, 0xb79aad44, 0xf64be843, 0xb2064070, 0xfca00455, 0x429dfa4e,
0x2323f173, 0xeda4185e, 0xabd5227d, 0x9efd4d58, 0xb1104758, 0x4811e955, 0xbd9ab355, 0xe921f44b,
0x9f166dce, 0x09e279b2, 0xe0c9ac7b, 0x7901a5ad, 0xa145d4b0, 0x79104671, 0xec31e35a, 0x4fe0b555,
0xc7d9cbad, 0xad057f55, 0xe94cc759, 0x7fe0b043, 0xe4529f2e, 0x0d4dd4b2, 0x9f11a54d, 0x031e2e4e,
0xe6014f5f, 0x11d1ca6c, 0x26bd7f61, 0xeb86854f, 0x4d347b57, 0x116bbe2e, 0xdba7234e, 0x7bcbfd2e,
0x174dd4b2, 0x6686762e, 0xb089ba50, 0xc6258246, 0x087e767b, 0xc4a8cb4a, 0x595dba50, 0x7f0ae502,
0x7b1dbd5a, 0xa0603492, 0x57d1af4b, 0x9e21ffd4, 0x6393064d, 0x7407376e, 0xe484762e, 0x122a4e53,
0x4a37aa43, 0x3888a6be, 0xee77864e, 0x039c8dd5, 0x688d89af, 0x0e988f62, 0x08218246, 0xfc2f8246,
0xd1d97040, 0xd64cd4b2, 0x5ae4a6b8, 0x7d0de9bc, 0x8d304d61, 0x06c5c672, 0xa4c8bd4d, 0xe0fd373b,
0x575ebe4d, 0x72d26277, 0x55570f55, 0x77b154d9, 0xe214293a, 0xfc740f4b, 0xfe3f6a57, 0xa9c55f02,
0xae4054db, 0x2394d918, 0xb511b24a, 0xb8741ab2, 0x0758e65e, 0xc7b5795b, 0xb0a30a4c, 0xaf7f170c,
0xf3b4762e, 0x8179576d, 0x738a1581, 0x4b95b64c, 0x9829b618, 0x1bea932e, 0x7bdeaa4b, 0xcb5e0281,
0x65618f54, 0x0658474b, 0x27066acf, 0x40556d65, 0x7d204d53, 0xf28bc244, 0xdce23455, 0xadc0ff54,
0x3863c948, 0xcee34e5f, 0xdeb85e02, 0x2ed17a61, 0x6a7b094d, 0x7f0cfc40, 0x59603f54, 0x3220afbc,
0xb5dfd962, 0x125d21c0, 0x13f8d243, 0xacfefb4e, 0x86c2c147, 0x3d8bbd59, 0xbd02a21f, 0x2593042e,
0xc6a17a7c, 0x28925861, 0xb487ed44, 0xb5f4fd6d, 0x90c28a45, 0x5a14f74d, 0x43d71b4c, 0x728ebb5d,
0x885bf950, 0x08134dd0, 0x38ec046e, 0xc575684b, 0x50082d2e, 0xa2f47757, 0x270f86ae, 0xf3ff6462,
0x10ed3f4e, 0x4b58d462, 0xe01ce23e, 0x8c5b092e, 0x63e52f4e, 0x22c1e85d, 0xa908f54e, 0x8591624f,
0x2c0fb94e, 0xa280ba3c, 0xb6f41b4c, 0x24f9aa47, 0x27201647, 0x3a3ea6dc, 0xa14fc3be, 0x3c34bdd5,
0x5b8d4f5b, 0xaadeaf4b, 0xc71cab50, 0x15697a4c, 0x9a1a734c, 0x2a037d81, 0x2590bd59, 0x48ec2741,
0x53489c5b, 0x7f00314b, 0x2170d362, 0xf2e92542, 0x42c10b44, 0x98f0f118, 0x883a3456, 0x099a932e,
0xea38f7bc, 0x644e9247, 0xbb61b62e, 0x30e0863d, 0x5f51be54, 0x207215c7, 0x5f306c45, 0xaa7f3932,
0x98da7d45, 0x4e339b59, 0x2e411581, 0xa808f618, 0xad2c0c59, 0x54476741, 0x09e99fd1, 0x5db8f752,
0xc16df8bd, 0x1dd4b44f, 0x106edf2e, 0x9e15c180, 0x2ad6b56f, 0x633a5332, 0xff33787c, 0x077cb545,
0x6610be6d, 0x75aad2c4, 0x72fb4d5b, 0xe81e0f59, 0x576f6332, 0x47333373, 0x351ed783, 0x2d90fb50,
0x8d5e0f6c, 0x5b27a552, 0xdb293ebb, 0xe55ef950, 0x4b133ad8, 0x75df975a, 0x7b6a8740, 0xa899464b,
0xfab15161, 0x10f8b64d, 0xd055ea4d, 0xee8e146b, 0x4b14afb8, 0x4bc1c44a, 0x9b961dcc, 0xd111ff43,
0xfca0b745, 0xc800e412, 0x0afad9d1, 0xf751c350, 0xf9f0cccf, 0xa290a545, 0x8ef13763, 0x7ec70d59,
0x2b066acf, 0x65496c45, 0xade02c1b, 0xae6eb077, 0x92c1e65b, 0xc064e6a9, 0xc649e56d, 0x5287a243,
0x36de4f5b, 0x5b1df6ad, 0x65c39a59, 0xdba805b2, 0x20067aa8, 0x6457e56d, 0x3cee26cf, 0xfd3ff26d,
0x04f86d4a, 0x06b8e048, 0xa93bcd5c, 0x91135852, 0xbe90a643, 0x8fa0094d, 0x06d8215f, 0x2677094d,
0xd735685c, 0x164a00c9, 0x5209ac5f, 0xa9564c5c, 0x3b504f5f, 0xcc826bd0, 0x4615042e, 0x5fe13b4a,
0x8c81b86d, 0x879ab68c, 0x1de564b8, 0x434487d8, 0x2dcb1b63, 0x82ab524a, 0xb0676abb, 0xa13d9c62,
0xdbb5b86d, 0x5b7f4b59, 0xaddfb44d, 0xad773532, 0x3997054c, 0x72cebd89, 0xb194544c, 0xc5b8046e,
0x6e1adeb2, 0xaa5abb51, 0xefb54b44, 0x15efc54f, 0xe9f1bc4d, 0x5f401b6c, 0x97f018ad, 0xc82f9252,
0x2cdc762e, 0x8e52e56d, 0x1827175e, 0x9b7d7d80, 0xb2ad6845, 0x51065140, 0x71180a18, 0x5b27006c,
0x0621e255, 0x721cbe58, 0x670c0cb8, 0xf8bd715d, 0xe0bdc5d9, 0xed843501, 0x4b84554d, 0x7f1a18bc,
0x53bcaf47, 0x5729d35f, 0xf0dda246, 0x22382bd0, 0x4d641fb0, 0x316afcde, 0x50a22f1f, 0x73608046,
0xc461d84a, 0xb2dbe247,
};
@@ -1423,9 +1482,13 @@ void ThreadOpenConnections2(void* parg)
int64 nStart = GetTime();
loop
{
// Limit outbound connections
vnThreadsRunning[1]--;
Sleep(500);
vnThreadsRunning[1]++;
if (fShutdown)
return;
// Limit outbound connections
loop
{
int nOutbound = 0;
@@ -1437,35 +1500,38 @@ void ThreadOpenConnections2(void* parg)
nMaxOutboundConnections = min(nMaxOutboundConnections, (int)GetArg("-maxconnections", 125));
if (nOutbound < nMaxOutboundConnections)
break;
vnThreadsRunning[1]--;
Sleep(2000);
vnThreadsRunning[1]++;
if (fShutdown)
return;
}
vnThreadsRunning[1]++;
if (fShutdown)
return;
bool fAddSeeds = false;
CRITICAL_BLOCK(cs_mapAddresses)
{
// Add seed nodes if IRC isn't working
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR) && !fTestNet)
{
for (int i = 0; i < ARRAYLEN(pnSeed); i++)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64 nOneWeek = 7*24*60*60;
CAddress addr;
addr.ip = pnSeed[i];
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
}
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fUseProxy) && !fTestNet)
fAddSeeds = true;
}
if (fAddSeeds)
{
for (int i = 0; i < ARRAYLEN(pnSeed); i++)
{
// It'll only connect to one or two seed nodes because once it connects,
// it'll get a pile of addresses with newer timestamps.
// Seed nodes are given a random 'last seen time' of between one and two
// weeks ago.
const int64 nOneWeek = 7*24*60*60;
CAddress addr;
addr.ip = pnSeed[i];
addr.nTime = GetTime()-GetRand(nOneWeek)-nOneWeek;
AddAddress(addr);
}
}
//
// Choose an address to connect to based on most recently seen
@@ -1836,7 +1902,7 @@ bool StopNode()
fShutdown = true;
nTransactionsUpdated++;
int64 nStart = GetTime();
while (vnThreadsRunning[0] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0
while (vnThreadsRunning[0] > 0 || vnThreadsRunning[1] > 0 || vnThreadsRunning[2] > 0 || vnThreadsRunning[3] > 0 || vnThreadsRunning[4] > 0
#ifdef USE_UPNP
|| vnThreadsRunning[5] > 0
#endif

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_NET_H
@@ -271,7 +271,9 @@ public:
// Make sure not to reuse time indexes to keep things in the same order
int64 nNow = (GetTime() - 1) * 1000000;
static int64 nLastTime;
nLastTime = nNow = std::max(nNow, ++nLastTime);
++nLastTime;
nNow = std::max(nNow, nLastTime);
nLastTime = nNow;
// Each retry is 2 minutes after the last
nRequestTime = std::max(nRequestTime + 2 * 60 * 1000000, nNow);
@@ -282,7 +284,7 @@ public:
void BeginMessage(const char* pszCommand)
{
cs_vSend.Enter("cs_vSend", __FILE__, __LINE__);
ENTER_CRITICAL_SECTION(cs_vSend);
if (nHeaderStart != -1)
AbortMessage();
nHeaderStart = vSend.size();
@@ -301,7 +303,7 @@ public:
vSend.resize(nHeaderStart);
nHeaderStart = -1;
nMessageStart = -1;
cs_vSend.Leave();
LEAVE_CRITICAL_SECTION(cs_vSend);
if (fDebug)
printf("(aborted)\n");
@@ -339,7 +341,7 @@ public:
nHeaderStart = -1;
nMessageStart = -1;
cs_vSend.Leave();
LEAVE_CRITICAL_SECTION(cs_vSend);
}
void EndMessageAbortIfEmpty()
@@ -360,7 +362,7 @@ public:
/// when NTP implemented, change to just nTime = GetAdjustedTime()
int64 nTime = (fInbound ? GetAdjustedTime() : GetTime());
CAddress addrYou = (fUseProxy ? CAddress("0.0.0.0") : addr);
CAddress addrMe = (fUseProxy ? CAddress("0.0.0.0") : addrLocalHost);
CAddress addrMe = (fUseProxy || !addrLocalHost.IsRoutable() ? CAddress("0.0.0.0") : addrLocalHost);
RAND_bytes((unsigned char*)&nLocalHostNonce, sizeof(nLocalHostNonce));
PushMessage("version", VERSION, nLocalServices, nTime, addrYou, addrMe,
nLocalHostNonce, std::string(pszSubVer), nBestHeight);

2
src/obj-test/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -147,9 +147,12 @@ int main(int argc, char *argv[])
app.setApplicationName(QApplication::translate("main", "Bitcoin-Qt"));
QSplashScreen splash(QPixmap(":/images/splash"), 0);
splash.show();
splash.setAutoFillBackground(true);
splashref = &splash;
if (!GetBoolArg("-min"))
{
splash.show();
splash.setAutoFillBackground(true);
splashref = &splash;
}
app.processEvents();
@@ -163,7 +166,8 @@ int main(int argc, char *argv[])
// Put this in a block, so that BitcoinGUI is cleaned up properly before
// calling Shutdown() in case of exceptions.
BitcoinGUI window;
splash.finish(&window);
if (splashref)
splash.finish(&window);
OptionsModel optionsModel(pwalletMain);
ClientModel clientModel(&optionsModel);
WalletModel walletModel(pwalletMain, &optionsModel);

View File

@@ -55,8 +55,10 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
QMainWindow(parent),
clientModel(0),
walletModel(0),
dummyWidget(0),
encryptWalletAction(0),
changePassphraseAction(0),
aboutQtAction(0),
trayIcon(0),
notificator(0)
{
@@ -83,6 +85,9 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
// Create the tray icon (or setup the dock icon)
createTrayIcon();
// Dummy widget used when restoring window state after minimization
dummyWidget = new QWidget();
// Create tabs
overviewPage = new OverviewPage();
@@ -156,6 +161,7 @@ BitcoinGUI::~BitcoinGUI()
#ifdef Q_WS_MAC
delete appMenuBar;
#endif
delete dummyWidget;
}
void BitcoinGUI::createActions()
@@ -192,15 +198,15 @@ void BitcoinGUI::createActions()
sendCoinsAction->setShortcut(QKeySequence(Qt::ALT + Qt::Key_2));
tabGroup->addAction(sendCoinsAction);
connect(overviewAction, SIGNAL(triggered()), this, SLOT(show()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(overviewAction, SIGNAL(triggered()), this, SLOT(gotoOverviewPage()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(show()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(historyAction, SIGNAL(triggered()), this, SLOT(gotoHistoryPage()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(show()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(addressBookAction, SIGNAL(triggered()), this, SLOT(gotoAddressBookPage()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(show()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(receiveCoinsAction, SIGNAL(triggered()), this, SLOT(gotoReceiveCoinsPage()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(show()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(sendCoinsAction, SIGNAL(triggered()), this, SLOT(gotoSendCoinsPage()));
quitAction = new QAction(QIcon(":/icons/quit"), tr("E&xit"), this);
@@ -209,7 +215,10 @@ void BitcoinGUI::createActions()
quitAction->setMenuRole(QAction::QuitRole);
aboutAction = new QAction(QIcon(":/icons/bitcoin"), tr("&About %1").arg(qApp->applicationName()), this);
aboutAction->setToolTip(tr("Show information about Bitcoin"));
aboutAction->setMenuRole(QAction::AboutQtRole);
aboutAction->setMenuRole(QAction::AboutRole);
aboutQtAction = new QAction(tr("About &Qt"), this);
aboutQtAction->setToolTip(tr("Show information about Qt"));
aboutQtAction->setMenuRole(QAction::AboutQtRole);
optionsAction = new QAction(QIcon(":/icons/options"), tr("&Options..."), this);
optionsAction->setToolTip(tr("Modify configuration options for bitcoin"));
optionsAction->setMenuRole(QAction::PreferencesRole);
@@ -226,6 +235,7 @@ void BitcoinGUI::createActions()
connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
connect(optionsAction, SIGNAL(triggered()), this, SLOT(optionsClicked()));
connect(aboutAction, SIGNAL(triggered()), this, SLOT(aboutClicked()));
connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
connect(openBitcoinAction, SIGNAL(triggered()), this, SLOT(showNormal()));
connect(encryptWalletAction, SIGNAL(triggered(bool)), this, SLOT(encryptWallet(bool)));
connect(changePassphraseAction, SIGNAL(triggered()), this, SLOT(changePassphrase()));
@@ -253,6 +263,7 @@ void BitcoinGUI::createMenuBar()
QMenu *help = appMenuBar->addMenu(tr("&Help"));
help->addAction(aboutAction);
help->addAction(aboutQtAction);
}
void BitcoinGUI::createToolBars()
@@ -373,10 +384,17 @@ void BitcoinGUI::trayIconActivated(QSystemTrayIcon::ActivationReason reason)
// Click on system tray icon triggers "open bitcoin"
openBitcoinAction->trigger();
}
}
#endif
void BitcoinGUI::showNormal()
{
// Reparent window to the desktop (in case it was hidden on minimize)
if(parent() != NULL)
setParent(NULL, Qt::Window);
QMainWindow::showNormal();
}
void BitcoinGUI::optionsClicked()
{
if(!clientModel || !clientModel->getOptionsModel())
@@ -412,7 +430,6 @@ void BitcoinGUI::setNumBlocks(int count)
{
if(!clientModel)
return;
int initTotal = clientModel->getNumBlocksAtStartup();
int total = clientModel->getNumBlocksOfPeers();
QString tooltip;
@@ -423,8 +440,8 @@ void BitcoinGUI::setNumBlocks(int count)
progressBarLabel->setVisible(true);
progressBarLabel->setText(tr("Synchronizing with network..."));
progressBar->setVisible(true);
progressBar->setMaximum(total - initTotal);
progressBar->setValue(count - initTotal);
progressBar->setMaximum(total);
progressBar->setValue(count);
}
else
{
@@ -453,7 +470,11 @@ void BitcoinGUI::setNumBlocks(int count)
QString text;
// Represent time from last generated block in human readable text
if(secs < 60)
if(secs <= 0)
{
// Fully up to date. Leave text empty.
}
else if(secs < 60)
{
text = tr("%n second(s) ago","",secs);
}
@@ -473,7 +494,7 @@ void BitcoinGUI::setNumBlocks(int count)
// Set icon state: spinning if catching up, tick otherwise
if(secs < 30*60)
{
tooltip = tr("Up to date") + QString("\n") + tooltip;
tooltip = tr("Up to date") + QString(".\n") + tooltip;
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
}
else
@@ -483,8 +504,11 @@ void BitcoinGUI::setNumBlocks(int count)
syncIconMovie->start();
}
tooltip += QString("\n");
tooltip += tr("Last received block was generated %1.").arg(text);
if(!text.isEmpty())
{
tooltip += QString("\n");
tooltip += tr("Last received block was generated %1.").arg(text);
}
labelBlocksIcon->setToolTip(tooltip);
progressBarLabel->setToolTip(tooltip);
@@ -519,13 +543,13 @@ void BitcoinGUI::changeEvent(QEvent *e)
{
if(isMinimized())
{
hide();
e->ignore();
// Hiding the window from taskbar
setParent(dummyWidget, Qt::SubWindow);
return;
}
else
{
show();
e->accept();
showNormal();
}
}
}

View File

@@ -57,6 +57,8 @@ private:
QStackedWidget *centralWidget;
QWidget *dummyWidget;
OverviewPage *overviewPage;
QWidget *transactionsPage;
AddressBookPage *addressBookPage;
@@ -82,6 +84,7 @@ private:
QAction *exportAction;
QAction *encryptWalletAction;
QAction *changePassphraseAction;
QAction *aboutQtAction;
QSystemTrayIcon *trayIcon;
Notificator *notificator;
@@ -123,6 +126,8 @@ public slots:
*/
void askFee(qint64 nFeeRequired, bool *payFee);
void showNormal();
private slots:
/** Switch to overview (home) page */
void gotoOverviewPage();

View File

@@ -24,7 +24,7 @@ QT_TRANSLATE_NOOP("bitcoin-core", ""
"86400)\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Don't attempt to use UPnP to map the listening port\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Attempt to use UPnP to map the listening port\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per KB to add to transactions you send\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Fee per kB to add to transactions you send\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Accept command line and JSON-RPC commands\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Run in the background as a daemon and accept commands\n"),
QT_TRANSLATE_NOOP("bitcoin-core", "Use the test network\n"),

View File

@@ -82,7 +82,7 @@
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Copyright © 2009-2011 Bitcoin Developers
<string>Copyright © 2009-2012 Bitcoin Developers
This is experimental software.

View File

@@ -80,6 +80,9 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Remove all transaction fields</string>
</property>
<property name="text">
<string>Clear all</string>
</property>

View File

@@ -100,7 +100,7 @@
<item>
<widget class="QToolButton" name="addressBookButton">
<property name="toolTip">
<string>Choose adress from address book</string>
<string>Choose address from address book</string>
</property>
<property name="text">
<string/>

View File

@@ -19,6 +19,9 @@
<property name="toolTip">
<string>This pane shows a detailed description of the transaction</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>

View File

@@ -72,3 +72,17 @@ bool GUIUtil::parseBitcoinURL(const QUrl *url, SendCoinsRecipient *out)
}
return true;
}
bool GUIUtil::parseBitcoinURL(QString url, SendCoinsRecipient *out)
{
// Convert bitcoin:// to bitcoin:
//
// Cannot handle this later, because bitcoin:// will cause Qt to see the part after // as host,
// which will lowercase it (and thus invalidate the address).
if(url.startsWith("bitcoin://"))
{
url.replace(0, 10, "bitcoin:");
}
QUrl urlInstance(url);
return parseBitcoinURL(&urlInstance, out);
}

View File

@@ -31,6 +31,7 @@ public:
// Parse "bitcoin:" URL into recipient object, return true on succesful parsing
// See Bitcoin URL definition discussion here: https://bitcointalk.org/index.php?topic=33490.0
static bool parseBitcoinURL(const QUrl *url, SendCoinsRecipient *out);
static bool parseBitcoinURL(QString url, SendCoinsRecipient *out);
};
#endif // GUIUTIL_H

View File

@@ -674,8 +674,8 @@ Adresse: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Valgfri transaktionsgebyr pr. KB, der hjælper dine transaktioner med at blive behandlet hurtigt. De fleste transaktioner er 1KB. Gebyr 0.01 anbefales.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Valgfri transaktionsgebyr pr. kB, der hjælper dine transaktioner med at blive behandlet hurtigt. De fleste transaktioner er 1kB. Gebyr 0.01 anbefales.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -684,8 +684,8 @@ Adresse: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Valgfri transaktionsgebyr pr. KB, der hjælper dine transaktioner med at blive behandlet hurtigt. De fleste transaktioner er 1KB. Gebyr 0.01 anbefales.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Valgfri transaktionsgebyr pr. kB, der hjælper dine transaktioner med at blive behandlet hurtigt. De fleste transaktioner er 1kB. Gebyr 0.01 anbefales.</translation>
</message>
</context>
<context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Vælg adresse fra adressebog</translation>
</message>
<message>
@@ -1523,9 +1523,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Gebyr pr. KB, som skal tilføjes til transaktioner du sender
<translation>Gebyr pr. kB, som skal tilføjes til transaktioner du sender
</translation>
</message>
<message>

View File

@@ -673,8 +673,8 @@ Adresse: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Zusätzliche Transaktionsgebühr pro KB, welche sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 KB groß. Eine Gebühr von 0.01 wird empfohlen.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Zusätzliche Transaktionsgebühr pro kB, welche sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 kB groß. Eine Gebühr von 0.01 wird empfohlen.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -683,8 +683,8 @@ Adresse: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Zusätzliche Transaktionsgebühr pro KB, welche sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 KB groß. Eine Gebühr von 0.01 wird empfohlen.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Zusätzliche Transaktionsgebühr pro kB, welche sicherstellt, dass Ihre Transaktionen schnell bearbeitet werden. Die meisten Transaktionen sind 1 kB groß. Eine Gebühr von 0.01 wird empfohlen.</translation>
</message>
</context>
<context>
@@ -916,7 +916,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Adresse aus dem Adressbuch auswählen</translation>
</message>
<message>
@@ -1512,9 +1512,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Gebühr pro KB, die gesendeten Transaktionen hinzugefügt wird
<translation>Gebühr pro kB, die gesendeten Transaktionen hinzugefügt wird
</translation>
</message>
<message>

View File

@@ -680,7 +680,7 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -690,7 +690,7 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation type="unfinished"></translation>
</message>
</context>
@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation type="unfinished"></translation>
</message>
<message>
@@ -1515,7 +1515,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation type="unfinished"></translation>
</message>

View File

@@ -676,8 +676,8 @@ Dirección: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Comisión opcional a las transacciones por KB que ayuda a asegurar que tus transacciones son procesadas rápidamente. La mayoría de las transacciones son de 1KB. Se recomienda una comisión de 0.01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Comisión opcional a las transacciones por kB que ayuda a asegurar que tus transacciones son procesadas rápidamente. La mayoría de las transacciones son de 1kB. Se recomienda una comisión de 0.01.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -686,8 +686,8 @@ Dirección: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Comisión opcional a las transacciones por KB que ayuda a asegurar que tus transacciones son procesadas rápidamente. La mayoría de las transacciones son de 1KB. Se recomienda una comisión de 0.01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Comisión opcional a las transacciones por kB que ayuda a asegurar que tus transacciones son procesadas rápidamente. La mayoría de las transacciones son de 1kB. Se recomienda una comisión de 0.01.</translation>
</message>
</context>
<context>
@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Elije dirección de la guia</translation>
</message>
<message>
@@ -1527,9 +1527,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Comisión por KB para agregar a las transacciones que envias
<translation>Comisión por kB para agregar a las transacciones que envias
</translation>
</message>
<message>
@@ -2339,4 +2339,4 @@ pero la información de los comentarios quedará en blanco.</translation>
<translation>Bitcoin Qt</translation>
</message>
</context>
</TS>
</TS>

View File

@@ -676,8 +676,8 @@ Dirección: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Comisión de operación opcional por KB que ayuda a asegurar que tus transacciones sean procesadas rápidamente. La mayoría de las transacciones son de 1KB. Se recomienda una comisión de 0.01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Comisión de operación opcional por kB que ayuda a asegurar que tus transacciones sean procesadas rápidamente. La mayoría de las transacciones son de 1kB. Se recomienda una comisión de 0.01.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -686,8 +686,8 @@ Dirección: %4</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Comisión de operación opcional por KB que ayuda a asegurar que tus transacciones sean procesadas rápidamente. La mayoría de las transacciones son de 1KB. Se recomienda una comisión de 0.01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Comisión de operación opcional por kB que ayuda a asegurar que tus transacciones sean procesadas rápidamente. La mayoría de las transacciones son de 1kB. Se recomienda una comisión de 0.01.</translation>
</message>
</context>
<context>
@@ -919,7 +919,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Elije dirección de la guia</translation>
</message>
<message>
@@ -1527,9 +1527,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Comisión por KB para agregar a las transacciones que envias
<translation>Comisión por kB para agregar a las transacciones que envias
</translation>
</message>
<message>
@@ -2339,4 +2339,4 @@ pero la información de los comentarios quedará en blanco.</translation>
<translation>Bitcoin Qt</translation>
</message>
</context>
</TS>
</TS>

View File

@@ -673,8 +673,8 @@ Cím: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Opcionális, KB-onkénti tranzakciós díj a tranzakcióid minél gyorsabb feldolgozásának elősegítésére. A legtöbb tranzakció 1 KB-os. 0,01 BTC ajánlott.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Opcionális, kB-onkénti tranzakciós díj a tranzakcióid minél gyorsabb feldolgozásának elősegítésére. A legtöbb tranzakció 1 kB-os. 0,01 BTC ajánlott.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -683,8 +683,8 @@ Cím: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Opcionális, KB-onkénti tranzakciós díj a tranzakcióid minél gyorsabb feldolgozásának elősegítésére. A legtöbb tranzakció 1 KB-os. 0,01 BTC ajánlott.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Opcionális, kB-onkénti tranzakciós díj a tranzakcióid minél gyorsabb feldolgozásának elősegítésére. A legtöbb tranzakció 1 kB-os. 0,01 BTC ajánlott.</translation>
</message>
</context>
<context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Válassz egy címet a címjegyzékből</translation>
</message>
<message>
@@ -1525,9 +1525,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>KB-onként felajánlandó díj az általad küldött tranzakciókhoz
<translation>kB-onként felajánlandó díj az általad küldött tranzakciókhoz
</translation>
</message>
<message>

View File

@@ -675,8 +675,8 @@ Indirizzo: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Commissione di transazione per ogni KB; è opzionale e contribuisce ad assicurare che le transazioni siano elaborate velocemente. La maggior parte delle transazioni è 1KB. Commissione raccomandata 0,01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Commissione di transazione per ogni kB; è opzionale e contribuisce ad assicurare che le transazioni siano elaborate velocemente. La maggior parte delle transazioni è 1kB. Commissione raccomandata 0,01.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -685,8 +685,8 @@ Indirizzo: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Commissione di transazione per ogni KB; è opzionale e contribuisce ad assicurare che le transazioni siano elaborate velocemente. La maggior parte delle transazioni è 1KB. Commissione raccomandata 0,01.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Commissione di transazione per ogni kB; è opzionale e contribuisce ad assicurare che le transazioni siano elaborate velocemente. La maggior parte delle transazioni è 1kB. Commissione raccomandata 0,01.</translation>
</message>
</context>
<context>
@@ -918,7 +918,7 @@ p, li { white-space: pre-wrap; }⏎
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Scegli l&apos;indirizzo dalla rubrica</translation>
</message>
<message>
@@ -1526,9 +1526,9 @@ p, li { white-space: pre-wrap; }⏎
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Commissione al KB da aggiungere alle transazioni in uscita
<translation>Commissione al kB da aggiungere alle transazioni in uscita
</translation>
</message>
<message>

View File

@@ -674,8 +674,8 @@ Adresse: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Valgfritt transaksjonsgebyr per KB som hjelper for å sikre at transaksjonene dine blir raskt prosessert. De fleste transaksjoner er 1KB. Et gebyr 0.01 anbefales.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Valgfritt transaksjonsgebyr per kB som hjelper for å sikre at transaksjonene dine blir raskt prosessert. De fleste transaksjoner er 1kB. Et gebyr 0.01 anbefales.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -684,8 +684,8 @@ Adresse: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Valgfritt transaksjonsgebyr per KB som hjelper for å sikre at transaksjonene dine blir raskt prosessert. De fleste transaksjoner er 1KB. Et gebyr 0.01 anbefales.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Valgfritt transaksjonsgebyr per kB som hjelper for å sikre at transaksjonene dine blir raskt prosessert. De fleste transaksjoner er 1kB. Et gebyr 0.01 anbefales.</translation>
</message>
</context>
<context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Velg adresse fra adresseboken</translation>
</message>
<message>
@@ -1524,9 +1524,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Gebyr per KB som skal legges til transaksjoner du sender
<translation>Gebyr per kB som skal legges til transaksjoner du sender
</translation>
</message>
<message>

View File

@@ -675,8 +675,8 @@ Adres: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Optionele transactiekosten per KB die helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1KB. Transactiekosten van 0.01 wordt aangeraden.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Optionele transactiekosten per kB die helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1kB. Transactiekosten van 0.01 wordt aangeraden.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -685,8 +685,8 @@ Adres: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Optionele transactiekosten per KB die helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1KB. Transactiekosten van 0.01 wordt aangeraden.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Optionele transactiekosten per kB die helpen ervoor te zorgen dat uw transacties snel verwerkt worden. De meeste transacties zijn 1kB. Transactiekosten van 0.01 wordt aangeraden.</translation>
</message>
</context>
<context>
@@ -918,7 +918,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Kies adres uit adresboek</translation>
</message>
<message>
@@ -1526,9 +1526,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Kosten per KB om aan transacties toe te voegen die u verstuurt
<translation>Kosten per kB om aan transacties toe te voegen die u verstuurt
</translation>
</message>
<message>

View File

@@ -1,4 +1,6 @@
<?xml version="1.0" ?><!DOCTYPE TS><TS language="pt_BR" version="2.0">
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0" language="pt_BR">
<defaultcodec>UTF-8</defaultcodec>
<context>
<name>AboutDialog</name>
@@ -21,7 +23,7 @@ This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file license.txt or http://www.opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -49,7 +51,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../forms/addressbookpage.ui" line="60"/>
<source>&amp;New Address...</source>
<translation>&amp;amp; Novo endereço ...</translation>
<translation>&amp;Novo endereço ...</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="71"/>
@@ -59,7 +61,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../forms/addressbookpage.ui" line="74"/>
<source>&amp;Copy to Clipboard</source>
<translation>&amp;amp; Copie para a área de transferência do sistema</translation>
<translation>&amp;Copie para a área de transferência do sistema</translation>
</message>
<message>
<location filename="../forms/addressbookpage.ui" line="85"/>
@@ -69,7 +71,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../forms/addressbookpage.ui" line="88"/>
<source>&amp;Delete</source>
<translation>&amp;amp; Excluir</translation>
<translation>&amp;Excluir</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="204"/>
@@ -89,7 +91,7 @@ This product includes software developed by the OpenSSL Project for use in the O
<message>
<location filename="../addressbookpage.cpp" line="219"/>
<source>Could not write to file %1.</source>
<translation type="unfinished"/>
<translation type="unfinished"></translation>
</message>
</context>
<context>
@@ -381,7 +383,7 @@ Are you sure you wish to encrypt your wallet?</source>
<message>
<location filename="../bitcoingui.cpp" line="239"/>
<source>&amp;File</source>
<translation>&amp;amp; Arquivo</translation>
<translation>&amp;Arquivo</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="242"/>
@@ -391,7 +393,7 @@ Are you sure you wish to encrypt your wallet?</source>
<message>
<location filename="../bitcoingui.cpp" line="248"/>
<source>&amp;Help</source>
<translation>&amp;amp; Ajuda</translation>
<translation>&amp;Ajuda</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="254"/>
@@ -416,7 +418,10 @@ Are you sure you wish to encrypt your wallet?</source>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="396"/>
<source>%n active connection(s) to Bitcoin network</source>
<translation><numerusform>%n conexão ativa na rede Bitcoin</numerusform><numerusform>%n conexões ativas na rede Bitcoin</numerusform></translation>
<translation>
<numerusform>%n conexão ativa na rede Bitcoin</numerusform>
<numerusform>%n conexões ativas na rede Bitcoin</numerusform>
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="411"/>
@@ -431,22 +436,34 @@ Are you sure you wish to encrypt your wallet?</source>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="428"/>
<source>%n second(s) ago</source>
<translation><numerusform>%n segundo atrás</numerusform><numerusform>%n segundos atrás</numerusform></translation>
<translation>
<numerusform>%n segundo atrás</numerusform>
<numerusform>%n segundos atrás</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="432"/>
<source>%n minute(s) ago</source>
<translation><numerusform>%n minutos atrás</numerusform><numerusform>%n minutos atrás</numerusform></translation>
<translation>
<numerusform>%n minutos atrás</numerusform>
<numerusform>%n minutos atrás</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="436"/>
<source>%n hour(s) ago</source>
<translation><numerusform>%n hora atrás</numerusform><numerusform>%n horas atrás</numerusform></translation>
<translation>
<numerusform>%n hora atrás</numerusform>
<numerusform>%n horas atrás</numerusform>
</translation>
</message>
<message numerus="yes">
<location filename="../bitcoingui.cpp" line="440"/>
<source>%n day(s) ago</source>
<translation><numerusform>%n dia atrás</numerusform><numerusform>%n dias atrás</numerusform></translation>
<translation>
<numerusform>%n dia atrás</numerusform>
<numerusform>%n dias atrás</numerusform>
</translation>
</message>
<message>
<location filename="../bitcoingui.cpp" line="446"/>
@@ -667,8 +684,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -677,8 +694,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</translation>
</message>
</context>
<context>
@@ -741,12 +758,12 @@ Address: %4
<source>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Ubuntu&apos;; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Wallet&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</source>
<translation>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:&apos;Ubuntu&apos;; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Wallet&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</translation>
</message>
<message>
@@ -910,8 +927,8 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<translation>Choose adress from address book</translation>
<source>Choose address from address book</source>
<translation>Choose address from address book</translation>
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="113"/>
@@ -1113,7 +1130,10 @@ p, li { white-space: pre-wrap; }
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="274"/>
<source>Open for %n block(s)</source>
<translation><numerusform>Open for %n block</numerusform><numerusform>Open for %n blocks</numerusform></translation>
<translation>
<numerusform>Open for %n block</numerusform>
<numerusform>Open for %n blocks</numerusform>
</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="277"/>
@@ -1138,7 +1158,10 @@ p, li { white-space: pre-wrap; }
<message numerus="yes">
<location filename="../transactiontablemodel.cpp" line="295"/>
<source>Mined balance will be available in %n more blocks</source>
<translation><numerusform>Mined balance will be available in %n more block</numerusform><numerusform>Mined balance will be available in %n more blocks</numerusform></translation>
<translation>
<numerusform>Mined balance will be available in %n more block</numerusform>
<numerusform>Mined balance will be available in %n more blocks</numerusform>
</translation>
</message>
<message>
<location filename="../transactiontablemodel.cpp" line="301"/>
@@ -1441,9 +1464,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="12"/>
<source>Don't generate coins
<source>Don&apos;t generate coins
</source>
<translation>Don't generate coins
<translation>Don&apos;t generate coins
</translation>
</message>
<message>
@@ -1497,16 +1520,16 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="20"/>
<source>Don't accept connections from outside
<source>Don&apos;t accept connections from outside
</source>
<translation>Don't accept connections from outside
<translation>Don&apos;t accept connections from outside
</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="21"/>
<source>Don't attempt to use UPnP to map the listening port
<source>Don&apos;t attempt to use UPnP to map the listening port
</source>
<translation>Don't attempt to use UPnP to map the listening port
<translation>Don&apos;t attempt to use UPnP to map the listening port
</translation>
</message>
<message>
@@ -1518,9 +1541,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Fee per KB to add to transactions you send
<translation>Fee per kB to add to transactions you send
</translation>
</message>
<message>
@@ -2330,4 +2353,4 @@ but the comment information will be blank.</translation>
<translation>Bitcoin Qt</translation>
</message>
</context>
</TS>
</TS>

View File

@@ -674,8 +674,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Опциональная комиссия за кадый KB транзакции, которое позволяет быть уверенным, что Ваша транзакция будет обработана быстро. Большинство транзакций занимают 1 KB. Рекомендованная комиссия: 0.01 BTC.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Опциональная комиссия за кадый kB транзакции, которое позволяет быть уверенным, что Ваша транзакция будет обработана быстро. Большинство транзакций занимают 1 kB. Рекомендованная комиссия: 0.01 BTC.</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -684,8 +684,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>Опциональная комиссия за кадый KB транзакции, которая позволяет быть уверенным, что Ваша транзакция будет обработана быстро. Большинство транзакций занимают 1 KB. Рекомендованная комиссия: 0.01 BTC.</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Опциональная комиссия за кадый kB транзакции, которая позволяет быть уверенным, что Ваша транзакция будет обработана быстро. Большинство транзакций занимают 1 kB. Рекомендованная комиссия: 0.01 BTC.</translation>
</message>
</context>
<context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Выбрать адрес из адресной книги</translation>
</message>
<message>
@@ -1524,9 +1524,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Комиссия (за каждый KB транзакции)
<translation>Комиссия (за каждый kB транзакции)
</translation>
</message>
<message>

View File

@@ -674,7 +674,7 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Опціональна комісія за кожен Кб переказу, яка дозволяє бути впевненим у тому, що ваш переказ буде оброблено швидко. Розмір більшості переказів рівен 1 Кб. Рекомендована комісія: 0,01.</translation>
</message>
<message>
@@ -684,7 +684,7 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>Опціональна комісія за кожен Кб переказу, яка дозволяє бути впевненим у тому, що ваш переказ буде оброблено швидко. Розмір більшості переказів рівен 1 Кб. Рекомендована комісія: 0,01.</translation>
</message>
</context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>Вибрати адресу з адресної книги</translation>
</message>
<message>
@@ -1525,7 +1525,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>Комісія за Кб
</translation>

View File

@@ -674,8 +674,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>1KB交易数据支付交易费将保证您的交易尽快被处理.1KB. 0.01. </translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>1kB交易数据支付交易费将保证您的交易尽快被处理.1kB. 0.01. </translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -684,8 +684,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>1KB交易数据支付交易费将保证您的交易尽快被处理.1KB. 0.01. </translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>1kB交易数据支付交易费将保证您的交易尽快被处理.1kB. 0.01. </translation>
</message>
</context>
<context>
@@ -917,7 +917,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation></translation>
</message>
<message>
@@ -1524,9 +1524,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation>1KB交易所需的费用</translation>
<translation>1kB交易所需的费用</translation>
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="24"/>

View File

@@ -673,8 +673,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="217"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>, . KB , 1KB. 0.01 .</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>, . kB , 1kB. 0.01 .</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="223"/>
@@ -683,8 +683,8 @@ Address: %4
</message>
<message>
<location filename="../optionsdialog.cpp" line="226"/>
<source>Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended.</source>
<translation>, . KB , 1KB. 0.01 .</translation>
<source>Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1kB. Fee 0.01 recommended.</source>
<translation>, . kB , 1kB. 0.01 .</translation>
</message>
</context>
<context>
@@ -916,7 +916,7 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../forms/sendcoinsentry.ui" line="103"/>
<source>Choose adress from address book</source>
<source>Choose address from address book</source>
<translation>簿</translation>
</message>
<message>
@@ -1524,9 +1524,9 @@ p, li { white-space: pre-wrap; }
</message>
<message>
<location filename="../bitcoinstrings.cpp" line="23"/>
<source>Fee per KB to add to transactions you send
<source>Fee per kB to add to transactions you send
</source>
<translation> KB
<translation> kB
</translation>
</message>
<message>

View File

@@ -214,7 +214,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
proxy_hbox->addStretch(1);
layout->addLayout(proxy_hbox);
QLabel *fee_help = new QLabel(tr("Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."));
QLabel *fee_help = new QLabel(tr("Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended."));
fee_help->setWordWrap(true);
layout->addWidget(fee_help);
@@ -223,7 +223,7 @@ MainOptionsPage::MainOptionsPage(QWidget *parent):
QLabel *fee_label = new QLabel(tr("Pay transaction &fee"));
fee_hbox->addWidget(fee_label);
fee_edit = new BitcoinAmountField();
fee_edit->setToolTip(tr("Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."));
fee_edit->setToolTip(tr("Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB. Fee 0.01 recommended."));
fee_label->setBuddy(fee_edit);
fee_hbox->addWidget(fee_edit);

View File

@@ -11,6 +11,7 @@
#include <QMessageBox>
#include <QLocale>
#include <QTextDocument>
#include <QScrollBar>
SendCoinsDialog::SendCoinsDialog(QWidget *parent) :
QDialog(parent),
@@ -188,6 +189,12 @@ SendCoinsEntry *SendCoinsDialog::addEntry()
// Focus the field, so that entry can start immediately
entry->clear();
entry->setFocus();
ui->scrollAreaWidgetContents->resize(ui->scrollAreaWidgetContents->sizeHint());
QCoreApplication::instance()->processEvents();
QScrollBar* bar = ui->scrollArea->verticalScrollBar();
if (bar)
bar->setSliderPosition(bar->maximum());
return entry;
}
@@ -258,6 +265,16 @@ void SendCoinsDialog::handleURL(const QUrl *url)
pasteEntry(rv);
}
void SendCoinsDialog::handleURL(const QString &url)
{
SendCoinsRecipient rv;
if(!GUIUtil::parseBitcoinURL(url, &rv))
{
return;
}
pasteEntry(rv);
}
void SendCoinsDialog::setBalance(qint64 balance, qint64 unconfirmedBalance)
{
Q_UNUSED(unconfirmedBalance);

View File

@@ -31,6 +31,7 @@ public:
void pasteEntry(const SendCoinsRecipient &rv);
void handleURL(const QUrl *url);
void handleURL(const QString &url);
public slots:
void clear();

View File

@@ -59,8 +59,9 @@ void SendCoinsEntry::on_payTo_textChanged(const QString &address)
{
if(!model)
return;
ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));
}
// Fill in label from address book, if no label is filled in yet
if(ui->addAsLabel->text().isEmpty())
ui->addAsLabel->setText(model->getAddressTableModel()->labelForAddress(address));}
void SendCoinsEntry::setModel(WalletModel *model)
{
@@ -151,3 +152,8 @@ bool SendCoinsEntry::isClear()
return ui->payTo->text().isEmpty();
}
void SendCoinsEntry::setFocus()
{
ui->payTo->setFocus();
}

View File

@@ -31,6 +31,8 @@ public:
*/
QWidget *setupTabChain(QWidget *prev);
void setFocus();
public slots:
void setRemoveEnabled(bool enabled);
void clear();

View File

@@ -31,7 +31,7 @@ public:
/** Set maximum number of rows returned, -1 if unlimited. */
void setLimit(int limit);
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
protected:
bool filterAcceptsRow(int source_row, const QModelIndex & source_parent) const;

View File

@@ -47,48 +47,35 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
//
// Credit
//
TransactionRecord sub(hash, nTime);
sub.credit = nNet;
if (wtx.IsCoinBase())
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
// Generated
sub.type = TransactionRecord::Generated;
if (nCredit == 0)
if(wallet->IsMine(txout))
{
int64 nUnmatured = 0;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
nUnmatured += wallet->GetCredit(txout);
sub.credit = nUnmatured;
}
}
else if (!mapValue["from"].empty() || !mapValue["message"].empty())
{
// Received by IP connection
sub.type = TransactionRecord::RecvFromIP;
if (!mapValue["from"].empty())
sub.address = mapValue["from"];
}
else
{
// Received by Bitcoin Address
sub.type = TransactionRecord::RecvWithAddress;
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
{
if(wallet->IsMine(txout))
TransactionRecord sub(hash, nTime);
CBitcoinAddress address;
sub.idx = parts.size(); // sequence number
sub.credit = txout.nValue;
if (wtx.IsCoinBase())
{
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, wallet, address))
{
sub.address = address.ToString();
}
break;
// Generated
sub.type = TransactionRecord::Generated;
}
else if (ExtractAddress(txout.scriptPubKey, wallet, address))
{
// Received by Bitcoin Address
sub.type = TransactionRecord::RecvWithAddress;
sub.address = address.ToString();
}
else
{
// Received by IP connection (deprecated features), or a multisignature or other non-simple transaction
sub.type = TransactionRecord::RecvFromOther;
sub.address = mapValue["from"];
}
parts.append(sub);
}
}
parts.append(sub);
}
else
{
@@ -127,21 +114,19 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const CWallet *
// from a transaction sent back to our own address.
continue;
}
else if(!mapValue["to"].empty())
{
// Sent to IP
sub.type = TransactionRecord::SendToIP;
sub.address = mapValue["to"];
}
else
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, 0, address))
{
// Sent to Bitcoin Address
sub.type = TransactionRecord::SendToAddress;
CBitcoinAddress address;
if (ExtractAddress(txout.scriptPubKey, 0, address))
{
sub.address = address.ToString();
}
sub.address = address.ToString();
}
else
{
// Sent to IP, or other non-address transaction like OP_EVAL
sub.type = TransactionRecord::SendToOther;
sub.address = mapValue["to"];
}
int64 nValue = txout.nValue;

View File

@@ -65,9 +65,9 @@ public:
Other,
Generated,
SendToAddress,
SendToIP,
SendToOther,
RecvWithAddress,
RecvFromIP,
RecvFromOther,
SendToSelf
};

View File

@@ -345,12 +345,11 @@ QString TransactionTableModel::formatTxType(const TransactionRecord *wtx) const
{
case TransactionRecord::RecvWithAddress:
return tr("Received with");
case TransactionRecord::RecvFromIP:
return tr("Received from IP");
case TransactionRecord::RecvFromOther:
return tr("Received from");
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToOther:
return tr("Sent to");
case TransactionRecord::SendToIP:
return tr("Sent to IP");
case TransactionRecord::SendToSelf:
return tr("Payment to yourself");
case TransactionRecord::Generated:
@@ -367,10 +366,10 @@ QVariant TransactionTableModel::txAddressDecoration(const TransactionRecord *wtx
case TransactionRecord::Generated:
return QIcon(":/icons/tx_mined");
case TransactionRecord::RecvWithAddress:
case TransactionRecord::RecvFromIP:
case TransactionRecord::RecvFromOther:
return QIcon(":/icons/tx_input");
case TransactionRecord::SendToAddress:
case TransactionRecord::SendToIP:
case TransactionRecord::SendToOther:
return QIcon(":/icons/tx_output");
default:
return QIcon(":/icons/tx_inout");
@@ -382,12 +381,12 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
{
switch(wtx->type)
{
case TransactionRecord::RecvFromIP:
case TransactionRecord::RecvFromOther:
return QString::fromStdString(wtx->address);
case TransactionRecord::RecvWithAddress:
case TransactionRecord::SendToAddress:
return lookupAddress(wtx->address, tooltip);
case TransactionRecord::SendToIP:
case TransactionRecord::SendToOther:
return QString::fromStdString(wtx->address);
case TransactionRecord::SendToSelf:
case TransactionRecord::Generated:
@@ -478,7 +477,7 @@ QVariant TransactionTableModel::txStatusDecoration(const TransactionRecord *wtx)
QString TransactionTableModel::formatTooltip(const TransactionRecord *rec) const
{
QString tooltip = formatTxStatus(rec) + QString("\n") + formatTxType(rec);
if(rec->type==TransactionRecord::RecvFromIP || rec->type==TransactionRecord::SendToIP ||
if(rec->type==TransactionRecord::RecvFromOther || rec->type==TransactionRecord::SendToOther ||
rec->type==TransactionRecord::SendToAddress || rec->type==TransactionRecord::RecvWithAddress)
{
tooltip += QString(" ") + formatTxToAddress(rec, true);

View File

@@ -70,9 +70,9 @@ TransactionView::TransactionView(QWidget *parent) :
typeWidget->addItem(tr("All"), TransactionFilterProxy::ALL_TYPES);
typeWidget->addItem(tr("Received with"), TransactionFilterProxy::TYPE(TransactionRecord::RecvWithAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromIP));
TransactionFilterProxy::TYPE(TransactionRecord::RecvFromOther));
typeWidget->addItem(tr("Sent to"), TransactionFilterProxy::TYPE(TransactionRecord::SendToAddress) |
TransactionFilterProxy::TYPE(TransactionRecord::SendToIP));
TransactionFilterProxy::TYPE(TransactionRecord::SendToOther));
typeWidget->addItem(tr("To yourself"), TransactionFilterProxy::TYPE(TransactionRecord::SendToSelf));
typeWidget->addItem(tr("Mined"), TransactionFilterProxy::TYPE(TransactionRecord::Generated));
typeWidget->addItem(tr("Other"), TransactionFilterProxy::TYPE(TransactionRecord::Other));

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_SERIALIZE_H
@@ -60,7 +60,7 @@ class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;
static const int VERSION = 50100;
static const int VERSION = 50300;
static const char* pszSubVer = "";
static const bool VERSION_IS_BETA = true;
@@ -99,6 +99,7 @@ enum
const bool fRead = false; \
unsigned int nSerSize = 0; \
ser_streamplaceholder s; \
assert(fGetSize||fWrite||fRead); /* suppress warning */ \
s.nType = nType; \
s.nVersion = nVersion; \
{statements} \
@@ -112,6 +113,7 @@ enum
const bool fWrite = true; \
const bool fRead = false; \
unsigned int nSerSize = 0; \
assert(fGetSize||fWrite||fRead); /* suppress warning */ \
{statements} \
} \
template<typename Stream> \
@@ -122,6 +124,7 @@ enum
const bool fWrite = false; \
const bool fRead = true; \
unsigned int nSerSize = 0; \
assert(fGetSize||fWrite||fRead); /* suppress warning */ \
{statements} \
}
@@ -829,6 +832,38 @@ struct secure_allocator : public std::allocator<T>
};
//
// Allocator that clears its contents before deletion.
//
template<typename T>
struct zero_after_free_allocator : public std::allocator<T>
{
// MSVC8 default copy constructor is broken
typedef std::allocator<T> base;
typedef typename base::size_type size_type;
typedef typename base::difference_type difference_type;
typedef typename base::pointer pointer;
typedef typename base::const_pointer const_pointer;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::value_type value_type;
zero_after_free_allocator() throw() {}
zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {}
template <typename U>
zero_after_free_allocator(const zero_after_free_allocator<U>& a) throw() : base(a) {}
~zero_after_free_allocator() throw() {}
template<typename _Other> struct rebind
{ typedef zero_after_free_allocator<_Other> other; };
void deallocate(T* p, std::size_t n)
{
if (p != NULL)
memset(p, 0, sizeof(T) * n);
std::allocator<T>::deallocate(p, n);
}
};
//
// Double ended buffer combining vector and stream-like interfaces.
@@ -838,7 +873,7 @@ struct secure_allocator : public std::allocator<T>
class CDataStream
{
protected:
typedef std::vector<char, secure_allocator<char> > vector_type;
typedef std::vector<char, zero_after_free_allocator<char> > vector_type;
vector_type vch;
unsigned int nReadPos;
short state;

View File

@@ -100,13 +100,6 @@ public:
return *this;
}
base_uint& operator&=(uint64 b)
{
pn[0] &= (unsigned int)b;
pn[1] &= (unsigned int)(b >> 32);
return *this;
}
base_uint& operator|=(uint64 b)
{
pn[0] |= (unsigned int)b;

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include "headers.h"
@@ -469,6 +469,23 @@ void ParseParameters(int argc, char* argv[])
}
}
bool SoftSetArg(const std::string& strArg, const std::string& strValue)
{
if (mapArgs.count(strArg))
return false;
mapArgs[strArg] = strValue;
return true;
}
bool SoftSetArg(const std::string& strArg, bool fValue)
{
if (fValue)
return SoftSetArg(strArg, std::string("1"));
else
return SoftSetArg(strArg, std::string("0"));
}
string EncodeBase64(const unsigned char* pch, size_t len)
{
static const char *pbase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
@@ -720,26 +737,35 @@ string MyGetSpecialFolderPath(int nFolder, bool fCreate)
{
PSHGETSPECIALFOLDERPATHA pSHGetSpecialFolderPath =
(PSHGETSPECIALFOLDERPATHA)GetProcAddress(hShell32, "SHGetSpecialFolderPathA");
bool fSuccess = false;
if (pSHGetSpecialFolderPath)
fSuccess =
(*pSHGetSpecialFolderPath)(NULL, pszPath, nFolder, fCreate);
FreeModule(hShell32);
if (fSuccess)
return pszPath;
}
// Backup option
if (pszPath[0] == '\0')
std::string strPath;
{
const char *pszEnv;
if (nFolder == CSIDL_STARTUP)
{
strcpy(pszPath, getenv("USERPROFILE"));
strcat(pszPath, "\\Start Menu\\Programs\\Startup");
pszEnv = getenv("USERPROFILE");
if (pszEnv)
strPath = pszEnv;
strPath += "\\Start Menu\\Programs\\Startup";
}
else if (nFolder == CSIDL_APPDATA)
{
strcpy(pszPath, getenv("APPDATA"));
pszEnv = getenv("APPDATA");
if (pszEnv)
strPath = pszEnv;
}
}
return pszPath;
return strPath;
}
#endif

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTIL_H
@@ -115,7 +115,9 @@ typedef u_int SOCKET;
#define Beep(n1,n2) (0)
inline void Sleep(int64 n)
{
boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(n));
/*Boost has a year 2038 problem— if the request sleep time is past epoch+2^31 seconds the sleep returns instantly.
So we clamp our sleeps here to 10 years and hope that boost is fixed by 2028.*/
boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(n>315576000000LL?315576000000LL:n));
}
#endif
@@ -258,6 +260,12 @@ public:
#define CRITICAL_BLOCK(cs) \
if (CCriticalBlock criticalblock = CCriticalBlock(cs, #cs, __FILE__, __LINE__))
#define ENTER_CRITICAL_SECTION(cs) \
(cs).Enter(#cs, __FILE__, __LINE__)
#define LEAVE_CRITICAL_SECTION(cs) \
(cs).Leave()
class CTryCriticalBlock
{
protected:
@@ -292,6 +300,10 @@ public:
// This is exactly like std::string, but with a custom allocator.
// (secure_allocator<> is defined in serialize.h)
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;
// This is exactly like std::string, but with a custom allocator.
// (secure_allocator<> is defined in serialize.h)
typedef std::basic_string<char, std::char_traits<char>, secure_allocator<char> > SecureString;
@@ -455,7 +467,7 @@ inline int64 GetArg(const std::string& strArg, int64 nDefault)
return nDefault;
}
inline bool GetBoolArg(const std::string& strArg)
inline bool GetBoolArg(const std::string& strArg, bool fDefault=false)
{
if (mapArgs.count(strArg))
{
@@ -463,9 +475,26 @@ inline bool GetBoolArg(const std::string& strArg)
return true;
return (atoi(mapArgs[strArg]) != 0);
}
return false;
return fDefault;
}
/**
* Set an argument if it doesn't already have a value
*
* @param strArg Argument to set (e.g. "-foo")
* @param strValue Value (e.g. "1")
* @return true if argument gets set, false if it already had a value
*/
bool SoftSetArg(const std::string& strArg, const std::string& strValue);
/**
* Set a boolean argument if it doesn't already have a value
*
* @param strArg Argument to set (e.g. "-foo")
* @param fValue Value (e.g. false)
* @return true if argument gets set, false if it already had a value
*/
bool SoftSetArg(const std::string& strArg, bool fValue);
@@ -738,8 +767,8 @@ inline bool AffinityBugWorkaround(void(*pfn)(void*))
inline uint32_t ByteReverse(uint32_t value)
{
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
return (value<<16) | (value>>16);
value = ((value & 0xFF00FF00) >> 8) | ((value & 0x00FF00FF) << 8);
return (value<<16) | (value>>16);
}
#endif

View File

@@ -182,7 +182,7 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
if (!pwalletdbEncryption->TxnCommit())
exit(1); //We now have keys encrypted in memory, but no on disk...die to avoid confusion and let the user reload their unencrypted wallet.
pwalletdbEncryption->Close();
delete pwalletdbEncryption;
pwalletdbEncryption = NULL;
}

View File

@@ -1,5 +1,5 @@
// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2011 The Bitcoin developers
// Copyright (c) 2009-2012 The Bitcoin developers
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_WALLET_H
@@ -86,7 +86,6 @@ public:
bool CreateTransaction(const std::vector<std::pair<CScript, int64> >& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, CReserveKey& reservekey, int64& nFeeRet);
bool CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey);
bool BroadcastTransaction(CWalletTx& wtxNew);
std::string SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);
std::string SendMoneyToBitcoinAddress(const CBitcoinAddress& address, int64 nValue, CWalletTx& wtxNew, bool fAskFee=false);