Compare commits

...

325 Commits

Author SHA1 Message Date
Gavin Andresen
d787e00a3b Changed setup for mingw toolchain 2011-02-18 10:39:24 -05:00
Gavin Andresen
e6e87891a9 Windows mingw32 makefile and build notes (thanks m0mchil) 2011-02-18 09:49:00 -05:00
Gavin Andresen
930a07c3f5 Bump version to 0.3.20.01 2011-02-17 19:22:08 -05:00
Gavin Andresen
5a3e82f9f5 Set maxconnections default to 125 2011-02-16 14:43:04 -05:00
Gavin Andresen
9cbae55a6e Denial-of-service flood control
Drop connections that are either sending messages too fast to handle or are processing messages so slowly data starts to back up.
Adds two new options:
  -maxreceivebuffer  Default: 2000 (2000*1000 bytes)
  -maxsendbuffer     Default: 256  (256*1000 bytes)
2011-02-16 13:18:11 -05:00
Gavin Andresen
cf7c1874fe Update windows build process for 0.3.20 release 2011-02-14 17:26:24 +00:00
Gavin Andresen
47908a8907 Visual C++ compatibility fixes 2011-02-10 19:24:22 -05:00
Daniel Folkinshteyn
d2e2cb0d27 Added 320 fresh seednodes to replace the old ones.
Thanks to MagicalTux for providing the data for node uptime
Thanks to sgornick for scapy script to test node connectivity

Closes https://github.com/bitcoin/bitcoin/issues#issue/22
2011-02-07 14:06:17 +01:00
David FRANCOIS
98ba262a48 Reset testnet with a new genesis block 2011-02-03 14:21:21 +01:00
Gavin Andresen
bd7d9140f9 new checkpoint at block 105,000 2011-01-31 11:26:02 -05:00
Gavin Andresen
b1a657a00d Explicitly state that make -f makfile.unix is the way to build 2011-01-25 09:29:13 -05:00
Chris Moore
d9711a5798 Don't scan the time offsets vector repeatedly once we've displayed the warning that the user's clock may be wrong. 2011-01-24 16:25:41 -08:00
Chris Moore
10abe4f26e Repeatedly resetting the timestamp for seed nodes in the database was slow. Only update the database if it's a real change. 2011-01-24 14:47:36 -08:00
Gavin Andresen
84e7ad922b Bump version number to 0.3.20 2011-01-24 11:13:25 -05:00
Chris Moore
4698dd9a02 Fix -maxconnections. It used to account for the 8 outbound connections twice when calculating the number of slots left for incoming connections. 2011-01-23 00:08:09 -08:00
Gavin Andresen
c90ea2bd6d cpuid instruction clobbers eax/ebx/ecx/edx 2011-01-22 16:04:07 -05:00
Chris Moore
fdec7fe203 Merge branch show-version-in-help-2 of https://github.com/dooglus/bitcoin 2011-01-21 12:14:20 -08:00
Chris Moore
18cb92ab18 Merge branch 'display-version-in-help' of https://github.com/mhanne/bitcoin 2011-01-21 12:09:32 -08:00
Chris Moore
86c0af514b Merge branch 'rpcssl-help' of github.com:dooglus/bitcoin into dooglus-rpcssl-help 2011-01-21 11:59:56 -08:00
Chris Moore
2aadc8bb5b The -rpcssl command line option is a boolean, like -server, -daemon, -testnet, etc. Specifying -rpcssl=1 is the same as just -rpcssl, as for any other boolean flag, so let's show it the same in the help text. 2011-01-21 10:14:33 -08:00
Gavin Andresen
ae42d69d72 Updated development process description 2011-01-21 10:52:48 -05:00
Chris Moore
5284e1b60e Add const bool VERSION_IS_BETA to serialize.h and use it when formatting the version string. Show the version string in --help text too. 2011-01-21 02:37:34 -08:00
Gavin Andresen
05563e9ef2 Add -rescan option to --help output 2011-01-20 16:29:07 -05:00
Gavin Andresen
458cf9070b Merge branch 'printtoconsole' of https://github.com/dooglus/bitcoin into integration 2011-01-20 16:22:33 -05:00
Gavin Andresen
245e1b4fdb Merge branch '4wayswitch' of https://github.com/dooglus/bitcoin into integration 2011-01-20 16:21:59 -05:00
Gavin Andresen
87c1947d49 Merge branch 'showdefaultsinhelp' of https://github.com/dooglus/bitcoin into integration 2011-01-20 16:20:11 -05:00
Chris
8b8d59eefb Don't use GetBoolArg() and mapArgs; use one or the other. 2011-01-20 12:26:33 -08:00
Gavin Andresen
dbe79d3451 Fix bus error in DebugPrint if -datadir given non-existent directory. 2011-01-20 14:57:46 -05:00
Chris
10152506fe The --help text wasn't showing the default values for three of the options, as follows:
-rpcport (default: 8332)
    -rpcconnect (default: 127.0.0.1)
    -keypool (default: 100)

Edited the --help text to include the defaults.
2011-01-20 11:49:29 -08:00
Chris
aaac71d38f Add new command line argument "-printtoconsole" to send debugging output to the console instead of to debug.log. The code for this was already in place, but there was no way other than editing the source and rebuilding to turn it on. 2011-01-20 11:45:01 -08:00
Gavin Andresen
415535e47b Merge branch 'fix-statusbar-color' of https://github.com/mhanne/bitcoin into FIXES 2011-01-20 14:20:52 -05:00
Gavin Andresen
3475caf8f5 Merge branch 'issue34' of https://github.com/dooglus/bitcoin into FIXES 2011-01-20 14:18:51 -05:00
Gavin Andresen
f1307515b7 print -rescan timing info in debug.log 2011-01-20 14:12:10 -05:00
Chris
ab931be45b Fix issue 34: correct spelling of -rpcsslcertificatechainfile in --help text. 2011-01-20 10:49:44 -08:00
Gavin Andresen
d9574c2f14 Reconcile getbalance and listaccounts 0 in the shared-wallet case
If you copied your wallet and used it on two different machines, the balance reported by getbalance and the sum(listaccounts) could disagree, because you might receive payments for an address that is in your wallet but not your address book.  Now all such transactions are credited to the default empty-string account.
2011-01-20 13:10:01 -05:00
Gavin Andresen
1d23c74361 ReacceptWalletTransactions bugfix
Fix two bugs that can happen if you copy your wallet to another machine
and perform transactions on both.

First, ReacceptWalletTransactions would notice if the other wallet spent coins, and
would correctly mark the receiving transaction spent.  However, it did not add the spending
transaction to the wallet.  Now it does.

Second, account balances could get out of sync with 'getbalance' because coins received
by the other copy of the wallet were not necessarily detected.  Now ReacceptWalletTransactions
will scan the entire blockchain for transactions that should be in the wallet if it runs
across a 'spent in the other wallet' transaction.

Finally, there was a small bug in the accounts getbalance code-- generated coins with between
100 and 119 confirmations were not being counted in the balance of account "".
2011-01-19 16:50:20 -05:00
Marius Hanne
0654e1c4ef include version information in help output 2011-01-19 22:49:12 +01:00
Marius Hanne
ed4e8830d7 don't set statusbar background color
people with dark system theme otherwise have white text on light-grey bg
2011-01-19 01:27:58 +01:00
Gavin Andresen
c9f70b381d Merge branch 'integration' into FIXES 2011-01-18 14:46:46 -05:00
Gavin Andresen
b4671902f2 Merge branch 'listaccountsbug' of https://github.com/gavinandresen/bitcoin-git into integration 2011-01-18 14:35:50 -05:00
Gavin Andresen
76e97c4002 Merge branch 'gettransaction' of https://github.com/gavinandresen/bitcoin-git into integration 2011-01-18 14:35:03 -05:00
Gavin Andresen
1aefe491fb Merge branch 'setaccountbug' of https://github.com/gavinandresen/bitcoin-git into integration 2011-01-18 14:33:18 -05:00
David FRANCOIS
04a9217dcf Add the -keypool option description to help output 2011-01-14 20:55:36 +01:00
Gavin Andresen
fa446a563e Fix setaccount/getaccountaddress interaction bug
See https://github.com/bitcoin/bitcoin/issues#issue/29
2011-01-13 20:04:56 -05:00
Gavin Andresen
2eb09b66ef Fix so listaccounts with minconf works. 2011-01-10 13:54:39 -05:00
Gavin Andresen
80be6e69a9 Add account/address details to gettransaction output 2011-01-07 14:10:08 -05:00
Gavin Andresen
009d5fb41f Merge branch 'listaddresses' into integration 2011-01-06 08:56:10 -05:00
Gavin Andresen
f86655fddd Add time to category:move transactions. 2011-01-05 09:52:52 -05:00
Gavin Andresen
0ded557af6 Merge branch 'listaddresses' of https://github.com/gavinandresen/bitcoin-git 2011-01-03 14:45:49 -05:00
Witchspace
72b9861635 don't advertise on IRC if we don't allow external connections 2010-12-24 10:25:21 +01:00
Witchspace
5f88e8887a add -nolisten command line option 2010-12-22 14:08:00 +01:00
Gavin Andresen
ddb68acebe Add address to listtransactions output 2010-12-21 13:39:10 -05:00
Gavin Andresen
2d96276e24 EndModal fix for Mac from piotrp 2010-12-20 12:51:26 -05:00
Gavin Andresen
86c2bdfd5d EndModal fix for Mac from piotrp 2010-12-20 10:36:48 -05:00
Gavin Andresen
cba3a1741a Straw-man for dev process 2010-12-19 10:39:36 -05:00
Gavin Andresen
5568d82c26 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-17 16:23:47 -05:00
gavinandresen
1c0bf23ba2 Missed a int64_t cast when I added transaction time output
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@205 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-17 20:16:27 +00:00
Gavin Andresen
8250760617 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-16 13:24:47 -05:00
gavinandresen
59948a6e1c listtransactions was reporting address instead of account for 'receive'
setgenerate true 0  is now the same as setgenerate false
And return transaction time



git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@204 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-16 18:17:26 +00:00
Gavin Andresen
55c43da5d8 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-16 11:36:47 -05:00
gavinandresen
809ee79592 New RPC command: listaccounts. New RPC setting -rpctimeout. And listtransactions '*'
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@203 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-16 01:06:03 +00:00
s_nakamoto
629e37dde1 get external ip from irc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@202 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-15 22:43:51 +00:00
Gavin Andresen
bc530fe89f Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-13 14:28:59 -05:00
s_nakamoto
fc73ad644f -- version 0.3.19 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@201 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-13 16:26:14 +00:00
Gavin Andresen
9c17a685bd Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-12 16:03:42 -05:00
s_nakamoto
986b5e257e correction
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@200 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-12 18:38:02 +00:00
s_nakamoto
97ee01ad89 added some DoS limits, removed safe mode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@199 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-12 18:20:36 +00:00
Gavin Andresen
d12e53ea09 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-08 20:06:44 -05:00
s_nakamoto
8220180133 -- version 0.3.18 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@198 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-08 23:23:48 +00:00
gavinandresen
a206a23980 IsStandard() check for CScripts: only relay/include in blocks CScripts we can understand.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@197 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-07 13:43:31 +00:00
Gavin Andresen
0a87c91692 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-06 18:58:31 -05:00
s_nakamoto
865c3a2383 fix wallet.dat compatibility problem if you downgrade from 0.3.17 and then upgrade again
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@196 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-06 15:59:28 +00:00
s_nakamoto
f03304a9c7 preps for future client-only mode,
jgarzik's initial download speedup

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@195 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-05 09:29:30 +00:00
gavinandresen
bdde31d787 All boolean options/flags now work the same way.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@194 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-12-03 19:38:09 +00:00
Gavin Andresen
0575c0a667 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-12-01 09:20:49 -05:00
gavinandresen
bfd471f53e JSON methods: listtransactions, gettransaction, move, sendfrom and getbalance <account>
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@193 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-30 18:58:11 +00:00
Gavin Andresen
6f8ba620c2 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-28 10:56:51 -05:00
s_nakamoto
84d7c981dc added boost tuples to serialize.h
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@192 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-27 23:12:41 +00:00
s_nakamoto
24324d83e8 -- version 0.3.17 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@191 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-25 20:41:57 +00:00
s_nakamoto
b7ccd48dd8 still working on account-based commands getbalance, move and sendfrom, they're only for testing for now
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@190 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-25 16:40:25 +00:00
Gavin Andresen
94073ecf7b Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-23 15:01:34 -05:00
s_nakamoto
776d0f3459 new getwork
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@189 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-23 19:16:36 +00:00
Gavin Andresen
262430f705 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-22 11:34:13 -05:00
gavinandresen
e4ff4e6898 Depracate "label" API, replacing with account
New RPC methods: move, sendfrom
Change to getbalance (now takes optional [account] argument)
Renamed methods with "label" in their names.
sendtoaddress returns hexadecimal transaction ID instead of "sent".



git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@188 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-22 15:53:20 +00:00
Gavin Andresen
593f74b9cb Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-22 00:06:42 -05:00
s_nakamoto
298a771494 added transaction fee setting in UI options menu,
cut free transaction area from 50KB to 26KB

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@187 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-21 22:46:19 +00:00
Gavin Andresen
2d8b65e837 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-21 15:48:48 -05:00
s_nakamoto
51d9b435cd small bugfix
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@186 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-20 02:12:03 +00:00
s_nakamoto
f35e21e2e4 require some minimal priority for free transactions to slow down transaction spam
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@185 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-19 23:37:05 +00:00
s_nakamoto
683bcb9154 efficiently sort transaction dependencies in one pass
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@184 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-19 20:22:46 +00:00
Gavin Andresen
11c570cfb4 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-17 20:51:36 -05:00
gavinandresen
c4679ad0f1 OutputDebugStringF fix for Mac FileVault problem, take 3
(cannot use a CRITICAL_BLOCK because of undefined order calling static destructors;
instead, keep debug.log open, and tell people to use copytruncate when doing
log rotation)


git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@183 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-18 00:11:33 +00:00
gavinandresen
2f7a9997c8 Make OutputDebugStringF thread-safe again (thanks ArtForz for catching)
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@182 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-16 17:41:44 +00:00
Gavin Andresen
8595d31ee8 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-16 09:04:24 -05:00
gavinandresen
026c5f7617 Re-open debug.log every ten minutes instead of every printf; fixes performance problem with Mac FileVault.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@181 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-16 02:32:36 +00:00
gavinandresen
222e3de4be Update websites used for GetMyExternalIP
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@180 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-15 21:37:33 +00:00
s_nakamoto
910bd45756 -- version 0.3.15 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@179 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-14 00:06:10 +00:00
Gavin Andresen
a0cd439788 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-10 11:45:51 -05:00
gavinandresen
838e8c9166 Add paytxfee to getinfo output
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@178 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-10 16:43:31 +00:00
Gavin Andresen
695aa2d5a2 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-09 17:10:43 -05:00
s_nakamoto
e2a186af10 SelectCoins first pass tries not to use coins with less than 6 confirmations
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@177 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-09 19:47:07 +00:00
Gavin Andresen
5d4b0c9026 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-08 18:05:34 -05:00
s_nakamoto
461764cbbe -paytxfee is now per KB,
BitcoinMiner prioritise transactions by how old their dependencies are

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@176 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-08 22:06:07 +00:00
Gavin Andresen
de374ba6b1 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-11-03 20:24:50 -04:00
gavinandresen
3b8848fa4e Fix IsInitialBlockDownload if running on testnet
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@175 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-04 00:23:00 +00:00
gavinandresen
3cac997e19 Prevent double-sends from quick double-button-clicks
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@174 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-11-03 23:40:43 +00:00
Gavin Andresen
be7eecafd2 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-23 21:32:19 -04:00
s_nakamoto
c891967b6f bugfixes from Dean Gores,
addr system changes,
make sure no gen before block 74000

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@173 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-23 17:43:53 +00:00
Gavin Andresen
2ea321d85a Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-22 11:23:12 -04:00
gavinandresen
c285051c08 testnet and keypoololdest added to RPC getinfo output. And RPC now sends proper HTTP Date headers.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@172 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-22 15:15:20 +00:00
s_nakamoto
2ce73dbe85 -- version 0.3.14 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@171 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-21 16:47:16 +00:00
Gavin Andresen
07c46dac87 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-20 12:35:35 -04:00
s_nakamoto
d9c6b09ac4 Gavin Andresen: multiple instance check, -testnet use port 18333
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@170 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-20 16:12:23 +00:00
gavinandresen
2ea5fa0710 validateaddress RPC command
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@169 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-20 15:58:16 +00:00
Gavin Andresen
bcd88403e2 Update README now that main svn has -testnet built in 2010-10-19 16:43:50 -04:00
Gavin Andresen
d1e4a866ad Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-19 14:17:18 -04:00
s_nakamoto
5cbf75324d Gavin's TEST network as -testnet switch, misc fixes
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@168 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-19 17:16:51 +00:00
Gavin Andresen
2bda554be4 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-14 16:46:16 -04:00
gavinandresen
2fad3d34b7 makefile.unix tweak from Xunie so bitcoind links on Ubuntu 10.04 x86_64
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@167 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-14 13:33:03 +00:00
Gavin Andresen
cc8005b4e7 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-11 15:15:09 -04:00
gavinandresen
77cd030ac3 Fixed description of -rpcuser/-rpcpassword options.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@166 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-11 18:32:33 +00:00
gavinandresen
ed54768f5f -rpcssl=1 option, allowing secure HTTPS JSON-RPC connections on OSX/Unix.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@165 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-11 18:23:41 +00:00
s_nakamoto
83082f04a4 dkaparis: boost::bind build fix for c++0x
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@164 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-11 15:12:17 +00:00
Gavin Andresen
687c5ef794 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-09 17:59:38 -04:00
s_nakamoto
103849419a key pool for safer wallet backup
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@163 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-09 19:33:35 +00:00
Gavin Andresen
7d5d89856d Merge remote branch 'remotes/svn/trunk' into svn 2010-10-06 21:20:16 -04:00
s_nakamoto
0a27bd065e updated Russian translation
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@162 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-06 15:43:04 +00:00
Gavin Andresen
1b5e57e935 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-05 23:27:30 -04:00
s_nakamoto
b22c884231 recursive function to determine if own unconfirmed transaction can be spent
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@161 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-06 02:19:47 +00:00
Gavin Andresen
a2ae4a8a0f Merge remote branch 'remotes/svn/trunk' into svn 2010-10-05 14:14:17 -04:00
s_nakamoto
dc8adc3b48 Russian translation by eurekafag
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@160 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-10-04 01:40:50 +00:00
Gavin Andresen
5ccee900a0 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-10-01 11:25:09 -04:00
s_nakamoto
178152f604 fixed linux build,
dkaparis: _WIN32_WINNT 0x500
-- version 0.3.13 release

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@159 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-30 23:54:15 +00:00
Gavin Andresen
369010406e Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-30 14:28:23 -04:00
s_nakamoto
a790fa46f4 don't count or spend payments until they have 1 confirmation,
misc cleanup,
changed internal version number from 312 to 31300
-- version 0.3.13

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@158 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-30 16:23:07 +00:00
Gavin Andresen
6ce5af574f Merge commit 'svn/trunk' into svn 2010-09-23 18:15:51 +00:00
Gavin Andresen
81b2d877fb Update README.md 2010-09-23 18:06:50 +00:00
Gavin Andresen
3764c12b1f Merge remote branch 'svn/trunk' into svn 2010-09-23 13:14:52 -04:00
s_nakamoto
9b8eb4d690 changed free transactions per block threshold
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@157 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-23 16:01:44 +00:00
s_nakamoto
8d13ca1f11 changed free transactions per block threshold
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@157 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-23 16:01:44 +00:00
Gavin Andresen
645cc8cf49 Add branch README.md 2010-09-23 14:56:43 +00:00
Gavin Andresen
1c21b7943d Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-19 19:29:03 -04:00
s_nakamoto
172f006020 only accept transactions sent by IP address if -allowreceivebyip is specified
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@156 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-19 21:20:34 +00:00
s_nakamoto
6aeb45187b only accept transactions sent by IP address if -allowreceivebyip is specified
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@156 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-19 21:20:34 +00:00
Gavin Andresen
a43a7dfa58 Merge remote branch 'remotes/svn/trunk' into svn 2010-09-15 22:31:09 -04:00
s_nakamoto
efae3da41d config option -rpcallowip= to accept json-rpc connections from another machine
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@155 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-15 22:10:13 +00:00
s_nakamoto
fe37c35018 config option -rpcallowip= to accept json-rpc connections from another machine
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@155 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-15 22:10:13 +00:00
Gavin Andresen
4b36f34d6d Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-15 10:47:41 -04:00
s_nakamoto
3df62878c3 reorganize BitcoinMiner to make it easier to add different SHA256 routines
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@154 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-13 22:14:24 +00:00
s_nakamoto
71cc095cb2 reorganize BitcoinMiner to make it easier to add different SHA256 routines
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@154 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-13 22:14:24 +00:00
Gavin Andresen
43e4a2a289 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-13 10:46:31 -04:00
s_nakamoto
fdbf76d4f4 dropped DB_PRIVATE from dbenv.open
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@153 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-12 17:30:15 +00:00
s_nakamoto
c8ad9b8375 dropped DB_PRIVATE from dbenv.open
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@153 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-12 17:30:15 +00:00
Gavin Andresen
41016bfc46 Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-10 19:18:27 -04:00
s_nakamoto
c39b06866e fix build on non-intel architectures, thanks teknohog
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@152 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-10 18:07:48 +00:00
s_nakamoto
2323664a37 fix build on non-intel architectures, thanks teknohog
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@152 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-10 18:07:48 +00:00
s_nakamoto
4968232490 fix problem sending the last cent with sub-cent fractional change
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@151 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-10 16:58:59 +00:00
s_nakamoto
00728c24e7 fix problem sending the last cent with sub-cent fractional change
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@151 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-10 16:58:59 +00:00
Gavin Andresen
90e165aa0c Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-09 14:26:53 -04:00
s_nakamoto
7629d36a53 try to auto-detect whether to use 128-bit 4-way SSE2
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@150 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-09 01:00:40 +00:00
s_nakamoto
8555125a1a try to auto-detect whether to use 128-bit 4-way SSE2
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@150 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-09 01:00:40 +00:00
s_nakamoto
3f64753779 Gavin Andresen: clean shutdown on SIGTERM
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@149 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-08 19:24:32 +00:00
s_nakamoto
14002c8eba Gavin Andresen: clean shutdown on SIGTERM
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@149 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-08 19:24:32 +00:00
Gavin Andresen
a2120986ff Merge remote branch 'refs/remotes/svn/trunk' into svn 2010-09-06 21:51:27 -04:00
s_nakamoto
f1e1fb4bde cleanup,
catch some recoverable exceptions and continue

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@148 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-07 01:12:53 +00:00
s_nakamoto
8c9479c6bb cleanup,
catch some recoverable exceptions and continue
-- version 0.3.12 release

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@148 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-07 01:12:53 +00:00
Gavin Andresen
6690680538 Merge remote branch 'remotes/svn/trunk' into svn 2010-09-06 19:05:27 -04:00
s_nakamoto
d743f03552 Gavin Andresen: json-rpc return standard error objects with error code numbers,
json-rpc command line client return exit code,
added rpc backupwallet command

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@147 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-09-06 21:03:04 +00:00
Gavin Andresen
2742fdfda2 Merge remote branch 'remotes/svn/trunk' into svn 2010-09-02 13:42:31 -04:00
s_nakamoto
0a61b0df12 propset svn:eol-style native
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@146 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-29 16:58:15 +00:00
Satoshi Nakamoto
343328c6b8 added -testsafemode switch
-- version 0.3.11 release
2010-08-28 00:55:50 +00:00
Satoshi Nakamoto
d3631907d6 change switch name to -disablesafemode 2010-08-28 00:55:19 +00:00
Satoshi Nakamoto
87cfcfd374 more rpc methods allowed in safe mode 2010-08-28 00:54:37 +00:00
Satoshi Nakamoto
522dfe3422 alert system
-- version 0.3.11
2010-08-28 00:51:52 +00:00
Satoshi Nakamoto
c545563d46 warning message if clock is too far off 2010-08-28 00:50:40 +00:00
Satoshi Nakamoto
7a37c906a1 block index checking on load, extra redundant checks, misc refactoring 2010-08-28 00:49:30 +00:00
s_nakamoto
5b721607b1 added -testsafemode switch
-- version 0.3.11 release

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@145 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 17:53:09 +00:00
s_nakamoto
2ef9cfa5b8 change switch name to -disablesafemode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@144 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 16:33:38 +00:00
s_nakamoto
7d7797b141 more rpc methods allowed in safe mode
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@143 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 14:18:56 +00:00
s_nakamoto
401926283a alert system
-- version 0.3.11

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@142 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-25 00:05:37 +00:00
s_nakamoto
2201a0808e warning message if clock is too far off
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@141 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-20 16:55:14 +00:00
s_nakamoto
05454818dc block index checking on load, extra redundant checks, misc refactoring
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@140 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-19 22:43:19 +00:00
Satoshi Nakamoto
43deefa435 do an extra CheckBlock in ConnectBlock 2010-08-16 20:55:54 +00:00
Satoshi Nakamoto
21ca2d833b erase the bad chain after disconnecting it 2010-08-16 20:54:47 +00:00
Satoshi Nakamoto
bb3fd02930 blocks-1,
verify block chain on load, so wouldn't have needed to delete blk*.dat, it would have done a reorg automatically
2010-08-16 20:53:49 +00:00
Satoshi Nakamoto
c923cdbd5b wrap sha256.cpp in FOURWAYSSE2 #ifdef 2010-08-16 20:52:36 +00:00
Satoshi Nakamoto
019b456605 added -march=amdfam10 to sha256.cpp in makefile.unix 2010-08-16 20:51:46 +00:00
Satoshi Nakamoto
7d489192fd makefile.unix to build with option to enable tcatm's 4-way SSE2 SHA-256 with -4way switch on Linux 2010-08-16 20:50:37 +00:00
s_nakamoto
44a0de1861 do an extra CheckBlock in ConnectBlock
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@139 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-16 18:46:02 +00:00
s_nakamoto
a01d5876fa erase the bad chain after disconnecting it
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@138 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-16 17:51:10 +00:00
s_nakamoto
15399da9fe blocks-1,
verify block chain on load, so wouldn't have needed to delete blk*.dat, it would have done a reorg automatically

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@137 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-16 17:05:50 +00:00
s_nakamoto
6da916d4ac wrap sha256.cpp in FOURWAYSSE2 #ifdef
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@136 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-16 13:37:00 +00:00
s_nakamoto
e540144b2e added -march=amdfam10 to sha256.cpp in makefile.unix
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@135 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-16 13:11:32 +00:00
Satoshi Nakamoto
76793dc969 fix for block 74638 overflow output transaction 2010-08-15 23:09:29 +00:00
Satoshi Nakamoto
6ac7f9f144 misc changes 2010-08-15 23:06:05 +00:00
s_nakamoto
08fee75201 makefile.unix to build with option to enable tcatm's 4-way SSE2 SHA-256 with -4way switch on Linux
-- version 0.3.10 release

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@134 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-15 22:46:58 +00:00
s_nakamoto
85de7d7c0c scanback check to prevent adding to the 74638 overflow chain
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@133 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-15 22:21:03 +00:00
s_nakamoto
d4c6b90ca3 fix for block 74638 overflow output transaction
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@132 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-15 21:35:24 +00:00
s_nakamoto
4bd188c438 misc changes
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@131 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-15 21:05:16 +00:00
Gavin Andresen
2d12315c94 Quick fix: bad block 74,652 2010-08-15 20:28:01 +00:00
Satoshi Nakamoto
7f71fd13ae fix -datadir=./subdir relative path,
autostart off by default except on windows,
fix occasional "vector iterator not dereferencable" assertion with msvc,
fix readlink compile warning on linux build,
use sys/param.h and BSD define instead of __BSD__,
-paytxfee switch
2010-08-13 02:23:46 +00:00
s_nakamoto
01cd2fdaf3 fix -datadir=./subdir relative path,
autostart off by default except on windows,
fix occasional "vector iterator not dereferencable" assertion with msvc,
fix readlink compile warning on linux build,
use sys/param.h and BSD define instead of __BSD__,
-paytxfee switch

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@130 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-12 21:13:43 +00:00
Satoshi Nakamoto
819adfff6f fix build, thanks jgarzik 2010-08-12 13:28:22 +00:00
Satoshi Nakamoto
f5d2bc8a36 disable SSE2 on 32-bit 2010-08-12 13:26:20 +00:00
Satoshi Nakamoto
9db7bf5f52 gethashespersec and added version and hashespersec to getinfo 2010-08-12 13:23:02 +00:00
Satoshi Nakamoto
410b618d18 json-spirit print reals with 8 decimal places,
bitcoind help <command> instead of bitcoind <command> -?
2010-08-12 13:20:57 +00:00
s_nakamoto
4287732797 fix build, thanks jgarzik
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@129 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-11 01:38:24 +00:00
s_nakamoto
0cff7a8aa7 disable SSE2 on 32-bit
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@128 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-10 23:43:37 +00:00
s_nakamoto
fb83d28768 gethashespersec and added version and hashespersec to getinfo
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@127 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-10 22:55:23 +00:00
s_nakamoto
342e1b7338 json-spirit print reals with 8 decimal places,
bitcoind help <command> instead of bitcoind <command> -?

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@126 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-10 19:21:17 +00:00
Satoshi Nakamoto
c2fa70ddfd always make 8 outbound connections even if have inbound,
limit one outbound connection per a.b.?.? range,
switch -maxconnections=#
2010-08-10 16:03:01 +00:00
Satoshi Nakamoto
8a38d5663a enable SSE2 in all builds to fix crypto++ SHA-256 on 64-bit 2010-08-10 16:01:23 +00:00
Satoshi Nakamoto
dd9e71843b correct typo for mac compile, update makefile to use llvm 2010-08-10 15:57:38 +00:00
s_nakamoto
94cfec07fd always make 8 outbound connections even if have inbound,
limit one outbound connection per a.b.?.? range,
switch -maxconnections=#

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@125 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-09 20:00:17 +00:00
s_nakamoto
e6b7ab5749 enable SSE2 in all builds to fix crypto++ SHA-256 on 64-bit
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@124 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-09 19:54:40 +00:00
laszloh
0c50722270 correct typo for mac compile, update makefile to use llvm
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@123 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-04 04:15:38 +00:00
s_nakamoto
2c06be915d new safety feature displays a warning message and locks down RPC if it detects a problem that may require an upgrade
-- version 0.3.8

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@122 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-08-03 18:25:05 +00:00
s_nakamoto
6ff5f718b6 fixed segfault in bignum.h,
additional security limits,
refactoring
-- version 0.3.7

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@121 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-31 19:15:48 +00:00
s_nakamoto
01bed1828b simplified makefile.unix, updated build-unix.txt instructions to include boost 1.37
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@120 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-30 23:22:55 +00:00
s_nakamoto
757f0769d8 reverted makefile.unix wx-config -- version 0.3.6
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@119 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-29 20:27:12 +00:00
s_nakamoto
17b2740289 Fredrik Roubert: simplified makefile.unix with wx-config,
misc

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@118 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-29 15:34:48 +00:00
s_nakamoto
f6f8237a74 fixed makefile.osx
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@117 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-28 21:17:35 +00:00
s_nakamoto
0bd084011a fixed makefile.vc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@116 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-28 21:11:09 +00:00
s_nakamoto
f79751c299 better IsInitialBlockDownload
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@115 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-27 19:43:04 +00:00
s_nakamoto
813505cc13 added a subset of Crypto++ 5.6.0 with 48% faster ASM SHA-256, combined speedup 2.5x faster vs 0.3.3, thanks BlackEye for figuring out the alignment problem
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@114 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-27 18:14:32 +00:00
s_nakamoto
520f367319 tcatm's cached SHA256 state idea, about 70% faster generating
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@113 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-27 01:14:33 +00:00
s_nakamoto
793200e5e9 bitcoind now compiles without wxWidgets or wxBase
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@112 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-26 17:15:18 +00:00
s_nakamoto
6966768a55 Gavin: BIO_FLAGS_BASE64_NO_NL
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@111 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-25 21:49:21 +00:00
s_nakamoto
7d46f9250c Lachesis: remove newlines every 64 characters in EncodeBase64
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@110 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-25 21:29:07 +00:00
s_nakamoto
3b7cd5d89a Gavin Andresen's JSON-RPC HTTP authentication,
faster initial block download
-- version 0.3.3

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@109 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-25 16:45:21 +00:00
s_nakamoto
e8bff10f07 minor UI tweaks, removed some outdated txt files,
(and json-rpc password -rpcpw= switch, which we're going to revert)

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@108 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-18 20:47:29 +00:00
s_nakamoto
ae922a36a4 security safeguards,
limited addr messages
-- version 0.3.2

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@107 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-17 23:51:16 +00:00
s_nakamoto
673a6d15d9 version 0.3.1 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@106 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-16 23:12:58 +00:00
s_nakamoto
0bbc812f48 Spanish translation by milkiway,
French translation by aidos

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@105 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-15 19:11:51 +00:00
s_nakamoto
d01eaf0421 version 0.3.1 rc1
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@104 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-15 16:46:46 +00:00
s_nakamoto
a30b56ebe7 fix openssl linkage problems,
disable minimize to tray on Linux because it has too many problems including a CPU peg bug

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@103 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-15 00:18:45 +00:00
s_nakamoto
6e5d67e827 switched from wxStandardPaths to GetDefaultDataDir, fixes bug reported by m0mchil when username contains non-lower-ASCII characters
-- version 0.3.1

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@102 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-09 15:29:48 +00:00
s_nakamoto
20c6bfad1e Gavin Andresen: implementation of autostart on system startup option on Linux
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@101 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-09 02:11:50 +00:00
s_nakamoto
50d49d9c2e Portuguese translation by Tiago Faria
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@100 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-08 18:07:14 +00:00
s_nakamoto
d882773789 Laszlo's fix to make generate threads idle priority on Linux,
replaced some wxBase dependencies: wxMutex, wxFileExists, wxStandardPaths, wxGetLocalTimeMillis

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@99 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-08 16:14:56 +00:00
s_nakamoto
d77eac25b2 version 0.3 release
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@97 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-04 06:15:06 +00:00
s_nakamoto
f077bc0f48 reduced max outbound connections from 15 to 8 --version 0.3 rc4
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@96 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-07-02 23:43:29 +00:00
s_nakamoto
06c4716396 version 0.3 rc2
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@95 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-26 15:47:45 +00:00
s_nakamoto
8700fae12a build-unix.txt: updated a few version numbers
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@94 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-26 00:23:16 +00:00
s_nakamoto
340120853f updated build-unix.txt instructions: sudo apt-get install libboost-all-dev
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@93 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-24 16:07:51 +00:00
s_nakamoto
3c3fc50c79 added instructions to build-unix.txt for building wxBase, which is needed to compile bitcoind
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@92 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-23 22:51:31 +00:00
s_nakamoto
6344edc36f version 0.3 rc1
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@91 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-22 17:59:00 +00:00
s_nakamoto
445520bf38 added new files to setup.nsi, updated version numbers
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@90 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-22 16:28:15 +00:00
s_nakamoto
8efd8f7f47 re-enable hiding taskbar button on minimize on linux, though it doesn't work cleanly
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@89 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-22 03:45:37 +00:00
s_nakamoto
36bb88e1b9 fix system tray icon on windows
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@88 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-21 18:41:34 +00:00
s_nakamoto
161c38ba60 80x80 xpm icon for ubuntu, alignment tweaked to scale nicely to 20x20 and 16x16
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@87 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-21 17:11:26 +00:00
s_nakamoto
68b973a913 fixed colors on ubuntu lucid,
enabled -O2 in makefile.unix,
boost removed -mt from their library names in 1.40,
updated bitcoin icon,
hashmeter,
generated and hashmeter log entries
-- version 0.2.13

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@86 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-21 01:33:44 +00:00
s_nakamoto
24ba1b64e9 use seed nodes as fallback if IRC fails or with TOR
-- version 0.2.12

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@85 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-18 03:14:24 +00:00
s_nakamoto
6a4a35549b German translation by DataWraith
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@84 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-16 16:35:34 +00:00
s_nakamoto
e5681bb121 more addr message error checking
-- version 0.2.11

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@83 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-15 18:26:32 +00:00
s_nakamoto
bed005b639 revert makefile.unix from -02 back to -00 to fix compile on linux, -02 doesn't really help on linux anyway
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@82 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-14 22:34:33 +00:00
s_nakamoto
f93d5f9ffe automatically change displayed address whenever it receives anything,
added help and -? for daemon command line rpc commands,
only relay addr messages to 5 random nodes to save bandwidth,
started setting wtx.fFromMe flag,
trickle out tx inventory messages to protect privacy
 -- version 0.2.10

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@81 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-10 23:10:30 +00:00
s_nakamoto
2ca1758832 Dutch translation by Xunie (93% complete)
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@80 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-06-02 22:10:06 +00:00
s_nakamoto
1da44d2e96 Italian translation by Joozero
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@79 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-05-27 14:11:03 +00:00
s_nakamoto
42605ce8bc better prevention of inventory relaying during initial download,
message checksum between nodes with 0.2.9 or higher,
optimization level up from -O0 to -O2,
rpc functions: setlabel, getlabel, getaddressesbylabel, getreceivedbyaddress, getreceivedbylabel, listreceivedbyaddress, listreceivedbylabel
 -- version 0.2.9

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@78 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-05-26 00:05:26 +00:00
s_nakamoto
124baa4ccb build-osx.txt build instructions and makefile.osx from Laszlo
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@77 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-05-25 23:58:27 +00:00
s_nakamoto
2d98de1b3a Mac OS build fixes by laszlo
-- version 0.2.8

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@76 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-05-19 00:26:56 +00:00
s_nakamoto
966cca4bd4 misc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@75 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-03-05 02:55:09 +00:00
s_nakamoto
2cffa7ce31 fixed runaway memory alloc bug on 64-bit in ParseString found by sirius-m
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@74 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-03-05 01:13:27 +00:00
s_nakamoto
d7d80a74d5 fix unsafe string handling in wxGetTranslation
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@73 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-28 15:00:32 +00:00
s_nakamoto
6557910ccf wx/utils.h and wx/clipbrd.h not needed on bitcoind wxbase build
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@72 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-26 16:09:43 +00:00
s_nakamoto
c2430126d7 GUI-less build target bitcoind that links to wxBase and shouldn't need GTK,
split init and shutdown from ui.cpp into init.cpp,
support wxUSE_GUI=0
-- version 0.2.7

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@71 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-25 21:55:27 +00:00
s_nakamoto
cb420a1dfc run as daemon without GUI,
hooked wxApp::Initialize to ignore gtk-init-check failure if no GUI,
fork to daemonize,
rpc getinfo, getconnectioncount, getbalance, getgenerate, setgenerate,
-- version 0.2.6

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@70 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-23 22:01:39 +00:00
s_nakamoto
0184604aaf transaction filter tabs instead of view->show generated
-- version 0.2.5

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@69 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-21 21:42:01 +00:00
s_nakamoto
75199de534 Address Book with tabs instead of separate Your Address book,
with live update of default address in main window, 
New... button on main window for creating new receiving address, 
made receiving address labels more visible, 
ask user before paying transaction fee, 
when sending to bitcoin address also use a bitcoin address for the change, 
added some event.Skip() to fix UI glitches 
-- version 0.2.4

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@68 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-20 21:59:59 +00:00
s_nakamoto
c6ab3cf6d9 safer wxGetTranslation wrapper
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@67 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-17 23:55:43 +00:00
s_nakamoto
e480659765 all builds are now with wxWidgets-2.9.0, we are now using UTF-8,
added support for language translation file locale/<lang>/LC_MESSAGES/bitcoin.mo 
-- version 0.2.2

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@66 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-17 17:22:01 +00:00
s_nakamoto
2b63e68bbf fix mingw makefile to use correct wxWidgets include,
this is the last version of makefile and makefile.vc for wxWidgets-2.8

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@65 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-15 20:36:55 +00:00
s_nakamoto
5253d1ab77 strip out unfinished product, review and market stuff,
enable _() instead of wxT() in uiproject.fbp so it uses wxGetTranslation for the wxFormBuilder generated part of the UI

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@64 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-15 04:03:07 +00:00
s_nakamoto
64a474a49b renamed a few rpc methods
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@63 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-14 22:27:13 +00:00
s_nakamoto
c4319e678f Workaround for bug on wxWidgets 2.9.0 Ubuntu 9.10 64-bit where first character of the hidden columns were displayed so status column had three numbers overprinted. Fixed by adding a leading space to the hidden columns. 64-bit compile with wxWidgets 2.9.0 seems to be fully working normally now.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@62 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-14 00:08:27 +00:00
s_nakamoto
c85dfb148a updated build-unix.txt
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@61 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-13 02:09:07 +00:00
s_nakamoto
98500d70a8 command line and JSON-RPC first draft, requires Boost 1.35 or higher for boost::asio,
added SetBitcoinAddress and GetBitcoinAddress methods on CScript, 
critsect interlocks around mapAddressBook, 
added some random delays in tx broadcast to improve privacy, 
now compiles with MSVC 8.0

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@60 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-12 20:38:44 +00:00
s_nakamoto
fa9dbd6b62 better error message in check_type(), tell the types by name instead of by number
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@59 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-10 19:46:04 +00:00
s_nakamoto
75990a46a7 JSON Spirit library from http://www.codeproject.com/KB/recipes/JSON_Spirit.aspx, MIT license
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@58 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-10 19:41:22 +00:00
s_nakamoto
c41226d847 revert revision 56, going in different direction with boost::asio and JSON-RPC
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@57 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-10 19:33:04 +00:00
sirius-m
082e725b33 Added some basic IPC functionality using wxServer, wxClient and wxConnection.
Added the -blockamount command line option for an example of usage.


git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@56 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-04 15:31:46 +00:00
s_nakamoto
53d508072b update fSpent flag on wallet transactions if they're seen spent in case copy of wallet.dat was used elsewhere or restored from backup,
better error dialog box if try to spend already spent coins, 
got rid of unused notebook with only one tab on main dialog, 
nicer looking About dialog, 
resize About dialog better on linux

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@55 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-02-03 22:58:40 +00:00
s_nakamoto
8be979d9ae now compiles on 64-bit Ubuntu Karmic with wxWidgets-2.9.0,
fixes for wxWidgets-2.9.0, 
added superfluous GetEventHandler()'s, 
there's still a bug on wx2.9.0 that the status number is mashed up for some reason otherwise seems to run fine

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@54 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-01-28 21:49:20 +00:00
s_nakamoto
cb0f89646f simplify AddAddress,
readcompactsize limit, 
fixed a 64-bit compile error in serialize.h, 
change status "# blocks" to "# confirmations" and widen the column.

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@53 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2010-01-28 00:31:00 +00:00
s_nakamoto
9a36562347 command line switch -noui
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@52 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-17 23:16:27 +00:00
s_nakamoto
312c2c42b6 a few header changes for freebsd from madhatter
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@51 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-17 18:15:50 +00:00
s_nakamoto
e2c2648c14 filter out duplicate getblocks and don't relay inv messages during initial block download -- 0.2 rc2
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@49 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-14 02:12:01 +00:00
s_nakamoto
adb50ffe32 misc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@48 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-13 02:34:45 +00:00
s_nakamoto
e899779450 restrict file permissions on linux to the user only
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@47 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-13 02:13:43 +00:00
s_nakamoto
e39bc50eb4 misc exit code, updated setup.nsi
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@46 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-13 00:13:16 +00:00
s_nakamoto
651d335569 misc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@45 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-11 17:19:51 +00:00
s_nakamoto
4ea3f3da1a retry IRC if name in use,
resize to fit ubuntu's giant default font, 
scroll debug.log, 
pause gen during initial block download

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@44 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-11 16:49:21 +00:00
s_nakamoto
b075bbf986 misc
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@43 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-06 00:38:11 +00:00
s_nakamoto
107d9e288d fix transaction fee bug in CreateTransaction, higher size cutoff for free transactions in GetMinFee
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@42 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-12-06 00:29:09 +00:00
s_nakamoto
52f4cb4859 minor fix to batched initial download in case requester has more than 500 block non-main branch
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@41 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-24 21:04:50 +00:00
s_nakamoto
c5c7911dab bugfix Db::open/close and zombie sockets bugs fix double-close of socket handle,
keep databases open,
close db cursors,
initial block download in batches of 500 blocks,
fix misc warnings,
subver linux-test8

git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@40 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-18 19:19:41 +00:00
s_nakamoto
b349e3dca8 misc compile error
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@39 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-14 18:04:08 +00:00
s_nakamoto
70e79525c9 monitor ThreadSocketHandler and terminate and restart if hung, convert _beginthread to CreateThread wrapper, disconnect inactive connections, ping, break up long messages to speed up initial download, better priorities for initiating connections, track how many nodes have requested our blocks and transactions, status #/offline and warning message on unsent blocks, minimize on close as separate option -- linux-test5
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@38 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-13 01:23:08 +00:00
s_nakamoto
956468c29a Get local host IP on Linux, Shutdown() a little cleaner -- linux-0.1.6-test1 waypoint
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@37 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-08 04:24:52 +00:00
s_nakamoto
b4e235f9f2 ui tweaks, multiple xpm icon sizes
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@36 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-07 18:51:41 +00:00
s_nakamoto
8b4cefd324 UI tweaks, use BindListenPort to detect instance already running, setsockopt(SO_REUSEADDR) so can bind during TIME_WAIT after exit and restart
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@35 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-07 05:05:03 +00:00
s_nakamoto
8acda009d9 UIThreadCall, ThreadSafeMessageBox
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@34 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-06 18:53:26 +00:00
s_nakamoto
300d4608f2 got rid of CheckForShutdown, replaced some thread-unsafe wxWidgets calls, Linux fixes, socket send MSG_NOSIGNAL, bind INADDR_ANY, works reliably on Linux now except if wxMessageBox is used in a thread other than the GUI thread
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@33 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-06 05:50:05 +00:00
s_nakamoto
e4c05d3177 unix build merged in, bitmap resources from xpm instead of rc, better addr relay, better selection of addrs by time last seen for faster connect
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@32 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-05 04:41:36 +00:00
s_nakamoto
b7362c07ae renamed build.txt to build-msw.txt
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@28 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-04 04:58:46 +00:00
s_nakamoto
4ac57f013e move debug.log and db.log to data dir, portable GetDataDir, optimize GetBalance, fix repaint bogdown, -addnode and -? switches
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@25 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-11-01 01:16:51 +00:00
sirius-m
5750932cdf added wx/stdpaths.h
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@24 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-31 09:52:24 +00:00
sirius-m
fe9f3d626d Linux alternatives for the Windows headers and PerformanceCounter. Some typedefs and #defines for the Linux build. Fixed GetDataDir.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@23 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-31 09:11:43 +00:00
s_nakamoto
32d490313b make CheckDiskSpace portable
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@22 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-30 00:57:05 +00:00
sirius-m
a0c17c03eb setup script removes startup shortcut and runs with highest exec level
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@21 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-30 00:45:35 +00:00
s_nakamoto
e8474beb6f better wallet.dat flush, consolidated QueryPerformanceCounter, PRI64d printf portability
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@20 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-29 20:10:46 +00:00
s_nakamoto
dc73b326f9 CCriticalSection using wxWidgets instead of Windows OS calls
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@19 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-29 05:55:56 +00:00
s_nakamoto
dd519206a6 addr relaying fixes, proxy option and privacy patches, detect connect to self, non-final tx locktime changes, fix hide unconfirmed generated
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@18 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-29 02:52:48 +00:00
s_nakamoto
fa2a0338d3 fix display of new generated coins, fix assertion in bitcoinminer
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@17 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-25 04:35:01 +00:00
sirius-m
e39dfe8ea6 Removed autorun regkey creation
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@16 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-24 16:50:39 +00:00
s_nakamoto
99cef996c7 flush wallet.dat, multi-proc, reorg options, revert to startup folder shortcut
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@15 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-21 01:08:05 +00:00
sirius-m
0cc05617d1 Fixed the installer script and made the autostart registry based.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@14 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-04 11:38:29 +00:00
sirius-m
661f878002 Added NSIS installer generation script
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@13 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-03 17:02:59 +00:00
sirius-m
429187c6a8 Startup folder shortcut opens the program minimized. Restoring a minimized-to-tray window works correctly.
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@12 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-03 11:52:21 +00:00
sirius-m
6d97df0e99 startup shortcut works
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@11 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-10-02 10:14:05 +00:00
sirius-m
dba0fd9b6a tray icon + ask before closing
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@10 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-09-24 04:09:56 +00:00
sirius-m
8dca7864f7 No dll's here
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@8 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-09-16 13:26:04 +00:00
sirius-m
465e1d99f2 Added changelog.txt
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@2 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-08-30 03:50:53 +00:00
sirius-m
e071a3f6c0 First commit
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@1 1a98c847-1fd6-4fd8-948a-caf3550aa51b
2009-08-30 03:46:39 +00:00
61 changed files with 15155 additions and 10441 deletions

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
Bitcoin integration/staging tree
Development process
===================
Developers work in their own trees, then submit pull requests when they think their feature or bug fix is ready.
If it is a simple/trivial/non-controversial change, then one of the bitcoin development team members simply pulls it.
If it is a more complicated or potentially controversial change, then the patch submitter will be asked to start a discussion (if they haven't already) on the development forums: http://www.bitcoin.org/smf/index.php?board=6.0
The patch will be accepted if there is broad consensus that it is a good thing. Developers should expect to rework and resubmit patches if they don't match the project's coding conventions (see coding.txt) or are controversial.
The master branch is regularly built and tested (by who? need people willing to be quality assurance testers), and periodically pushed to the subversion repo to become the official, stable, released bitcoin.
Feature branches are created when there are major new features being worked on by several people.

View File

@@ -152,7 +152,7 @@ inline bool DecodeBase58Check(const string& str, vector<unsigned char>& vchRet)
static const unsigned char ADDRESSVERSION = 0;
#define ADDRESSVERSION ((unsigned char)(fTestNet ? 111 : 0))
inline string Hash160ToAddress(uint160 hash160)
{

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Copyright (c) 2009-2011 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
@@ -11,27 +11,25 @@ WINDOWS BUILD NOTES
Compilers Supported
-------------------
MinGW GCC (recommended)
MinGW GCC http://tdm-gcc.tdragon.net/
TDM-GCC with gcc 4.5.1 was used to build this release.
MSYS 1.0.11 was also used (sh needed to compile some dependencies)
MSVC 6.0 SP6: You'll need Boost version 1.34 because they dropped support
for MSVC 6.0 after that. However, they didn't add Asio until 1.35.
You should still be able to build with MSVC 6.0 by adding Asio to 1.34 by
unpacking boost_asio_*.zip into the boost directory:
http://sourceforge.net/projects/asio/files/asio
MSVC 8.0 (2005) SP1 has been tested. Note: MSVC 7.0 and up have a habit of
linking to runtime DLLs that are not installed on XP by default.
Candidate releases were built with MSVC 10.0 (2010), but
compiling with Visual C++ caused rendering artifacts when
bitcoin was run.
Dependencies
------------
Libraries you need to download separately and build:
default path download
wxWidgets-2.9 \wxwidgets http://www.wxwidgets.org/downloads/
OpenSSL \openssl http://www.openssl.org/source/
Berkeley DB \db http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost http://www.boost.org/users/download/
default path download
wxWidgets \wxwidgets-2.9.1-mgw http://www.wxwidgets.org/downloads/
OpenSSL \openssl-1.0.0c-mgw http://www.openssl.org/source/
Berkeley DB \db-4.7.25.NC-mgw http://www.oracle.com/technology/software/products/berkeley-db/index.html
Boost \boost-1.43.0-mgw http://www.boost.org/users/download/
Their licenses:
wxWidgets LGPL 2.1 with very liberal exceptions
@@ -40,11 +38,10 @@ Berkeley DB New BSD license with additional requirement that linked software
Boost MIT-like license
Versions used in this release:
MinGW GCC 3.4.5
wxWidgets 2.9.0
OpenSSL 0.9.8k
wxWidgets 2.9.1
OpenSSL 1.0.0c
Berkeley DB 4.7.25.NC
Boost 1.42.1
Boost 1.43.0
Notes
@@ -53,62 +50,50 @@ The UI layout is edited with wxFormBuilder. The project file is
uiproject.fbp. It generates uibase.cpp and uibase.h, which define base
classes that do the rote work of constructing all the UI elements.
The release is built with GCC and then "strip bitcoin.exe" to strip the debug
symbols, which reduces the executable size by about 90%.
wxWidgets
---------
cd \wxwidgets\build\msw
make -f makefile.gcc
or
nmake -f makefile.vc
DOS shell:
cd \wxWidgets-2.9.1-mgw\build\msw
mingw32-make -f makefile.gcc
OpenSSL
-------
Bitcoin does not use any encryption. If you want to do a no-everything
build of OpenSSL to exclude encryption routines, a few patches are required.
(instructions for OpenSSL v0.9.8k)
MSYS shell:
un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377)
change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe'
Edit engines\e_gmp.c and engines\e_capi.c and add this #ifndef around
the openssl/rsa.h include:
#ifndef OPENSSL_NO_RSA
#include <openssl/rsa.h>
#endif
cd /c/openssl-1.0.0c-mgw
./config
make
Edit ms\mingw32.bat and replace the Configure line's parameters with this
no-everything list. You have to put this in the batch file because batch
files can't take more than nine command line parameters.
perl Configure mingw threads no-rc2 no-rc4 no-rc5 no-idea no-des no-bf no-cast no-aes no-camellia no-seed no-rsa no-dh
Also REM out the following line in ms\mingw32.bat after the mingw32-make
line. The build fails after it's already finished building libeay32, which
is all we care about, but the failure aborts the script before it runs
dllwrap to generate libeay32.dll.
REM if errorlevel 1 goto end
Build
cd \openssl
ms\mingw32.bat
If you want to use it with MSVC, generate the .lib file
lib /machine:i386 /def:ms\libeay32.def /out:out\libeay32.lib
perl util/mkdef.pl 32 libeay enable-static-engine > libeay32.def
dllwrap --dllname libeay32.dll --output-lib libeay32.a --def libeay32.def libcrypto.a -lws2_32 -lgdi32
after that openssl libeay is in main source dir (openssl-1.0.0c-mgw)
Berkeley DB
-----------
Using MinGW and MSYS:
cd \db\build_unix
MSYS shell:
cd /c/db-4.7.25.NC-mgw/build_unix
sh ../dist/configure --enable-mingw --enable-cxx
make
Boost
-----
download bjam.exe from
http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=72941
cd \boost
DOS prompt:
downloaded boost jam 3.1.18
cd \boost-1.43.0-mgw
bjam toolset=gcc --build-type=complete stage
or
bjam toolset=msvc --build-type=complete stage
Note:
building with boost 1.45.0 failed because of boost ticket 4614, 4258
builds fine with boost 1.43.0
Bitcoin
-------
DOS prompt:
cd \bitcoin
mingw32-make bitcoin.exe bitcoind.exe -f makefile.mingw
strip bitcoin.exe
strip bitcoind.exe

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Copyright (c) 2010 Laszlo Hanyecz
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

@@ -9,6 +9,14 @@ cryptographic software written by Eric Young (eay@cryptsoft.com).
UNIX BUILD NOTES
================
To Build
--------
make -f makefile.unix # Bitcoin with wxWidgets GUI
or
make -f makefile.unix bitcoind # Headless bitcoin
Dependencies
------------
sudo apt-get install build-essential
@@ -21,7 +29,8 @@ or Boost 1.37: sudo apt-get install libboost1.37-dev
If using Boost 1.37, append -mt to the boost libraries in the makefile.
We're now using wxWidgets 2.9, which uses UTF-8. Don't try 2.8, it won't work.
We're using wxWidgets 2.9.0, which uses UTF-8. Don't try 2.8, it won't work.
The build hasn't been updated to work with wxWidgets 2.9.1 yet.
You need to download wxWidgets from http://www.wxwidgets.org/downloads/
and build it yourself. See the build instructions and configure parameters
@@ -64,10 +73,17 @@ make install
ldconfig
Berkeley DB
-----------
You need Berkeley DB 4.7. Don't use 4.8, the database/log0000* files
are incompatible. If you have to build Berkeley DB yourself:
../dist/configure --enable-cxx
make
Boost
-----
If you want to build Boost yourself,
cd /usr/local/boost_1_40_0
su
If you need to build Boost yourself:
sudo su
./bootstrap.sh
./bjam install

41
coding.txt Normal file
View File

@@ -0,0 +1,41 @@
Please be consistent with the existing coding style.
Block style:
bool Function(char* psz, int n)
{
// Comment summarising what this section of code does
for (int i = 0; i < n; i++)
{
// When something fails, return early
if (!Something())
return false;
...
}
// Success return is usually at the end
return true;
}
- ANSI/Allman block style
- 4 space indenting, no tabs
- No extra spaces inside parenthesis; please don't do ( this )
- No space after function names, one space after if, for and while
Variable names begin with the type in lowercase, like nSomeVariable.
Please don't put the first word of the variable name in lowercase like
someVariable.
Common types:
n integer number: short, unsigned short, int, unsigned int,
int64, uint64, sometimes char if used as a number
d double, float
f flag
hash uint256
p pointer or array, one p for each level of indirection
psz pointer to null terminated string
str string object
v vector or similar list objects
map map or multimap
set set or multiset
bn CBigNum

View File

@@ -1,6 +1,13 @@
#ifndef CRYPTOPP_CONFIG_H
#define CRYPTOPP_CONFIG_H
//// Bitcoin: disable SSE2 on 32-bit
#if !defined(_M_X64) && !defined(__x86_64__)
#define CRYPTOPP_DISABLE_SSE2 1
#endif
//////////// end of Bitcoin changes
// ***************** Important Settings ********************
// define this if running on a big-endian CPU

View File

@@ -184,7 +184,8 @@ public:
void deallocate(void *p, size_type n)
{
assert(false);
//// Bitcoin: don't know why this trips, probably a false alarm, depends on the compiler used.
//assert(false);
}
size_type max_size() const {return 0;}

285
db.cpp
View File

@@ -8,7 +8,7 @@ void ThreadFlushWalletDB(void* parg);
unsigned int nWalletDBUpdated;
uint64 nAccountingEntryNumber = 0;
@@ -77,11 +77,10 @@ CDB::CDB(const char* pszFile, const char* pszMode) : pdb(NULL)
DB_INIT_MPOOL |
DB_INIT_TXN |
DB_THREAD |
DB_PRIVATE |
DB_RECOVER,
S_IRUSR | S_IWUSR);
if (ret > 0)
throw runtime_error(strprintf("CDB() : error %d opening database environment\n", ret));
throw runtime_error(strprintf("CDB() : error %d opening database environment", ret));
fDbEnvInit = true;
}
@@ -106,7 +105,7 @@ CDB::CDB(const char* pszFile, const char* pszMode) : pdb(NULL)
CRITICAL_BLOCK(cs_db)
--mapFileUseCount[strFile];
strFile = "";
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d\n", pszFile, ret));
throw runtime_error(strprintf("CDB() : can't open database file %s, error %d", pszFile, ret));
}
if (fCreate && !Exists(string("version")))
@@ -133,6 +132,8 @@ void CDB::Close()
// Flush database activity from memory pool to disk log
unsigned int nMinutes = 0;
if (fReadOnly)
nMinutes = 1;
if (strFile == "addr.dat")
nMinutes = 2;
if (strFile == "blkindex.dat" && IsInitialBlockDownload() && nBestHeight % 500 != 0)
@@ -419,6 +420,9 @@ bool CTxDB::LoadBlockIndex()
// Watch for genesis block
if (pindexGenesisBlock == NULL && diskindex.GetBlockHash() == hashGenesisBlock)
pindexGenesisBlock = pindexNew;
if (!pindexNew->CheckIndex())
return error("LoadBlockIndex() : CheckIndex failed at %d", pindexNew->nHeight);
}
else
{
@@ -454,11 +458,37 @@ bool CTxDB::LoadBlockIndex()
pindexBest = mapBlockIndex[hashBestChain];
nBestHeight = pindexBest->nHeight;
bnBestChainWork = pindexBest->bnChainWork;
printf("LoadBlockIndex(): hashBestChain=%s height=%d\n", hashBestChain.ToString().substr(0,16).c_str(), nBestHeight);
printf("LoadBlockIndex(): hashBestChain=%s height=%d\n", hashBestChain.ToString().substr(0,20).c_str(), nBestHeight);
// Load bnBestInvalidWork, OK if it doesn't exist
ReadBestInvalidWork(bnBestInvalidWork);
// Verify blocks in the best chain
CBlockIndex* pindexFork = NULL;
for (CBlockIndex* pindex = pindexBest; pindex && pindex->pprev; pindex = pindex->pprev)
{
if (pindex->nHeight < nBestHeight-2500 && !mapArgs.count("-checkblocks"))
break;
CBlock block;
if (!block.ReadFromDisk(pindex))
return error("LoadBlockIndex() : block.ReadFromDisk failed");
if (!block.CheckBlock())
{
printf("LoadBlockIndex() : *** found bad block at %d, hash=%s\n", pindex->nHeight, pindex->GetBlockHash().ToString().c_str());
pindexFork = pindex->pprev;
}
}
if (pindexFork)
{
// Reorg back to the fork
printf("LoadBlockIndex() : *** moving best chain pointer back to block %d\n", pindexFork->nHeight);
CBlock block;
if (!block.ReadFromDisk(pindexFork))
return error("LoadBlockIndex() : block.ReadFromDisk failed");
CTxDB txdb;
block.SetBestChain(txdb, pindexFork);
}
return true;
}
@@ -475,6 +505,11 @@ bool CAddrDB::WriteAddress(const CAddress& addr)
return Write(make_pair(string("addr"), addr.GetKey()), addr);
}
bool CAddrDB::EraseAddress(const CAddress& addr)
{
return Erase(make_pair(string("addr"), addr.GetKey()));
}
bool CAddrDB::LoadAddresses()
{
CRITICAL_BLOCK(cs_mapAddresses)
@@ -526,11 +561,6 @@ bool CAddrDB::LoadAddresses()
pcursor->close();
printf("Loaded %d addresses\n", mapAddresses.size());
// Fix for possible bug that manifests in mapAddresses.count in irc.cpp,
// just need to call count here and it doesn't happen there. The bug was the
// pack pragma in irc.cpp and has been fixed, but I'm not in a hurry to delete this.
mapAddresses.count(vector<unsigned char>(18));
}
return true;
@@ -548,10 +578,87 @@ bool LoadAddresses()
// CWalletDB
//
static set<int64> setKeyPool;
static CCriticalSection cs_setKeyPool;
bool CWalletDB::ReadAccount(const string& strAccount, CAccount& account)
{
account.SetNull();
return Read(make_pair(string("acc"), strAccount), account);
}
bool CWalletDB::WriteAccount(const string& strAccount, const CAccount& account)
{
return Write(make_pair(string("acc"), strAccount), account);
}
bool CWalletDB::WriteAccountingEntry(const CAccountingEntry& acentry)
{
return Write(make_tuple(string("acentry"), acentry.strAccount, ++nAccountingEntryNumber), acentry);
}
int64 CWalletDB::GetAccountCreditDebit(const string& strAccount)
{
list<CAccountingEntry> entries;
ListAccountCreditDebit(strAccount, entries);
int64 nCreditDebit = 0;
foreach (const CAccountingEntry& entry, entries)
nCreditDebit += entry.nCreditDebit;
return nCreditDebit;
}
void CWalletDB::ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& entries)
{
int64 nCreditDebit = 0;
bool fAllAccounts = (strAccount == "*");
Dbc* pcursor = GetCursor();
if (!pcursor)
throw runtime_error("CWalletDB::ListAccountCreditDebit() : cannot create DB cursor");
unsigned int fFlags = DB_SET_RANGE;
loop
{
// Read next record
CDataStream ssKey;
if (fFlags == DB_SET_RANGE)
ssKey << make_tuple(string("acentry"), (fAllAccounts? string("") : strAccount), uint64(0));
CDataStream ssValue;
int ret = ReadAtCursor(pcursor, ssKey, ssValue, fFlags);
fFlags = DB_NEXT;
if (ret == DB_NOTFOUND)
break;
else if (ret != 0)
{
pcursor->close();
throw runtime_error("CWalletDB::ListAccountCreditDebit() : error scanning DB");
}
// Unserialize
string strType;
ssKey >> strType;
if (strType != "acentry")
break;
CAccountingEntry acentry;
ssKey >> acentry.strAccount;
if (!fAllAccounts && acentry.strAccount != strAccount)
break;
ssValue >> acentry;
entries.push_back(acentry);
}
pcursor->close();
}
bool CWalletDB::LoadWallet()
{
vchDefaultKey.clear();
int nFileVersion = 0;
vector<uint256> vWalletUpgrade;
// Modify defaults
#ifndef __WXMSW__
@@ -601,14 +708,42 @@ bool CWalletDB::LoadWallet()
if (wtx.GetHash() != hash)
printf("Error in wallet.dat, hash mismatch\n");
// Undo serialize changes in 31600
if (31404 <= wtx.fTimeReceivedIsTxTime && wtx.fTimeReceivedIsTxTime <= 31703)
{
if (!ssValue.empty())
{
char fTmp;
char fUnused;
ssValue >> fTmp >> fUnused >> wtx.strFromAccount;
printf("LoadWallet() upgrading tx ver=%d %d '%s' %s\n", wtx.fTimeReceivedIsTxTime, fTmp, wtx.strFromAccount.c_str(), hash.ToString().c_str());
wtx.fTimeReceivedIsTxTime = fTmp;
}
else
{
printf("LoadWallet() repairing tx ver=%d %s\n", wtx.fTimeReceivedIsTxTime, hash.ToString().c_str());
wtx.fTimeReceivedIsTxTime = 0;
}
vWalletUpgrade.push_back(hash);
}
//// debug print
//printf("LoadWallet %s\n", wtx.GetHash().ToString().c_str());
//printf(" %12I64d %s %s %s\n",
// wtx.vout[0].nValue,
// DateTimeStrFormat("%x %H:%M:%S", wtx.nTime).c_str(),
// wtx.hashBlock.ToString().substr(0,16).c_str(),
// DateTimeStrFormat("%x %H:%M:%S", wtx.GetBlockTime()).c_str(),
// wtx.hashBlock.ToString().substr(0,20).c_str(),
// wtx.mapValue["message"].c_str());
}
else if (strType == "acentry")
{
string strAccount;
ssKey >> strAccount;
uint64 nNumber;
ssKey >> nNumber;
if (nNumber > nAccountingEntryNumber)
nAccountingEntryNumber = nNumber;
}
else if (strType == "key" || strType == "wkey")
{
vector<unsigned char> vchPubKey;
@@ -626,6 +761,12 @@ bool CWalletDB::LoadWallet()
{
ssValue >> vchDefaultKey;
}
else if (strType == "pool")
{
int64 nIndex;
ssKey >> nIndex;
setKeyPool.insert(nIndex);
}
else if (strType == "version")
{
ssValue >> nFileVersion;
@@ -655,6 +796,9 @@ bool CWalletDB::LoadWallet()
pcursor->close();
}
foreach(uint256 hash, vWalletUpgrade)
WriteTx(hash, mapWallet[hash]);
printf("nFileVersion = %d\n", nFileVersion);
printf("fGenerateBitcoins = %d\n", fGenerateBitcoins);
printf("nTransactionFee = %"PRI64d"\n", nTransactionFee);
@@ -665,14 +809,6 @@ bool CWalletDB::LoadWallet()
printf("addrProxy = %s\n", addrProxy.ToString().c_str());
// The transaction fee setting won't be needed for many years to come.
// Setting it to zero here in case they set it to something in an earlier version.
if (nTransactionFee != 0)
{
nTransactionFee = 0;
WriteSetting("nTransactionFee", nTransactionFee);
}
// Upgrade
if (nFileVersion < VERSION)
{
@@ -683,6 +819,7 @@ bool CWalletDB::LoadWallet()
WriteVersion(VERSION);
}
return true;
}
@@ -774,3 +911,111 @@ void ThreadFlushWalletDB(void* parg)
}
}
}
void BackupWallet(const string& strDest)
{
while (!fShutdown)
{
CRITICAL_BLOCK(cs_db)
{
const string strFile = "wallet.dat";
if (!mapFileUseCount.count(strFile) || mapFileUseCount[strFile] == 0)
{
// Flush log data to the dat file
CloseDb(strFile);
dbenv.txn_checkpoint(0, 0, 0);
dbenv.lsn_reset(strFile.c_str(), 0);
mapFileUseCount.erase(strFile);
// Copy wallet.dat
filesystem::path pathSrc(GetDataDir() + "/" + strFile);
filesystem::path pathDest(strDest);
if (filesystem::is_directory(pathDest))
pathDest = pathDest / strFile;
#if BOOST_VERSION >= 104000
filesystem::copy_file(pathSrc, pathDest, filesystem::copy_option::overwrite_if_exists);
#else
filesystem::copy_file(pathSrc, pathDest);
#endif
printf("copied wallet.dat to %s\n", pathDest.string().c_str());
return;
}
}
Sleep(100);
}
}
void CWalletDB::ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool)
{
nIndex = -1;
keypool.vchPubKey.clear();
CRITICAL_BLOCK(cs_main)
CRITICAL_BLOCK(cs_mapWallet)
CRITICAL_BLOCK(cs_setKeyPool)
{
// Top up key pool
int64 nTargetSize = max(GetArg("-keypool", 100), (int64)0);
while (setKeyPool.size() < nTargetSize+1)
{
int64 nEnd = 1;
if (!setKeyPool.empty())
nEnd = *(--setKeyPool.end()) + 1;
if (!Write(make_pair(string("pool"), nEnd), CKeyPool(GenerateNewKey())))
throw runtime_error("ReserveKeyFromKeyPool() : writing generated key failed");
setKeyPool.insert(nEnd);
printf("keypool added key %"PRI64d", size=%d\n", nEnd, setKeyPool.size());
}
// Get the oldest key
assert(!setKeyPool.empty());
nIndex = *(setKeyPool.begin());
setKeyPool.erase(setKeyPool.begin());
if (!Read(make_pair(string("pool"), nIndex), keypool))
throw runtime_error("ReserveKeyFromKeyPool() : read failed");
if (!mapKeys.count(keypool.vchPubKey))
throw runtime_error("ReserveKeyFromKeyPool() : unknown key in key pool");
assert(!keypool.vchPubKey.empty());
printf("keypool reserve %"PRI64d"\n", nIndex);
}
}
void CWalletDB::KeepKey(int64 nIndex)
{
// Remove from key pool
CRITICAL_BLOCK(cs_main)
CRITICAL_BLOCK(cs_mapWallet)
{
Erase(make_pair(string("pool"), nIndex));
}
printf("keypool keep %"PRI64d"\n", nIndex);
}
void CWalletDB::ReturnKey(int64 nIndex)
{
// Return to key pool
CRITICAL_BLOCK(cs_setKeyPool)
setKeyPool.insert(nIndex);
printf("keypool return %"PRI64d"\n", nIndex);
}
vector<unsigned char> GetKeyFromKeyPool()
{
CWalletDB walletdb;
int64 nIndex = 0;
CKeyPool keypool;
walletdb.ReserveKeyFromKeyPool(nIndex, keypool);
walletdb.KeepKey(nIndex);
return keypool.vchPubKey;
}
int64 GetOldestKeyPoolTime()
{
CWalletDB walletdb;
int64 nIndex = 0;
CKeyPool keypool;
walletdb.ReserveKeyFromKeyPool(nIndex, keypool);
walletdb.ReturnKey(nIndex);
return keypool.nTime;
}

100
db.h
View File

@@ -11,6 +11,8 @@ class CUser;
class CReview;
class CAddress;
class CWalletTx;
class CAccount;
class CAccountingEntry;
extern map<string, string> mapAddressBook;
extern CCriticalSection cs_mapAddressBook;
@@ -24,6 +26,8 @@ extern DbEnv dbenv;
extern void DBFlush(bool fShutdown);
extern vector<unsigned char> GetKeyFromKeyPool();
extern int64 GetOldestKeyPoolTime();
@@ -261,7 +265,7 @@ public:
class CTxDB : public CDB
{
public:
CTxDB(const char* pszMode="r+") : CDB(!fClient ? "blkindex.dat" : NULL, pszMode) { }
CTxDB(const char* pszMode="r+") : CDB("blkindex.dat", pszMode) { }
private:
CTxDB(const CTxDB&);
void operator=(const CTxDB&);
@@ -298,6 +302,7 @@ private:
void operator=(const CAddrDB&);
public:
bool WriteAddress(const CAddress& addr);
bool EraseAddress(const CAddress& addr);
bool LoadAddresses();
};
@@ -308,10 +313,41 @@ bool LoadAddresses();
class CKeyPool
{
public:
int64 nTime;
vector<unsigned char> vchPubKey;
CKeyPool()
{
nTime = GetTime();
}
CKeyPool(const vector<unsigned char>& vchPubKeyIn)
{
nTime = GetTime();
vchPubKey = vchPubKeyIn;
}
IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(nTime);
READWRITE(vchPubKey);
)
};
class CWalletDB : public CDB
{
public:
CWalletDB(const char* pszMode="r+") : CDB("wallet.dat", pszMode) { }
CWalletDB(const char* pszMode="r+") : CDB("wallet.dat", pszMode)
{
}
private:
CWalletDB(const CWalletDB&);
void operator=(const CWalletDB&);
@@ -395,12 +431,72 @@ public:
return Write(make_pair(string("setting"), strKey), value);
}
bool ReadAccount(const string& strAccount, CAccount& account);
bool WriteAccount(const string& strAccount, const CAccount& account);
bool WriteAccountingEntry(const CAccountingEntry& acentry);
int64 GetAccountCreditDebit(const string& strAccount);
void ListAccountCreditDebit(const string& strAccount, list<CAccountingEntry>& acentries);
bool LoadWallet();
protected:
void ReserveKeyFromKeyPool(int64& nIndex, CKeyPool& keypool);
void KeepKey(int64 nIndex);
static void ReturnKey(int64 nIndex);
friend class CReserveKey;
friend vector<unsigned char> GetKeyFromKeyPool();
friend int64 GetOldestKeyPoolTime();
};
bool LoadWallet(bool& fFirstRunRet);
void BackupWallet(const string& strDest);
inline bool SetAddressBookName(const string& strAddress, const string& strName)
{
return CWalletDB().WriteName(strAddress, strName);
}
class CReserveKey
{
protected:
int64 nIndex;
vector<unsigned char> vchPubKey;
public:
CReserveKey()
{
nIndex = -1;
}
~CReserveKey()
{
if (!fShutdown)
ReturnKey();
}
vector<unsigned char> GetReservedKey()
{
if (nIndex == -1)
{
CKeyPool keypool;
CWalletDB().ReserveKeyFromKeyPool(nIndex, keypool);
vchPubKey = keypool.vchPubKey;
}
assert(!vchPubKey.empty());
return vchPubKey;
}
void KeepKey()
{
if (nIndex != -1)
CWalletDB().KeepKey(nIndex);
nIndex = -1;
vchPubKey.clear();
}
void ReturnKey()
{
if (nIndex != -1)
CWalletDB::ReturnKey(nIndex);
nIndex = -1;
vchPubKey.clear();
}
};

View File

@@ -11,13 +11,21 @@
#ifdef _WIN32_WINNT
#undef _WIN32_WINNT
#endif
#define _WIN32_WINNT 0x0400
#define _WIN32_WINNT 0x0500
#ifdef _WIN32_IE
#undef _WIN32_IE
#endif
#define _WIN32_IE 0x0400
#define WIN32_LEAN_AND_MEAN 1
#define __STDC_LIMIT_MACROS // to enable UINT64_MAX from stdint.h
#if (defined(__unix__) || defined(unix)) && !defined(USG)
#include <sys/param.h> // to get BSD define
#endif
#ifdef __WXMAC_OSX__
#ifndef BSD
#define BSD 1
#endif
#endif
#ifdef GUI
#include <wx/wx.h>
#include <wx/stdpaths.h>
@@ -25,12 +33,6 @@
#include <wx/utils.h>
#include <wx/clipbrd.h>
#include <wx/taskbar.h>
#else
#ifdef __WXMAC_OSX__
#define __WXMAC__ 1
#define __WXOSX__ 1
#define __BSD__ 1
#endif
#endif
#include <openssl/buffer.h>
#include <openssl/ecdsa.h>
@@ -41,6 +43,7 @@
#include <db_cxx.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <math.h>
#include <limits.h>
#include <float.h>
@@ -68,6 +71,7 @@
#include <boost/filesystem/fstream.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/thread.hpp>
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/interprocess/sync/interprocess_mutex.hpp>
#include <boost/interprocess/sync/interprocess_recursive_mutex.hpp>
#include <boost/date_time/gregorian/gregorian_types.hpp>
@@ -97,8 +101,9 @@
#include <net/if.h>
#include <ifaddrs.h>
#include <fcntl.h>
#include <signal.h>
#endif
#ifdef __BSD__
#ifdef BSD
#include <netinet/in.h>
#endif

144
init.cpp
View File

@@ -10,7 +10,6 @@
//////////////////////////////////////////////////////////////////////////////
//
// Shutdown
@@ -57,6 +56,11 @@ void Shutdown(void* parg)
}
}
void HandleSIGTERM(int)
{
fRequestShutdown = true;
}
@@ -130,6 +134,14 @@ bool AppInit2(int argc, char* argv[])
#ifndef __WXMSW__
umask(077);
#endif
#ifndef __WXMSW__
// Clean shutdown on SIGTERM
struct sigaction sa;
sa.sa_handler = HandleSIGTERM;
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0;
sigaction(SIGTERM, &sa, NULL);
#endif
//
// Parameters
@@ -137,30 +149,56 @@ bool AppInit2(int argc, char* argv[])
ParseParameters(argc, argv);
if (mapArgs.count("-datadir"))
strlcpy(pszSetDataDir, mapArgs["-datadir"].c_str(), sizeof(pszSetDataDir));
{
filesystem::path pathDataDir = filesystem::system_complete(mapArgs["-datadir"]);
strlcpy(pszSetDataDir, pathDataDir.string().c_str(), sizeof(pszSetDataDir));
}
ReadConfigFile(mapArgs, mapMultiArgs); // Must be done after processing datadir
if (mapArgs.count("-?") || mapArgs.count("--help"))
{
string beta = VERSION_IS_BETA ? _(" beta") : "";
string strUsage = string() +
_("Bitcoin version") + " " + FormatVersion(VERSION) + pszSubVer + beta + "\n\n" +
_("Usage:") + "\t\t\t\t\t\t\t\t\t\t\n" +
" bitcoin [options] \t " + "\n" +
" bitcoin [options] <command> [params]\t " + _("Send command to -server or bitcoind\n") +
" bitcoin [options] <command> -? \t\t " + _("Get help for a command\n") +
" bitcoin help \t\t\t " + _("List commands\n") +
" bitcoin [options] help \t\t " + _("List commands\n") +
" bitcoin [options] help <command> \t\t " + _("Get help for a command\n") +
_("Options:\n") +
" -conf=<file> \t " + _("Specify configuration file (default: bitcoin.conf)\n") +
" -gen \t " + _("Generate coins\n") +
" -gen=0 \t " + _("Don't generate coins\n") +
" -min \t " + _("Start minimized\n") +
" -datadir=<dir> \t " + _("Specify data directory\n") +
" -proxy=<ip:port>\t " + _("Connect through socks4 proxy\n") +
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
" -connect=<ip> \t " + _("Connect only to the specified node\n") +
" -server \t " + _("Accept command line and JSON-RPC commands\n") +
" -daemon \t " + _("Run in the background as a daemon and accept commands\n") +
" -? \t " + _("This help message\n");
" -conf=<file> \t\t " + _("Specify configuration file (default: bitcoin.conf)\n") +
" -gen \t\t " + _("Generate coins\n") +
" -gen=0 \t\t " + _("Don't generate coins\n") +
" -min \t\t " + _("Start minimized\n") +
" -datadir=<dir> \t\t " + _("Specify data directory\n") +
" -proxy=<ip:port> \t " + _("Connect through socks4 proxy\n") +
" -addnode=<ip> \t " + _("Add a node to connect to\n") +
" -connect=<ip> \t\t " + _("Connect only to the specified node\n") +
" -nolisten \t " + _("Don't accept connections from outside") +
" -paytxfee=<amt> \t " + _("Fee per KB to add to transactions you send\n") +
" -server \t\t " + _("Accept command line and JSON-RPC commands\n") +
" -daemon \t\t " + _("Run in the background as a daemon and accept commands\n") +
" -testnet \t\t " + _("Use the test network\n") +
" -rpcuser=<user> \t " + _("Username for JSON-RPC connections\n") +
" -rpcpassword=<pw>\t " + _("Password for JSON-RPC connections\n") +
" -rpcport=<port> \t\t " + _("Listen for JSON-RPC connections on <port> (default: 8332)\n") +
" -rpcallowip=<ip> \t\t " + _("Allow JSON-RPC connections from specified IP address\n") +
" -rpcconnect=<ip> \t " + _("Send commands to node running on <ip> (default: 127.0.0.1)\n") +
" -keypool=<n> \t " + _("Set key pool size to <n> (default: 100)\n") +
" -rescan \t " + _("Rescan the block chain for missing wallet transactions\n");
#ifdef USE_SSL
strUsage += string() +
_("\nSSL options: (see the Bitcoin Wiki for SSL setup instructions)\n") +
" -rpcssl \t " + _("Use OpenSSL (https) for JSON-RPC connections\n") +
" -rpcsslcertificatechainfile=<file.cert>\t " + _("Server certificate file (default: server.cert)\n") +
" -rpcsslprivatekeyfile=<file.pem> \t " + _("Server private key (default: server.pem)\n") +
" -rpcsslciphers=<ciphers> \t " + _("Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n");
#endif
strUsage += string() +
" -? \t\t " + _("This help message\n");
#if defined(__WXMSW__) && defined(GUI)
// Tabs make the columns line up in the message box
@@ -173,11 +211,14 @@ bool AppInit2(int argc, char* argv[])
return false;
}
if (mapArgs.count("-debug"))
fDebug = true;
fDebug = GetBoolArg("-debug");
if (mapArgs.count("-printtodebugger"))
fPrintToDebugger = true;
fPrintToConsole = GetBoolArg("-printtoconsole");
fPrintToDebugger = GetBoolArg("-printtodebugger");
fTestNet = GetBoolArg("-testnet");
fNoListen = GetBoolArg("-nolisten");
if (fCommandLine)
{
@@ -188,7 +229,7 @@ bool AppInit2(int argc, char* argv[])
if (!fDebug && !pszSetDataDir[0])
ShrinkDebugFile();
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
printf("Bitcoin version %d.%d.%d%s beta\n", VERSION/10000, (VERSION/100)%100, VERSION%100, pszSubVer);
printf("Bitcoin version %s%s%s\n", FormatVersion(VERSION).c_str(), pszSubVer, VERSION_IS_BETA ? _(" beta") : "");
#ifdef GUI
printf("OS version %s\n", ((string)wxGetOsDescription()).c_str());
printf("System default language is %d %s\n", g_locale.GetSystemLanguage(), ((string)g_locale.GetSysName()).c_str());
@@ -196,7 +237,7 @@ bool AppInit2(int argc, char* argv[])
#endif
printf("Default data directory %s\n", GetDefaultDataDir().c_str());
if (mapArgs.count("-loadblockindextest"))
if (GetBoolArg("-loadblockindextest"))
{
CTxDB txdb("r");
txdb.LoadBlockIndex();
@@ -209,8 +250,7 @@ bool AppInit2(int argc, char* argv[])
// Required to protect the database files if we're going to keep deleting log.*
//
#if defined(__WXMSW__) && defined(GUI)
// todo: wxSingleInstanceChecker wasn't working on Linux, never deleted its lock file
// maybe should go by whether successfully bind port 8333 instead
// wxSingleInstanceChecker doesn't work on Linux
wxString strMutexName = wxString("bitcoin_running.") + getenv("HOMEPATH");
for (int i = 0; i < strMutexName.size(); i++)
if (!isalnum(strMutexName[i]))
@@ -222,7 +262,6 @@ bool AppInit2(int argc, char* argv[])
unsigned int nStart = GetTime();
loop
{
// TODO: find out how to do this in Linux, or replace with wxWidgets commands
// Show the previous instance and exit
HWND hwndPrev = FindWindowA("wxWindowClassNR", "Bitcoin");
if (hwndPrev)
@@ -246,15 +285,28 @@ bool AppInit2(int argc, char* argv[])
}
#endif
// Bind to the port early so we can tell if another instance is already running.
// This is a backup to wxSingleInstanceChecker, which doesn't work on Linux.
string strErrors;
if (!BindListenPort(strErrors))
// Make sure only a single bitcoin process is using the data directory.
string strLockFile = GetDataDir() + "/.lock";
FILE* file = fopen(strLockFile.c_str(), "a"); // empty lock file; created if it doesn't exist.
fclose(file);
static boost::interprocess::file_lock lock(strLockFile.c_str());
if (!lock.try_lock())
{
wxMessageBox(strErrors, "Bitcoin");
wxMessageBox(strprintf(_("Cannot obtain a lock on data directory %s. Bitcoin is probably already running."), GetDataDir().c_str()), "Bitcoin");
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
//
@@ -282,6 +334,13 @@ bool AppInit2(int argc, char* argv[])
strErrors += _("Error loading wallet.dat \n");
printf(" wallet %15"PRI64d"ms\n", GetTimeMillis() - nStart);
if (GetBoolArg("-rescan"))
{
nStart = GetTimeMillis();
ScanForWalletTransactions(pindexGenesisBlock);
printf(" rescan %15"PRI64d"ms\n", GetTimeMillis() - nStart);
}
printf("Done loading\n");
//// debug print
@@ -294,7 +353,7 @@ bool AppInit2(int argc, char* argv[])
if (!strErrors.empty())
{
wxMessageBox(strErrors, "Bitcoin");
wxMessageBox(strErrors, "Bitcoin", wxOK | wxICON_ERROR);
return false;
}
@@ -304,7 +363,7 @@ bool AppInit2(int argc, char* argv[])
//
// Parameters
//
if (mapArgs.count("-printblockindex") || mapArgs.count("-printblocktree"))
if (GetBoolArg("-printblockindex") || GetBoolArg("-printblocktree"))
{
PrintBlockTree();
return false;
@@ -333,13 +392,7 @@ bool AppInit2(int argc, char* argv[])
return false;
}
if (mapArgs.count("-gen"))
{
if (mapArgs["-gen"].empty())
fGenerateBitcoins = true;
else
fGenerateBitcoins = (atoi(mapArgs["-gen"].c_str()) != 0);
}
fGenerateBitcoins = GetBoolArg("-gen");
if (mapArgs.count("-proxy"))
{
@@ -363,6 +416,17 @@ bool AppInit2(int argc, char* argv[])
}
}
if (mapArgs.count("-paytxfee"))
{
if (!ParseMoney(mapArgs["-paytxfee"], nTransactionFee))
{
wxMessageBox(_("Invalid amount for -paytxfee=<amount>"), "Bitcoin");
return false;
}
if (nTransactionFee > 0.25 * COIN)
wxMessageBox(_("Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."), "Bitcoin", wxOK | wxICON_EXCLAMATION);
}
//
// Create the main window and start the node
//
@@ -379,10 +443,10 @@ bool AppInit2(int argc, char* argv[])
if (!CreateThread(StartNode, NULL))
wxMessageBox("Error: CreateThread(StartNode) failed", "Bitcoin");
if (mapArgs.count("-server") || fDaemon)
if (GetBoolArg("-server") || fDaemon)
CreateThread(ThreadRPCServer, NULL);
#ifdef GUI
#if defined(__WXMSW__) && defined(GUI)
if (fFirstRun)
SetStartOnSystemStartup(true);
#endif

151
irc.cpp
View File

@@ -5,6 +5,10 @@
#include "headers.h"
int nGotIRCAddresses = 0;
bool fGotExternalIP = false;
void ThreadIRCSeed2(void* parg);
@@ -81,18 +85,31 @@ bool RecvLine(SOCKET hSocket, string& strLine)
}
else if (nBytes <= 0)
{
if (fShutdown)
return false;
if (nBytes < 0)
{
int nErr = WSAGetLastError();
if (nErr == WSAEMSGSIZE)
continue;
if (nErr == WSAEWOULDBLOCK || nErr == WSAEINTR || nErr == WSAEINPROGRESS)
{
Sleep(10);
continue;
}
}
if (!strLine.empty())
return true;
// socket closed
printf("IRC socket closed\n");
return false;
}
else
{
// socket error
int nErr = WSAGetLastError();
if (nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
if (nBytes == 0)
{
// socket closed
printf("IRC socket closed\n");
return false;
}
else
{
// socket error
int nErr = WSAGetLastError();
printf("IRC recv failed: %d\n", nErr);
return false;
}
@@ -123,11 +140,12 @@ bool RecvLineIRC(SOCKET hSocket, string& strLine)
}
}
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL)
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL)
{
loop
{
string strLine;
strLine.reserve(10000);
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
@@ -137,6 +155,8 @@ int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const cha
return 2;
if (psz3 && strLine.find(psz3) != -1)
return 3;
if (psz4 && strLine.find(psz4) != -1)
return 4;
}
}
@@ -154,13 +174,94 @@ bool Wait(int nSeconds)
return true;
}
bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet)
{
strRet.clear();
loop
{
string strLine;
if (!RecvLineIRC(hSocket, strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
if (vWords[1] == psz1)
{
printf("IRC %s\n", strLine.c_str());
strRet = strLine;
return true;
}
}
}
bool GetIPFromIRC(SOCKET hSocket, string strMyName, unsigned int& ipRet)
{
Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str());
string strLine;
if (!RecvCodeLine(hSocket, "302", strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 4)
return false;
string str = vWords[3];
if (str.rfind("@") == string::npos)
return false;
string strHost = str.substr(str.rfind("@")+1);
unsigned int a=0, b=0, c=0, d=0;
if (sscanf(strHost.c_str(), "%u.%u.%u.%u", &a, &b, &c, &d) == 4 &&
inet_addr(strHost.c_str()) != INADDR_NONE)
{
printf("GetIPFromIRC() userhost is IP %s\n", strHost.c_str());
ipRet = CAddress(strHost).ip;
}
else
{
// Hybrid IRC used by lfnet always returns IP when you userhost yourself,
// but in case another IRC is ever used this should work.
printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
if (fUseProxy)
return false;
struct hostent* phostent = gethostbyname(strHost.c_str());
if (!phostent || !phostent->h_addr_list || !phostent->h_addr_list[0])
return false;
ipRet = *(u_long*)phostent->h_addr_list[0];
}
return true;
}
void ThreadIRCSeed(void* parg)
{
if (mapArgs.count("-connect"))
IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg));
try
{
ThreadIRCSeed2(parg);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "ThreadIRCSeed()");
} catch (...) {
PrintExceptionContinue(NULL, "ThreadIRCSeed()");
}
printf("ThreadIRCSeed exiting\n");
}
void ThreadIRCSeed2(void* parg)
{
/* Dont advertise on IRC if we don't allow incoming connections */
if (mapArgs.count("-connect") || fNoListen)
return;
if (mapArgs.count("-noirc"))
if (GetBoolArg("-noirc"))
return;
printf("ThreadIRCSeed started\n");
int nErrorWait = 10;
@@ -191,7 +292,7 @@ void ThreadIRCSeed(void* parg)
return;
}
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname"))
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname"))
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
@@ -231,11 +332,27 @@ void ThreadIRCSeed(void* parg)
}
Sleep(500);
Send(hSocket, "JOIN #bitcoin\r");
Send(hSocket, "WHO #bitcoin\r");
// Get our external IP from the IRC server and re-nick before joining the channel
CAddress addrFromIRC;
if (GetIPFromIRC(hSocket, strMyName, addrFromIRC.ip))
{
printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToStringIP().c_str());
if (!fUseProxy && addrFromIRC.IsRoutable())
{
// IRC lets you to re-nick
fGotExternalIP = true;
addrLocalHost.ip = addrFromIRC.ip;
strMyName = EncodeAddress(addrLocalHost);
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
}
}
Send(hSocket, fTestNet ? "JOIN #bitcoinTEST\r" : "JOIN #bitcoin\r");
Send(hSocket, fTestNet ? "WHO #bitcoinTEST\r" : "WHO #bitcoin\r");
int64 nStart = GetTime();
string strLine;
strLine.reserve(10000);
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')
@@ -271,8 +388,8 @@ void ThreadIRCSeed(void* parg)
CAddress addr;
if (DecodeAddress(pszName, addr))
{
addr.nTime = GetAdjustedTime() - 51 * 60;
if (AddAddress(addr))
addr.nTime = GetAdjustedTime();
if (AddAddress(addr, 51 * 60))
printf("IRC got new address\n");
nGotIRCAddresses++;
}

1
irc.h
View File

@@ -6,3 +6,4 @@ bool RecvLine(SOCKET hSocket, string& strLine);
void ThreadIRCSeed(void* parg);
extern int nGotIRCAddresses;
extern bool fGotExternalIP;

View File

@@ -342,7 +342,7 @@ namespace json_spirit
{
std::ostringstream os;
/// satoshi: tell the types by name instead of by number
///// Bitcoin: Tell the types by name instead of by number
os << "value is type " << Value_type_name[type()] << ", expected " << Value_type_name[vtype];
throw std::runtime_error( os.str() );

View File

@@ -124,8 +124,11 @@ namespace json_spirit
case str_type: output( value.get_str() ); break;
case bool_type: output( value.get_bool() ); break;
case int_type: output_int( value ); break;
case real_type: os_ << std::showpoint << std::setprecision( 16 )
/// Bitcoin: Added std::fixed and changed precision from 16 to 8
case real_type: os_ << std::showpoint << std::fixed << std::setprecision(8)
<< value.get_real(); break;
case null_type: os_ << "null"; break;
default: assert( false );
}

View File

@@ -1,4 +1,4 @@
Copyright (c) 2009-2010 Satoshi Nakamoto
Copyright (c) 2009-2010 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

Binary file not shown.

View File

@@ -184,8 +184,8 @@ msgid "From: "
msgstr "Von: "
#: ../../../ui.cpp:634
msgid "From: unknown, Received with: "
msgstr "Von: Unbekannt, Empfangen durch: "
msgid "Received with: "
msgstr "Empfangen durch: "
#: ../../../ui.cpp:676
msgid "Payment to yourself"
@@ -321,13 +321,21 @@ msgstr "Beim schließen &Minimieren"
#: ../../../ui.cpp:1595
#, c-format
msgid "version 0.%d.%d beta"
msgstr "Version 0.%d.%d Beta"
msgid "version %s%s BETA"
msgstr "Version %s%s BETA"
#: ../../../ui.cpp:1681
msgid "Will appear as \"From: Unknown\""
msgstr "Wird als \"Von: Unbekannt\" erscheinen"
#: ../../../ui.cpp:1681
msgid "n/a"
msgstr "Unbekannt"
#: ../../../ui.cpp:1681
msgid "Unknown"
msgstr "Unbekannt"
#: ../../../ui.cpp:1682
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "Beim überweisen an eine Bitcoin-Adresse kann keine Nachricht angegeben werden."
@@ -690,7 +698,7 @@ msgstr "Version"
#: ../../../uibase.cpp:563
msgid ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -701,7 +709,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Dies ist experimentelle Software.\n"
"\n"

Binary file not shown.

View File

@@ -210,8 +210,8 @@ msgid "From: "
msgstr "De: "
#: ../../../ui.cpp:634
msgid "From: unknown, Received with: "
msgstr "De: desconocido, Recibido con: "
msgid "Received with: "
msgstr "Recibido con: "
#: ../../../ui.cpp:676
msgid "Payment to yourself"
@@ -350,13 +350,21 @@ msgstr "&Minimizar al cerrar"
#: ../../../ui.cpp:1610
#, c-format
msgid "version %d.%d.%d beta"
msgstr "version %d.%d.%d beta"
msgid "version %s%s BETA"
msgstr "version %s%s BETA"
#: ../../../ui.cpp:1696
msgid "Will appear as \"From: Unknown\""
msgstr "Aparecera como \"De: Desconocido\""
#: ../../../ui.cpp:1696
msgid "n/a"
msgstr "Desconocido"
#: ../../../ui.cpp:1696
msgid "Unknown"
msgstr "Desconocido"
#: ../../../ui.cpp:1697
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "No se ha podido incluir un mensaje mientras se enviaba la direccion Bitcoin"
@@ -719,7 +727,7 @@ msgstr "version"
#: ../../../uibase.cpp:557
msgid ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -730,7 +738,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Este es un software experimental.\n"
"\n"

Binary file not shown.

View File

@@ -210,8 +210,8 @@ msgid "From: "
msgstr "De: "
#: ../../../ui.cpp:634
msgid "From: unknown, Received with: "
msgstr "De: Inconnu, reçu depuis: "
msgid "Received with: "
msgstr "Reçu depuis: "
#: ../../../ui.cpp:676
msgid "Payment to yourself"
@@ -351,13 +351,21 @@ msgstr "&Réduire à la fermeture"
#: ../../../ui.cpp:1610
#, c-format
msgid "version %d.%d.%d beta"
msgstr "version %d.%d.%d beta"
msgid "version %s%s BETA"
msgstr "version %s%s BETA"
#: ../../../ui.cpp:1696
msgid "Will appear as \"From: Unknown\""
msgstr "Apparaîtra ainsi \"De: Inconnu\""
#: ../../../ui.cpp:1681
msgid "n/a"
msgstr "Inconnu"
#: ../../../ui.cpp:1681
msgid "Unknown"
msgstr "Inconnu"
#: ../../../ui.cpp:1697
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "Impossible d'inclure un message lors d'un envoi à une adresse Bitcoin"
@@ -722,7 +730,7 @@ msgstr "version"
#: ../../../uibase.cpp:557
msgid ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -733,7 +741,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Ceci est un logiciel expérimental.\n"
"\n"

Binary file not shown.

View File

@@ -184,8 +184,8 @@ msgid "From: "
msgstr "Da: "
#: ../../../ui.cpp:634
msgid "From: unknown, Received with: "
msgstr "Da: sconosciuto, Ricevuto con: "
msgid "Received with: "
msgstr "Ricevuto con: "
#: ../../../ui.cpp:676
msgid "Payment to yourself"
@@ -319,13 +319,21 @@ msgstr "&Minimizza se chiuso"
#: ../../../ui.cpp:1595
#, c-format
msgid "version 0.%d.%d beta"
msgstr "versione 0.%d.%d beta"
msgid "version %s%s BETA"
msgstr "versione %s%s BETA"
#: ../../../ui.cpp:1681
msgid "Will appear as \"From: Unknown\""
msgstr "Apparirà come \"Da: Sconosciuto\""
#: ../../../ui.cpp:1681
msgid "n/a"
msgstr "Sconosciuto"
#: ../../../ui.cpp:1681
msgid "Unknown"
msgstr "Sconosciuto"
#: ../../../ui.cpp:1682
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "Non si può includere un messaggio quando si invia attraverso l'indirizzo Bitcoin"
@@ -688,7 +696,7 @@ msgstr "versione"
#: ../../../uibase.cpp:563
msgid ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -699,7 +707,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Questo è un software sperimentale.\n"
"\n"

Binary file not shown.

View File

@@ -184,8 +184,8 @@ msgid "From: "
msgstr "Van: "
#: ../../../ui.cpp:634
msgid "From: unknown, Received with: "
msgstr "Van: onbekend, Ontvangen met: "
msgid "Received with: "
msgstr "Ontvangen met: "
#: ../../../ui.cpp:676
msgid "Payment to yourself"
@@ -320,13 +320,21 @@ msgstr "&Minimalizeer bij sluiten"
#: ../../../ui.cpp:1595
#, c-format
msgid "version 0.%d.%d beta"
msgstr "versie 0.%d.%d beta"
msgid "version %s%s BETA"
msgstr "versie %s%s BETA"
#: ../../../ui.cpp:1681
msgid "Will appear as \"From: Unknown\""
msgstr "Word vertoont als \"Van: Onbekend\""
#: ../../../ui.cpp:1681
msgid "n/a"
msgstr "Onbekend"
#: ../../../ui.cpp:1681
msgid "Unknown"
msgstr "Onbekend"
#: ../../../ui.cpp:1682
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "Kan geen mededeling versturen bij gebruik van Bitcoin adressen"
@@ -689,7 +697,7 @@ msgstr "versie"
#: ../../../uibase.cpp:563
msgid ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
@@ -700,7 +708,7 @@ msgid ""
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Copyright (c) 2009-2010 Satoshi Nakamoto.\n"
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Dit is experimentele software.\n"
"\n"

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
put bitcoin.po and bitcoin.mo files at:
locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
.po is the sourcefile
.mo is the compiled translation
put bitcoin.po and bitcoin.mo files at:
locale/<langcode>/LC_MESSAGES/bitcoin.mo and .po
.po is the sourcefile
.mo is the compiled translation

Binary file not shown.

View File

@@ -0,0 +1,895 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-10-05 10:53+0300\n"
"PO-Revision-Date: 2010-10-05 11:43+0300\n"
"Last-Translator: eurekafag\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: ../../..\n"
#: ../../../init.cpp:162
msgid "Usage:"
msgstr "Использование"
#: ../../../init.cpp:164
msgid "Send command to -server or bitcoind\n"
msgstr "Отправить команду bitcoin, запущенному с -server\n"
#: ../../../init.cpp:165
msgid "List commands\n"
msgstr "Список команд\n"
#: ../../../init.cpp:166
msgid "Get help for a command\n"
msgstr "Получить помощь для команды\n"
#: ../../../init.cpp:167
msgid "Options:\n"
msgstr "Параметры:\n"
#: ../../../init.cpp:168
msgid "Specify configuration file (default: bitcoin.conf)\n"
msgstr "Укажите конфигурационный файл (по умолчанию: bitcoin.conf)\n"
#: ../../../init.cpp:169
msgid "Generate coins\n"
msgstr "Генерировать монеты\n"
#: ../../../init.cpp:170
msgid "Don't generate coins\n"
msgstr "Не генерировать монеты\n"
#: ../../../init.cpp:171
msgid "Start minimized\n"
msgstr "Запускать свёрнутым\n"
#: ../../../init.cpp:172
msgid "Specify data directory\n"
msgstr "Указать каталог данных\n"
#: ../../../init.cpp:173
msgid "Connect through socks4 proxy\n"
msgstr "Подключаться через socks4 прокси\n"
#: ../../../init.cpp:174
msgid "Add a node to connect to\n"
msgstr "Добавить узел для подключения\n"
#: ../../../init.cpp:175
msgid "Connect only to the specified node\n"
msgstr "Подключаться только к указанному узлу\n"
#: ../../../init.cpp:176
msgid "Accept command line and JSON-RPC commands\n"
msgstr "Принимать команды из командной строки и через JSON-RPC\n"
#: ../../../init.cpp:177
msgid "Run in the background as a daemon and accept commands\n"
msgstr "Запустить в фоне как демон и принимать команды\n"
#: ../../../init.cpp:178
msgid "This help message\n"
msgstr "Эта справка\n"
#: ../../../init.cpp:284
msgid "Error loading addr.dat \n"
msgstr "Ошибка загрузки addr.dat \n"
#: ../../../init.cpp:290
msgid "Error loading blkindex.dat \n"
msgstr "Ошибка загрузки blkindex.dat \n"
#: ../../../init.cpp:297
msgid "Error loading wallet.dat \n"
msgstr "Ошибка загрузки wallet.dat \n"
#: ../../../init.cpp:365
msgid "Invalid -proxy address"
msgstr "Неверный адрес -proxy"
#: ../../../init.cpp:385
msgid "Invalid amount for -paytxfee=<amount>"
msgstr "Неверное значение для -paytxfee=<amount>"
#: ../../../init.cpp:389
msgid "Warning: -paytxfee is set very high. This is the transaction fee you will pay if you send a transaction."
msgstr "Внимание: -paytxfee установлено в очень большое значение. Это комиссия, которую вы будете платить при переводе."
#: ../../../main.cpp:1641
msgid "Warning: Disk space is low "
msgstr "Внимание: мало места на диске "
#: ../../../main.cpp:3505
#, c-format
msgid "Error: This is an oversized transaction that requires a transaction fee of %s "
msgstr "Ошибка: этот перевод слишком большого размера, который требует комиссию %s "
#: ../../../main.cpp:3507
msgid "Error: Transaction creation failed "
msgstr "Ошибка: не удалось создать перевод "
#: ../../../main.cpp:3512
#: ../../../ui.cpp:1964
#: ../../../ui.cpp:1966
#: ../../../ui.cpp:2107
#: ../../../ui.cpp:2260
msgid "Sending..."
msgstr "Отправка..."
#: ../../../main.cpp:3516
msgid "Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
msgstr "Перевод был отклонен. Это могло произойти, если некоторые из монет в вашем кошельке уже были потрачены, например, если вы использовали копию wallet.dat, и монеты были потрачены в копии, но не отмечены израсходованными здесь."
#: ../../../main.cpp:3528
msgid "Invalid amount"
msgstr "Неверное количество"
#: ../../../main.cpp:3530
#: ../../../ui.cpp:2174
#: ../../../ui.cpp:2245
msgid "Insufficient funds"
msgstr "Недостаточно средств"
#: ../../../main.cpp:3535
msgid "Invalid bitcoin address"
msgstr "Неверный адрес bitcoin"
#: ../../../rpc.cpp:963
#: ../../../rpc.cpp:965
#, c-format
msgid "To use the %s option"
msgstr "Чтобы использовать опцию %s"
#: ../../../rpc.cpp:967
#, c-format
msgid ""
"Warning: %s, you must set rpcpassword=<password>\n"
"in the configuration file: %s\n"
"If the file does not exist, create it with owner-readable-only file permissions.\n"
msgstr ""
"Внимание: %s, вы должны установить rpcpassword=<пароль>\n"
"в конфигурационном файле: %s\n"
"Если файл не существует, создайте его с правами \"чтение только владельцем\".\n"
#: ../../../rpc.cpp:1100
#, c-format
msgid ""
"You must set rpcpassword=<password> in the configuration file:\n"
"%s\n"
"If the file does not exist, create it with owner-readable-only file permissions."
msgstr ""
"Вы должны установить rpcpassword=<пароль> в конфигурационном файле:\n"
"%s\n"
"Если файл не существует, создайте его с правами \"чтение только владельцем\"."
#: ../../../ui.cpp:202
#, c-format
msgid "This transaction is over the size limit. You can still send it for a fee of %s, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?"
msgstr "Этот перевод превышает допустимый лимит. Вы можете провести его с комиссией %s, которую получат узлы, обрабатывающие перевод, и поможет поддерживать сеть. Вы хотите заплатить комиссию?"
#: ../../../ui.cpp:301
msgid "Status"
msgstr "Статус"
#: ../../../ui.cpp:302
msgid "Date"
msgstr "Дата"
#: ../../../ui.cpp:303
msgid "Description"
msgstr "Описание"
#: ../../../ui.cpp:304
msgid "Debit"
msgstr "Дебет"
#: ../../../ui.cpp:305
msgid "Credit"
msgstr "Кредит"
#: ../../../ui.cpp:511
#, c-format
msgid "Open for %d blocks"
msgstr "Открыто для %d блоков"
#: ../../../ui.cpp:513
#, c-format
msgid "Open until %s"
msgstr "Открыто до %s"
#: ../../../ui.cpp:519
#, c-format
msgid "%d/offline?"
msgstr "%d/оффлайн?"
#: ../../../ui.cpp:521
#, c-format
msgid "%d/unconfirmed"
msgstr "%d/не подтверждено"
#: ../../../ui.cpp:523
#, c-format
msgid "%d confirmations"
msgstr "%d подтверждений"
#: ../../../ui.cpp:608
msgid "Generated"
msgstr "Сгенерировано"
#: ../../../ui.cpp:616
#, c-format
msgid "Generated (%s matures in %d more blocks)"
msgstr "Сгенерировано (%s станет доступно через %d блоков)"
#: ../../../ui.cpp:620
msgid "Generated - Warning: This block was not received by any other nodes and will probably not be accepted!"
msgstr "Сгенерировано - Внимание: этот блок не был получен ни одним узлом и, скорее всего, не будет принят!"
#: ../../../ui.cpp:624
msgid "Generated (not accepted)"
msgstr "Сгенерировано (не принято)"
#: ../../../ui.cpp:634
msgid "From: "
msgstr "От: "
#: ../../../ui.cpp:658
msgid "Received with: "
msgstr "Получено для: "
#: ../../../ui.cpp:704
msgid "Payment to yourself"
msgstr "Платёж самому себе"
#: ../../../ui.cpp:741
msgid "To: "
msgstr "Кому: "
#: ../../../ui.cpp:1049
msgid " Generating"
msgstr " Генерация"
#: ../../../ui.cpp:1051
msgid "(not connected)"
msgstr "(не подключен)"
#: ../../../ui.cpp:1054
#, c-format
msgid " %d connections %d blocks %d transactions"
msgstr " %d подключений %d блоков %d переводов"
#: ../../../ui.cpp:1165
#: ../../../ui.cpp:2560
msgid "New Receiving Address"
msgstr "Новый адрес получения"
#: ../../../ui.cpp:1166
#: ../../../ui.cpp:2561
msgid ""
"You should use a new address for each payment you receive.\n"
"\n"
"Label"
msgstr ""
"Вы должны использовать новый адрес для каждого получаемого платежа.\n"
"\n"
"Метка"
#: ../../../ui.cpp:1235
msgid "<b>Status:</b> "
msgstr "<b>Статус:</b> "
#: ../../../ui.cpp:1240
msgid ", has not been successfully broadcast yet"
msgstr ", ещё не был успешно разослан"
#: ../../../ui.cpp:1242
#, c-format
msgid ", broadcast through %d node"
msgstr ", рассылка через %d узел"
#: ../../../ui.cpp:1244
#, c-format
msgid ", broadcast through %d nodes"
msgstr ", рассылка через %d узлов"
#: ../../../ui.cpp:1248
msgid "<b>Date:</b> "
msgstr "<b>Дата:</b> "
#: ../../../ui.cpp:1256
msgid "<b>Source:</b> Generated<br>"
msgstr "<b>Источник:</b> Сгенерировано<br>"
#: ../../../ui.cpp:1262
#: ../../../ui.cpp:1280
msgid "<b>From:</b> "
msgstr "<b>От:</b> "
#: ../../../ui.cpp:1280
msgid "unknown"
msgstr "аноним"
#: ../../../ui.cpp:1281
#: ../../../ui.cpp:1305
#: ../../../ui.cpp:1364
msgid "<b>To:</b> "
msgstr "<b>Кому:</b> "
#: ../../../ui.cpp:1284
msgid " (yours, label: "
msgstr " (ваш, метка: "
#: ../../../ui.cpp:1286
msgid " (yours)"
msgstr " (ваш)"
#: ../../../ui.cpp:1323
#: ../../../ui.cpp:1335
#: ../../../ui.cpp:1398
msgid "<b>Credit:</b> "
msgstr "<b>Кредит:</b> "
#: ../../../ui.cpp:1325
#, c-format
msgid "(%s matures in %d more blocks)"
msgstr "(%s станет доступно через %d блоков)"
#: ../../../ui.cpp:1327
msgid "(not accepted)"
msgstr "(не принято)"
#: ../../../ui.cpp:1372
#: ../../../ui.cpp:1395
msgid "<b>Debit:</b> "
msgstr "<b>Дебет:</b> "
#: ../../../ui.cpp:1386
msgid "<b>Transaction fee:</b> "
msgstr "<b>Комиссия:</b> "
#: ../../../ui.cpp:1402
msgid "<b>Net amount:</b> "
msgstr "<b>Количество сети:</b> "
#: ../../../ui.cpp:1409
msgid "Message:"
msgstr "Сообщение:"
#: ../../../ui.cpp:1412
msgid "Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours."
msgstr "Сгенерированные монеты должны ждать 120 блоков, прежде чем они могут быть потрачены. Когда вы сгенерировали этот блок, он был разослан в сети для добавления в цепь блоков. Если не удалось добавить этот блок в цепь, он будет обозначен как \"не принятый\" и не может быть потрачен. Такое может случиться, если другой узел сгенерировал блок через несколько секунд после вас."
#: ../../../ui.cpp:1593
msgid "Cannot write autostart/bitcoin.desktop file"
msgstr "Не удаётся записать файл autostart/bitcoin.desktop"
#: ../../../ui.cpp:1629
msgid "Main"
msgstr "Основные"
#: ../../../ui.cpp:1634
msgid "&Start Bitcoin on window system startup"
msgstr "&Запускать Bitcoin при запуске оконной системы"
#: ../../../ui.cpp:1641
msgid "&Minimize on close"
msgstr "&Сворачивать при закрытии"
#: ../../../ui.cpp:1798
#, c-format
msgid "version %s%s BETA"
msgstr "версия %s%s бета"
#: ../../../ui.cpp:1884
msgid "n/a"
msgstr "н/д"
#: ../../../ui.cpp:1885
msgid "Can't include a message when sending to a Bitcoin address"
msgstr "Не удаётся включить сообщение при отправке на адрес Bitcoin"
#: ../../../ui.cpp:1938
msgid "Error in amount "
msgstr "Ошибка в количестве "
#: ../../../ui.cpp:1938
#: ../../../ui.cpp:1943
#: ../../../ui.cpp:1948
#: ../../../ui.cpp:1974
#: ../../../uibase.cpp:59
msgid "Send Coins"
msgstr "Отправить монеты"
#: ../../../ui.cpp:1943
msgid "Amount exceeds your balance "
msgstr "Количество превышает ваш баланс "
#: ../../../ui.cpp:1948
msgid "Total exceeds your balance when the "
msgstr "Общая сумма превышает ваш баланс, когда "
#: ../../../ui.cpp:1948
msgid " transaction fee is included "
msgstr " комиссия включена "
#: ../../../ui.cpp:1964
msgid "Payment sent "
msgstr "Платёж отправлен "
#: ../../../ui.cpp:1974
msgid "Invalid address "
msgstr "Неверный адрес "
#: ../../../ui.cpp:2028
#, c-format
msgid "Sending %s to %s"
msgstr "Отправка %s для %s"
#: ../../../ui.cpp:2101
#: ../../../ui.cpp:2134
msgid "CANCELLED"
msgstr "ОТМЕНЕНО"
#: ../../../ui.cpp:2105
msgid "Cancelled"
msgstr "Отменено"
#: ../../../ui.cpp:2107
msgid "Transfer cancelled "
msgstr "Передача отменена "
#: ../../../ui.cpp:2160
msgid "Error: "
msgstr "Ошибка: "
#: ../../../ui.cpp:2179
msgid "Connecting..."
msgstr "Подключение..."
#: ../../../ui.cpp:2184
msgid "Unable to connect"
msgstr "Невозможно подключиться"
#: ../../../ui.cpp:2189
msgid "Requesting public key..."
msgstr "Запрос публичного ключа..."
#: ../../../ui.cpp:2201
msgid "Received public key..."
msgstr "Получен публичный ключ..."
#: ../../../ui.cpp:2215
msgid "Recipient is not accepting transactions sent by IP address"
msgstr "Получатель не принимает переводы на IP-адрес"
#: ../../../ui.cpp:2217
msgid "Transfer was not accepted"
msgstr "Передача не принята"
#: ../../../ui.cpp:2226
msgid "Invalid response received"
msgstr "Получен неверный отклик"
#: ../../../ui.cpp:2241
msgid "Creating transaction..."
msgstr "Создание перевода..."
#: ../../../ui.cpp:2253
#, c-format
msgid "This is an oversized transaction that requires a transaction fee of %s"
msgstr "Это слишком большой перевод, который требует комиссию в размере %s"
#: ../../../ui.cpp:2255
msgid "Transaction creation failed"
msgstr "Не удалось создать перевод"
#: ../../../ui.cpp:2262
msgid "Transaction aborted"
msgstr "Перевод прерван"
#: ../../../ui.cpp:2270
msgid "Lost connection, transaction cancelled"
msgstr "Соединение разорвано, перевод отменён"
#: ../../../ui.cpp:2286
msgid "Sending payment..."
msgstr "Отправка платежа..."
#: ../../../ui.cpp:2292
msgid "The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."
msgstr "Перевод был отклонён. Это могло произойти, если некоторые из монет в вашем кошельке уже были потрачены, например, если вы использовали копию wallet.dat, и монеты были потрачены в копии, но не отмечены израсходованными здесь."
#: ../../../ui.cpp:2301
msgid "Waiting for confirmation..."
msgstr "Ожидание подтверждения..."
#: ../../../ui.cpp:2319
msgid ""
"The payment was sent, but the recipient was unable to verify it.\n"
"The transaction is recorded and will credit to the recipient,\n"
"but the comment information will be blank."
msgstr ""
"Платёж был отправлен, но получатель не смог проверить его.\n"
"Перевод был записан и будет начислен получателю,\n"
"но поле комментария будет пустое."
#: ../../../ui.cpp:2328
msgid "Payment was sent, but an invalid response was received"
msgstr "Платёж отправлен, но был получен неверный отклик"
#: ../../../ui.cpp:2334
msgid "Payment completed"
msgstr "Платёж проведён"
#: ../../../ui.cpp:2365
#: ../../../ui.cpp:2511
#: ../../../ui.cpp:2548
msgid "Name"
msgstr "Имя"
#: ../../../ui.cpp:2366
#: ../../../ui.cpp:2511
#: ../../../ui.cpp:2548
msgid "Address"
msgstr "Адрес"
#: ../../../ui.cpp:2368
#: ../../../ui.cpp:2523
msgid "Label"
msgstr "Метка"
#: ../../../ui.cpp:2369
#: ../../../uibase.cpp:902
msgid "Bitcoin Address"
msgstr "Адрес Bitcoin"
#: ../../../ui.cpp:2493
msgid "This is one of your own addresses for receiving payments and cannot be entered in the address book. "
msgstr "Это один из ваших собственных адресов для получения платежей, он не может быть внесён в адресную книгу. "
#: ../../../ui.cpp:2511
#: ../../../ui.cpp:2517
msgid "Edit Address"
msgstr "Правка адреса"
#: ../../../ui.cpp:2523
msgid "Edit Address Label"
msgstr "Правка метки адреса"
#: ../../../ui.cpp:2548
#: ../../../ui.cpp:2554
msgid "Add Address"
msgstr "Добавить адрес"
#: ../../../ui.cpp:2630
msgid "Bitcoin"
msgstr "Bitcoin"
#: ../../../ui.cpp:2632
msgid "Bitcoin - Generating"
msgstr "Bitcoin - Генерация"
#: ../../../ui.cpp:2634
msgid "Bitcoin - (not connected)"
msgstr "Bitcoin - (не подключен)"
#: ../../../ui.cpp:2711
msgid "&Open Bitcoin"
msgstr "&Открыть Bitcoin"
#: ../../../ui.cpp:2712
msgid "O&ptions..."
msgstr "О&пции..."
#: ../../../ui.cpp:2713
#: ../../../uibase.cpp:32
msgid "&Generate Coins"
msgstr "&Генерировать монеты"
#: ../../../ui.cpp:2716
#: ../../../uibase.cpp:25
msgid "E&xit"
msgstr "&Выход"
#: ../../../ui.cpp:2931
msgid "Program has crashed and will terminate. "
msgstr "Сбой программы, завершение. "
#: ../../../uibase.cpp:28
msgid "&File"
msgstr "&Файл"
#: ../../../uibase.cpp:36
msgid "&Your Receiving Addresses..."
msgstr "&Ваши адреса получения..."
#: ../../../uibase.cpp:40
msgid "&Options..."
msgstr "&Опции"
#: ../../../uibase.cpp:43
msgid "&Settings"
msgstr "&Настройки"
#: ../../../uibase.cpp:47
msgid "&About..."
msgstr "&О программе..."
#: ../../../uibase.cpp:50
msgid "&Help"
msgstr "&Справка"
#: ../../../uibase.cpp:60
msgid "Address Book"
msgstr "Адресная книга"
#: ../../../uibase.cpp:75
msgid "Your Bitcoin Address:"
msgstr "Ваш адрес Bitcoin:"
#: ../../../uibase.cpp:82
msgid " &New... "
msgstr " &Новый... "
#: ../../../uibase.cpp:85
#: ../../../uibase.cpp:845
#: ../../../uibase.cpp:948
msgid " &Copy to Clipboard "
msgstr " &Копировать в буфер обмена "
#: ../../../uibase.cpp:99
msgid "Balance:"
msgstr "Баланс:"
#: ../../../uibase.cpp:115
msgid " All"
msgstr " Все"
#: ../../../uibase.cpp:115
msgid " Sent"
msgstr " Отправленные"
#: ../../../uibase.cpp:115
msgid " Received"
msgstr " Полученные"
#: ../../../uibase.cpp:115
msgid " In Progress"
msgstr " В процессе"
#: ../../../uibase.cpp:136
msgid "All Transactions"
msgstr "Все переводы"
#: ../../../uibase.cpp:147
msgid "Sent/Received"
msgstr "Отправленные/Полученные"
#: ../../../uibase.cpp:158
msgid "Sent"
msgstr "Отправленные"
#: ../../../uibase.cpp:169
msgid "Received"
msgstr "Полученные"
#: ../../../uibase.cpp:312
#: ../../../uibase.cpp:473
#: ../../../uibase.cpp:574
#: ../../../uibase.cpp:787
#: ../../../uibase.cpp:848
#: ../../../uibase.cpp:957
#: ../../../uibase.cpp:1046
msgid "OK"
msgstr "ОК"
#: ../../../uibase.cpp:355
msgid "Optional transaction fee you give to the nodes that process your transactions."
msgstr "Необязательная комиссия, которую вы даёте узлам, проводящим ваш перевод."
#: ../../../uibase.cpp:364
msgid "Transaction fee:"
msgstr "Комиссия:"
#: ../../../uibase.cpp:380
msgid "&Limit coin generation to"
msgstr "&Ограничить генерацию монет до"
#: ../../../uibase.cpp:387
msgid "processors"
msgstr "процессоров"
#: ../../../uibase.cpp:393
msgid "&Start Bitcoin on system startup"
msgstr "&Запускать Bitcoin при старте системы"
#: ../../../uibase.cpp:397
msgid "&Minimize to the tray instead of the taskbar"
msgstr "&Сворачивать в трей вместо панели задач"
#: ../../../uibase.cpp:401
msgid "M&inimize to the tray on close"
msgstr "С&ворачивать в трей при закрытии"
#: ../../../uibase.cpp:408
msgid "&Connect through socks4 proxy: "
msgstr "&Подключаться через socks4 прокси: "
#: ../../../uibase.cpp:420
msgid "Proxy &IP:"
msgstr "IP п&рокси:"
#: ../../../uibase.cpp:428
msgid " &Port:"
msgstr " &Порт"
#: ../../../uibase.cpp:450
msgid "// [don't translate] Test panel 2 for future expansion"
msgstr ""
#: ../../../uibase.cpp:454
msgid "// [don't translate] Let's not start multiple pages until the first page is filled up"
msgstr ""
#: ../../../uibase.cpp:476
#: ../../../uibase.cpp:729
#: ../../../uibase.cpp:792
#: ../../../uibase.cpp:851
#: ../../../uibase.cpp:960
#: ../../../uibase.cpp:1049
msgid "Cancel"
msgstr "Отмена"
#: ../../../uibase.cpp:479
msgid "&Apply"
msgstr "&Применить"
#: ../../../uibase.cpp:540
msgid "Bitcoin "
msgstr "Bitcoin "
#: ../../../uibase.cpp:546
msgid "version"
msgstr "версия"
#: ../../../uibase.cpp:557
msgid ""
"Copyright (c) 2009-2010 Bitcoin Developers\n"
"\n"
"This is experimental software.\n"
"\n"
"Distributed under the MIT/X11 software license, see the accompanying file \n"
"license.txt or http://www.opensource.org/licenses/mit-license.php.\n"
"\n"
"This product includes software developed by the OpenSSL Project for use in the \n"
"OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \n"
"Eric Young (eay@cryptsoft.com)."
msgstr ""
"Все права защищены (c) 2009-2010 Bitcoin Developers\n"
"\n"
"Это экспериментальное ПО.\n"
"\n"
"Распространяется под лицензией MIT/X11, см. файл\n"
"license.txt или http://www.opensource.org/licenses/mit-license.php.\n"
"\n"
"Этот продукт включает ПО, разработанное проектом OpenSSL для использования в\n"
"OpenSSL Toolkit (http://www.openssl.org/), и криптографическое ПО, написанное\n"
"Eric Young (eay@cryptsoft.com)."
#: ../../../uibase.cpp:613
msgid "Enter a Bitcoin address (e.g. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) or IP address (e.g. 123.45.6.7)"
msgstr "Введите адрес Bitcoin (напр. 1NS17iag9jJgTHD1VXjvLCEnZuQ3rJED9L) или IP адрес (напр. 123.45.6.7)"
#: ../../../uibase.cpp:627
msgid "Pay &To:"
msgstr "&Кому:"
#: ../../../uibase.cpp:642
msgid "&Paste"
msgstr "&Вставить"
#: ../../../uibase.cpp:645
msgid " Address &Book..."
msgstr " А&дресная книга..."
#: ../../../uibase.cpp:652
msgid "&Amount:"
msgstr "К&оличество:"
#: ../../../uibase.cpp:662
msgid "T&ransfer:"
msgstr "&Передача:"
#: ../../../uibase.cpp:668
msgid " Standard"
msgstr " Стандарт"
#: ../../../uibase.cpp:690
msgid "&From:"
msgstr "О&т:"
#: ../../../uibase.cpp:707
msgid "&Message:"
msgstr "&Сообщение:"
#: ../../../uibase.cpp:724
msgid "&Send"
msgstr "Отп&равить"
#: ../../../uibase.cpp:776
msgid ""
"\n"
"\n"
"Connecting..."
msgstr ""
"\n"
"\n"
"Подключение..."
#: ../../../uibase.cpp:826
msgid "These are your Bitcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you. The highlighted address is displayed in the main window."
msgstr "Это ваши адреса для получения платежей. Вы можете использовать разные для каждого отправителя, чтобы отслеживать, кто вам платит. Выделенный адрес отображается в главном окне."
#: ../../../uibase.cpp:839
#: ../../../uibase.cpp:951
msgid "&Edit..."
msgstr "&Правка..."
#: ../../../uibase.cpp:842
#: ../../../uibase.cpp:954
msgid " &New Address... "
msgstr " &Новый адрес... "
#: ../../../uibase.cpp:914
msgid "Sending"
msgstr "Отправка"
#: ../../../uibase.cpp:922
msgid "These are your Bitcoin addresses for receiving payments. You can give a different one to each sender to keep track of who is paying you. The highlighted address will be displayed in the main window."
msgstr "Это ваши адреса для получения платежей. Вы можете использовать разные для каждого отправителя, чтобы отслеживать, кто вам платит. Выделенный адрес отображается в главном окне."
#: ../../../uibase.cpp:935
msgid "Receiving"
msgstr "Получение"
#: ../../../uibase.cpp:945
msgid "&Delete"
msgstr "&Удалить"
#: ../../../util.cpp:807
msgid "Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly."
msgstr "Внимание: пожалуйста, проверьте дату и время на вашем компьютере. Если часы идут неверно, Bitcoin не будет работать правильно."
#: ../../../uibase.h:149
msgid "Transaction Details"
msgstr "Подробности транзакции"
#: ../../../uibase.h:202
msgid "Options"
msgstr "Опции"
#: ../../../uibase.h:230
msgid "About Bitcoin"
msgstr "О Bitcoin"
#: ../../../uibase.h:340
msgid "Your Bitcoin Addresses"
msgstr "Ваш адрес Bitcoin"
#~ msgid ""
#~ "It's good policy to use a new address for each payment you receive.\n"
#~ "\n"
#~ "Label"
#~ msgstr ""
#~ "Неплохо будет использовать новый адрес для каждого получаемого платежа.\n"
#~ "\n"
#~ "Метка"
#~ msgid "Will appear as \"From: Unknown\""
#~ msgstr "Будет отображаться как \"От: Аноним\""

1858
main.cpp

File diff suppressed because it is too large Load Diff

717
main.h

File diff suppressed because it is too large Load Diff

View File

@@ -4,26 +4,26 @@
INCLUDEPATHS= \
-I"/boost" \
-I"/db/build_unix" \
-I"/openssl/include" \
-I"/wxwidgets/lib/gcc_lib/mswud" \
-I"/wxwidgets/include"
-I"C:\boost-1.43.0-mgw" \
-I"C:\db-4.7.25.NC-mgw\build_unix" \
-I"C:\openssl-1.0.0c-mgw\include" \
-I"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib\mswud" \
-I"C:\wxWidgets-2.9.1-mgw\include"
LIBPATHS= \
-L"/boost/stage/lib" \
-L"/db/build_unix" \
-L"/openssl/out" \
-L"/wxwidgets/lib/gcc_lib"
-L"C:\boost-1.43.0-mgw\stage\lib" \
-L"C:\db-4.7.25.NC-mgw\build_unix" \
-L"C:\openssl-1.0.0c-mgw" \
-L"C:\wxWidgets-2.9.1-mgw\lib\gcc_lib"
WXLIBS= \
-l wxmsw29ud_html -l wxmsw29ud_core -l wxmsw29ud_adv -l wxbase29ud -l wxtiffd -l wxjpegd -l wxpngd -l wxzlibd
LIBS= \
-l libboost_system-mgw34-mt-d \
-l libboost_filesystem-mgw34-mt-d \
-l libboost_program_options-mgw34-mt-d \
-l libboost_thread-mgw34-mt-d \
-l boost_system-mgw45-mt-s-1_43 \
-l boost_filesystem-mgw45-mt-s-1_43 \
-l boost_program_options-mgw45-mt-s-1_43 \
-l boost_thread-mgw45-mt-s-1_43 \
-l db_cxx \
-l eay32 \
-l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l shlwapi
@@ -54,7 +54,7 @@ obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_X86_ASM_AVAILABLE -o $@ $<
obj/ui_res.o: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp rc/send16masknoshadow.bmp rc/send20.bmp rc/send20mask.bmp rc/addressbook16.bmp rc/addressbook16mask.bmp rc/addressbook20.bmp rc/addressbook20mask.bmp
windres $(DEFS) $(INCLUDEPATHS) -o $@ -i $<

View File

@@ -1,10 +1,11 @@
# Copyright (c) 2009-2010 Satoshi Nakamoto
# Copyright (c) 2010 Laszlo Hanyecz
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.
# Mac OS X makefile for bitcoin
# Laszlo Hanyecz (solar@heliacal.net)
CXX=llvm-g++
DEPSDIR=/Users/macosuser/bitcoin/deps
INCLUDEPATHS= \
@@ -21,13 +22,14 @@ LIBS= -dead_strip \
$(DEPSDIR)/lib/libboost_filesystem.a \
$(DEPSDIR)/lib/libboost_program_options.a \
$(DEPSDIR)/lib/libboost_thread.a \
$(DEPSDIR)/lib/libssl.a \
$(DEPSDIR)/lib/libcrypto.a
DEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -D__WXMAC_OSX__ -DNOPCH -DMSG_NOSIGNAL=0
DEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -D__WXMAC_OSX__ -DNOPCH -DMSG_NOSIGNAL=0 -DUSE_SSL
DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
# ppc doesn't work because we don't support big-endian
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
CFLAGS=-mmacosx-version-min=10.5 -arch i386 -arch x86_64 -O3 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
@@ -48,22 +50,24 @@ all: bitcoin
obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
$(CXX) -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
$(CXX) -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_ASM -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
$(CXX) -c $(CFLAGS) -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%)
g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
$(CXX) $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
clean:
-rm -f bitcoin bitcoind
-rm -f obj/*.o
-rm -f obj/nogui/*.o
-rm -f cryptopp/obj/*.o

View File

@@ -7,11 +7,13 @@ INCLUDEPATHS= \
-I"/usr/local/include/wx-2.9" \
-I"/usr/local/lib/wx/include/gtk2-unicode-debug-static-2.9"
# for wxWidgets 2.9.1, add -l Xxf86vm
WXLIBS= \
-Wl,-Bstatic \
-l wx_gtk2ud-2.9 \
-Wl,-Bdynamic \
-l gtk-x11-2.0 -l SM
-l gtk-x11-2.0 \
-l SM
# for boost 1.37, add -mt to the boost libraries
LIBS= \
@@ -21,11 +23,14 @@ LIBS= \
-l boost_program_options \
-l boost_thread \
-l db_cxx \
-l ssl \
-l crypto \
-Wl,-Bdynamic \
-l gthread-2.0
-l gthread-2.0 \
-l z \
-l dl
DEFS=-D__WXGTK__ -DNOPCH
DEFS=-D__WXGTK__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL
DEBUGFLAGS=-g -D__WXDEBUG__
CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
@@ -51,16 +56,19 @@ obj/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -DGUI -o $@ $<
cryptopp/obj/%.o: cryptopp/%.cpp
g++ -c $(CFLAGS) -O3 -DCRYPTOPP_DISABLE_SSE2 -o $@ $<
g++ -c $(CFLAGS) -O3 -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o
obj/sha256.o: sha256.cpp
g++ -c $(CFLAGS) -msse2 -O3 -march=amdfam10 -o $@ $<
bitcoin: $(OBJS) obj/ui.o obj/uibase.o obj/sha256.o
g++ $(CFLAGS) -o $@ $^ $(WXLIBS) $(LIBS)
obj/nogui/%.o: %.cpp $(HEADERS)
g++ -c $(CFLAGS) -o $@ $<
bitcoind: $(OBJS:obj/%=obj/nogui/%)
bitcoind: $(OBJS:obj/%=obj/nogui/%) obj/sha256.o
g++ $(CFLAGS) -o $@ $^ $(LIBS)

View File

@@ -7,29 +7,32 @@ INCLUDEPATHS= \
/I"/boost" \
/I"/db/build_windows" \
/I"/openssl/include" \
/I"/wxwidgets/lib/vc_lib/mswud" \
/I"/wxwidgets/lib/vc_lib/mswu" \
/I"/wxwidgets/include"
LIBPATHS= \
/LIBPATH:"/boost/stage/lib" \
/LIBPATH:"/db/build_windows/debug" \
/LIBPATH:"/openssl/out" \
/LIBPATH:"/wxwidgets/lib/vc_lib"
/LIBPATH:"/db/build_windows/Release" \
/LIBPATH:"/openssl/lib" \
/LIBPATH:"/wxwidgets/lib/vc_lib" \
/NODEFAULTLIB:libc.lib /NODEFAULTLIB:libcmt.lib \
/NODEFAULTLIB:libcd.lib /NODEFAULTLIB:libcmtd.lib \
/NODEFAULTLIB:msvcrtd.lib
WXLIBS=wxmsw29ud_html.lib wxmsw29ud_core.lib wxmsw29ud_adv.lib wxbase29ud.lib wxtiffd.lib wxjpegd.lib wxpngd.lib wxzlibd.lib
WXLIBS=wxmsw29u.lib wxtiff.lib wxjpeg.lib wxpng.lib wxzlib.lib
LIBS= \
libboost_system-vc80-mt-gd.lib \
libboost_filesystem-vc80-mt-gd.lib \
libboost_program_options-vc80-mt-gd.lib \
libboost_thread-vc80-mt-gd.lib \
libdb47sd.lib \
libboost_system-vc100-mt.lib \
libboost_filesystem-vc100-mt.lib \
libboost_program_options-vc100-mt.lib \
libboost_thread-vc100-mt.lib \
libdb47s.lib \
libeay32.lib \
kernel32.lib user32.lib gdi32.lib comdlg32.lib winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib rpcrt4.lib advapi32.lib ws2_32.lib shlwapi.lib
DEFS=/DWIN32 /D__WXMSW__ /D_WINDOWS /DNOPCH
DEBUGFLAGS=/Zi /D__WXDEBUG__
CFLAGS=/c /nologo /MDd /EHsc /GR /Zm300 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
DEBUGFLAGS=/Os
CFLAGS=/MD /c /nologo /EHsc /GR /Zm300 $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h \
script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h noui.h init.h
@@ -82,7 +85,7 @@ obj\ui.res: ui.rc rc/bitcoin.ico rc/check.ico rc/send16.bmp rc/send16mask.bmp r
rc $(INCLUDEPATHS) $(DEFS) /Fo$@ %s
bitcoin.exe: $(OBJS) obj\ui.obj obj\uibase.obj obj\ui.res
link /nologo /DEBUG /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(WXLIBS) $(LIBS)
link /nologo /SUBSYSTEM:WINDOWS /OUT:$@ $(LIBPATHS) $** $(WXLIBS) $(LIBS)
.cpp{obj\nogui}.obj:
@@ -105,7 +108,7 @@ obj\nogui\rpc.obj: $(HEADERS)
obj\nogui\init.obj: $(HEADERS)
bitcoind.exe: $(OBJS:obj\=obj\nogui\) obj\ui.res
link /nologo /DEBUG /OUT:$@ $(LIBPATHS) $** $(LIBS)
link /nologo /OUT:$@ $(LIBPATHS) $** $(LIBS)
clean:

336
net.cpp
View File

@@ -4,6 +4,8 @@
#include "headers.h"
static const int MAX_OUTBOUND_CONNECTIONS = 8;
void ThreadMessageHandler2(void* parg);
void ThreadSocketHandler2(void* parg);
void ThreadOpenConnections2(void* parg);
@@ -18,12 +20,11 @@ bool OpenNetworkConnection(const CAddress& addrConnect);
//
bool fClient = false;
uint64 nLocalServices = (fClient ? 0 : NODE_NETWORK);
CAddress addrLocalHost(0, DEFAULT_PORT, nLocalServices);
CAddress addrLocalHost(0, 0, nLocalServices);
CNode* pnodeLocalHost = NULL;
uint64 nLocalHostNonce = 0;
array<int, 10> vnThreadsRunning;
SOCKET hListenSocket = INVALID_SOCKET;
int64 nThreadSocketHandlerHeartbeat = INT64_MAX;
vector<CNode*> vNodes;
CCriticalSection cs_vNodes;
@@ -64,7 +65,7 @@ bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet)
SOCKET hSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (hSocket == INVALID_SOCKET)
return false;
#if defined(__BSD__) || defined(__WXMAC_OSX__)
#ifdef BSD
int set = 1;
setsockopt(hSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&set, sizeof(int));
#endif
@@ -127,7 +128,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
string strLine;
while (RecvLine(hSocket, strLine))
{
if (strLine.empty())
if (strLine.empty()) // HTTP response is separated from headers by blank line
{
loop
{
@@ -136,6 +137,8 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
closesocket(hSocket);
return false;
}
if (pszKeyword == NULL)
break;
if (strLine.find(pszKeyword) != -1)
{
strLine = strLine.substr(strLine.find(pszKeyword) + strlen(pszKeyword));
@@ -143,7 +146,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
}
}
closesocket(hSocket);
if (strLine.find("<"))
if (strLine.find("<") != -1)
strLine = strLine.substr(0, strLine.find("<"));
strLine = strLine.substr(strspn(strLine.c_str(), " \t\n\r"));
while (strLine.size() > 0 && isspace(strLine[strLine.size()-1]))
@@ -160,7 +163,7 @@ bool GetMyExternalIP2(const CAddress& addrConnect, const char* pszGet, const cha
return error("GetMyExternalIP() : connection closed");
}
// We now get our external IP from the IRC server first and only use this as a backup
bool GetMyExternalIP(unsigned int& ipRet)
{
CAddress addrConnect;
@@ -173,28 +176,13 @@ bool GetMyExternalIP(unsigned int& ipRet)
for (int nLookup = 0; nLookup <= 1; nLookup++)
for (int nHost = 1; nHost <= 2; nHost++)
{
// We should be phasing out our use of sites like these. If we need
// replacements, we should ask for volunteers to put this simple
// php file on their webserver that prints the client IP:
// <?php echo $_SERVER["REMOTE_ADDR"]; ?>
if (nHost == 1)
{
addrConnect = CAddress("70.86.96.218:80"); // www.ipaddressworld.com
if (nLookup == 1)
{
struct hostent* phostent = gethostbyname("www.ipaddressworld.com");
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
}
pszGet = "GET /ip.php HTTP/1.1\r\n"
"Host: www.ipaddressworld.com\r\n"
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
"Connection: close\r\n"
"\r\n";
pszKeyword = "IP:";
}
else if (nHost == 2)
{
addrConnect = CAddress("208.78.68.70:80"); // checkip.dyndns.org
addrConnect = CAddress("91.198.22.70:80"); // checkip.dyndns.org
if (nLookup == 1)
{
@@ -211,6 +199,25 @@ bool GetMyExternalIP(unsigned int& ipRet)
pszKeyword = "Address:";
}
else if (nHost == 2)
{
addrConnect = CAddress("74.208.43.192:80"); // www.showmyip.com
if (nLookup == 1)
{
struct hostent* phostent = gethostbyname("www.showmyip.com");
if (phostent && phostent->h_addr_list && phostent->h_addr_list[0])
addrConnect = CAddress(*(u_long*)phostent->h_addr_list[0], htons(80));
}
pszGet = "GET /simple/ HTTP/1.1\r\n"
"Host: www.showmyip.com\r\n"
"User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)\r\n"
"Connection: close\r\n"
"\r\n";
pszKeyword = NULL; // Returns just IP address
}
if (GetMyExternalIP2(addrConnect, pszGet, pszKeyword, ipRet))
return true;
@@ -219,16 +226,47 @@ bool GetMyExternalIP(unsigned int& ipRet)
return false;
}
void ThreadGetMyExternalIP(void* parg)
{
// Wait for IRC to get it first
if (!GetBoolArg("-noirc"))
{
for (int i = 0; i < 2 * 60; i++)
{
Sleep(1000);
if (fGotExternalIP || fShutdown)
return;
}
}
// Fallback in case IRC fails to get it
if (GetMyExternalIP(addrLocalHost.ip))
{
printf("GetMyExternalIP() returned %s\n", addrLocalHost.ToStringIP().c_str());
if (addrLocalHost.IsRoutable())
{
// If we already connected to a few before we had our IP, go back and addr them.
// setAddrKnown automatically filters any duplicate sends.
CAddress addr(addrLocalHost);
addr.nTime = GetAdjustedTime();
CRITICAL_BLOCK(cs_vNodes)
foreach(CNode* pnode, vNodes)
pnode->PushAddress(addr);
}
}
}
bool AddAddress(CAddress addr)
bool AddAddress(CAddress addr, int64 nTimePenalty)
{
if (!addr.IsRoutable())
return false;
if (addr.ip == addrLocalHost.ip)
return false;
addr.nTime = max((int64)0, (int64)addr.nTime - nTimePenalty);
CRITICAL_BLOCK(cs_mapAddresses)
{
map<vector<unsigned char>, CAddress>::iterator it = mapAddresses.find(addr.GetKey());
@@ -605,7 +643,9 @@ void ThreadSocketHandler2(void* parg)
FD_ZERO(&fdsetSend);
FD_ZERO(&fdsetError);
SOCKET hSocketMax = 0;
FD_SET(hListenSocket, &fdsetRecv);
if(hListenSocket != INVALID_SOCKET)
FD_SET(hListenSocket, &fdsetRecv);
hSocketMax = max(hSocketMax, hListenSocket);
CRITICAL_BLOCK(cs_vNodes)
{
@@ -642,17 +682,27 @@ void ThreadSocketHandler2(void* parg)
//
// Accept new connections
//
if (FD_ISSET(hListenSocket, &fdsetRecv))
if (hListenSocket != INVALID_SOCKET && FD_ISSET(hListenSocket, &fdsetRecv))
{
struct sockaddr_in sockaddr;
socklen_t len = sizeof(sockaddr);
SOCKET hSocket = accept(hListenSocket, (struct sockaddr*)&sockaddr, &len);
CAddress addr(sockaddr);
int nInbound = 0;
CRITICAL_BLOCK(cs_vNodes)
foreach(CNode* pnode, vNodes)
if (pnode->fInbound)
nInbound++;
if (hSocket == INVALID_SOCKET)
{
if (WSAGetLastError() != WSAEWOULDBLOCK)
printf("socket error accept failed: %d\n", WSAGetLastError());
}
else if (nInbound >= GetArg("-maxconnections", 125) - MAX_OUTBOUND_CONNECTIONS)
{
closesocket(hSocket);
}
else
{
printf("accepted connection %s\n", addr.ToStringLog().c_str());
@@ -691,32 +741,39 @@ void ThreadSocketHandler2(void* parg)
CDataStream& vRecv = pnode->vRecv;
unsigned int nPos = vRecv.size();
// typical socket buffer is 8K-64K
char pchBuf[0x10000];
int nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT);
if (nBytes > 0)
{
vRecv.resize(nPos + nBytes);
memcpy(&vRecv[nPos], pchBuf, nBytes);
pnode->nLastRecv = GetTime();
}
else if (nBytes == 0)
{
// socket closed gracefully
if (nPos > 1000*GetArg("-maxreceivebuffer", 2*1000)) {
if (!pnode->fDisconnect)
printf("socket closed\n");
printf("socket recv flood control disconnect (%d bytes)\n", vRecv.size());
pnode->CloseSocketDisconnect();
}
else if (nBytes < 0)
{
// error
int nErr = WSAGetLastError();
if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
else {
// typical socket buffer is 8K-64K
char pchBuf[0x10000];
int nBytes = recv(pnode->hSocket, pchBuf, sizeof(pchBuf), MSG_DONTWAIT);
if (nBytes > 0)
{
vRecv.resize(nPos + nBytes);
memcpy(&vRecv[nPos], pchBuf, nBytes);
pnode->nLastRecv = GetTime();
}
else if (nBytes == 0)
{
// socket closed gracefully
if (!pnode->fDisconnect)
printf("socket recv error %d\n", nErr);
printf("socket closed\n");
pnode->CloseSocketDisconnect();
}
else if (nBytes < 0)
{
// error
int nErr = WSAGetLastError();
if (nErr != WSAEWOULDBLOCK && nErr != WSAEMSGSIZE && nErr != WSAEINTR && nErr != WSAEINPROGRESS)
{
if (!pnode->fDisconnect)
printf("socket recv error %d\n", nErr);
pnode->CloseSocketDisconnect();
}
}
}
}
}
@@ -749,6 +806,11 @@ void ThreadSocketHandler2(void* parg)
pnode->CloseSocketDisconnect();
}
}
if (vSend.size() > 1000*GetArg("-maxsendbuffer", 256)) {
if (!pnode->fDisconnect)
printf("socket send flood control disconnect (%d bytes)\n", vSend.size());
pnode->CloseSocketDisconnect();
}
}
}
}
@@ -783,7 +845,6 @@ void ThreadSocketHandler2(void* parg)
pnode->Release();
}
nThreadSocketHandlerHeartbeat = GetTime();
Sleep(10);
}
}
@@ -802,16 +863,46 @@ void ThreadSocketHandler2(void* parg)
unsigned int pnSeed[] =
{
0x35218252, 0x9c9c9618, 0xda6bacad, 0xb9aca862, 0x97c235c6,
0x146f9562, 0xb67b9e4b, 0x87cf4bc0, 0xb83945d0, 0x984333ad,
0xbbeec555, 0x6f0eb440, 0xe0005318, 0x7797e460, 0xddc60fcc,
0xb3bbd24a, 0x1ac85746, 0x641846a6, 0x85ee1155, 0xbb2e7a4c,
0x9cb8514b, 0xfc342648, 0x62958fae, 0xd0a8c87a, 0xa800795b,
0xda8c814e, 0x256a0c80, 0x3f23ec63, 0xd565df43, 0x997d9044,
0xaa121448, 0xbed8688e, 0x59d09a5e, 0xb2931243, 0x3730ba18,
0xdd3462d0, 0x4e4d1448, 0x171df645, 0x84ee1155,
0x248ac445, 0x0e634444, 0x0ded1b63, 0x30c01e60,
0xa2b9a094, 0x29e4fd43, 0x9ce61b4c, 0xdae09744,
0x1ddb1032, 0x6242ce40, 0x52d6a445, 0x2dd7a445, 0x8a53cd47, 0x73263750, 0xda23c257, 0xecd4ed57,
0x0a40ec59, 0x75dce160, 0x7df76791, 0x89370bad, 0xa4f214ad, 0x767700ae, 0x638b0418, 0x868a1018,
0xcd9f332e, 0x0129653e, 0xcc92dc3e, 0x96671640, 0x56487e40, 0x5b66f440, 0xb1d01f41, 0xf1dc6041,
0xc1d12b42, 0x86ba1243, 0x6be4df43, 0x6d4cef43, 0xd18e0644, 0x1ab0b344, 0x6584a345, 0xe7c1a445,
0x58cea445, 0xc5daa445, 0x21dda445, 0x3d3b5346, 0x13e55347, 0x1080d24a, 0x8e611e4b, 0x81518e4b,
0x6c839e4b, 0xe2ad0a4c, 0xfbbc0a4c, 0x7f5b6e4c, 0x7244224e, 0x1300554e, 0x20690652, 0x5a48b652,
0x75c5c752, 0x4335cc54, 0x340fd154, 0x87c07455, 0x087b2b56, 0x8a133a57, 0xac23c257, 0x70374959,
0xfb63d45b, 0xb9a1685c, 0x180d765c, 0x674f645d, 0x04d3495e, 0x1de44b5e, 0x4ee8a362, 0x0ded1b63,
0xc1b04b6d, 0x8d921581, 0x97b7ea82, 0x1cf83a8e, 0x91490bad, 0x09dc75ae, 0x9a6d79ae, 0xa26d79ae,
0x0fd08fae, 0x0f3e3fb2, 0x4f944fb2, 0xcca448b8, 0x3ecd6ab8, 0xa9d5a5bc, 0x8d0119c1, 0x045997d5,
0xca019dd9, 0x0d526c4d, 0xabf1ba44, 0x66b1ab55, 0x1165f462, 0x3ed7cbad, 0xa38fae6e, 0x3bd2cbad,
0xd36f0547, 0x20df7840, 0x7a337742, 0x549f8e4b, 0x9062365c, 0xd399f562, 0x2b5274a1, 0x8edfa153,
0x3bffb347, 0x7074bf58, 0xb74fcbad, 0x5b5a795b, 0x02fa29ce, 0x5a6738d4, 0xe8a1d23e, 0xef98c445,
0x4b0f494c, 0xa2bc1e56, 0x7694ad63, 0xa4a800c3, 0x05fda6cd, 0x9f22175e, 0x364a795b, 0x536285d5,
0xac44c9d4, 0x0b06254d, 0x150c2fd4, 0x32a50dcc, 0xfd79ce48, 0xf15cfa53, 0x66c01e60, 0x6bc26661,
0xc03b47ae, 0x4dda1b81, 0x3285a4c1, 0x883ca96d, 0x35d60a4c, 0xdae09744, 0x2e314d61, 0x84e247cf,
0x6c814552, 0x3a1cc658, 0x98d8f382, 0xe584cb5b, 0x15e86057, 0x7b01504e, 0xd852dd48, 0x56382f56,
0x0a5df454, 0xa0d18d18, 0x2e89b148, 0xa79c114c, 0xcbdcd054, 0x5523bc43, 0xa9832640, 0x8a066144,
0x3894c3bc, 0xab76bf58, 0x6a018ac1, 0xfebf4f43, 0x2f26c658, 0x31102f4e, 0x85e929d5, 0x2a1c175e,
0xfc6c2cd1, 0x27b04b6d, 0xdf024650, 0x161748b8, 0x28be6580, 0x57be6580, 0x1cee677a, 0xaa6bb742,
0x9a53964b, 0x0a5a2d4d, 0x2434c658, 0x9a494f57, 0x1ebb0e48, 0xf610b85d, 0x077ecf44, 0x085128bc,
0x5ba17a18, 0x27ca1b42, 0xf8a00b56, 0xfcd4c257, 0xcf2fc15e, 0xd897e052, 0x4cada04f, 0x2f35f6d5,
0x382ce8c9, 0xe523984b, 0x3f946846, 0x60c8be43, 0x41da6257, 0xde0be142, 0xae8a544b, 0xeff0c254,
0x1e0f795b, 0xaeb28890, 0xca16acd9, 0x1e47ddd8, 0x8c8c4829, 0xd27dc747, 0xd53b1663, 0x4096b163,
0x9c8dd958, 0xcb12f860, 0x9e79305c, 0x40c1a445, 0x4a90c2bc, 0x2c3a464d, 0x2727f23c, 0x30b04b6d,
0x59024cb8, 0xa091e6ad, 0x31b04b6d, 0xc29d46a6, 0x63934fb2, 0xd9224dbe, 0x9f5910d8, 0x7f530a6b,
0x752e9c95, 0x65453548, 0xa484be46, 0xce5a1b59, 0x710e0718, 0x46a13d18, 0xdaaf5318, 0xc4a8ff53,
0x87abaa52, 0xb764cf51, 0xb2025d4a, 0x6d351e41, 0xc035c33e, 0xa432c162, 0x61ef34ae, 0xd16fddbc,
0x0870e8c1, 0x3070e8c1, 0x9c71e8c1, 0xa4992363, 0x85a1f663, 0x4184e559, 0x18d96ed8, 0x17b8dbd5,
0x60e7cd18, 0xe5ee104c, 0xab17ac62, 0x1e786e1b, 0x5d23b762, 0xf2388fae, 0x88270360, 0x9e5b3d80,
0x7da518b2, 0xb5613b45, 0x1ad41f3e, 0xd550854a, 0x8617e9a9, 0x925b229c, 0xf2e92542, 0x47af0544,
0x73b5a843, 0xb9b7a0ad, 0x03a748d0, 0x0a6ff862, 0x6694df62, 0x3bfac948, 0x8e098f4f, 0x746916c3,
0x02f38e4f, 0x40bb1243, 0x6a54d162, 0x6008414b, 0xa513794c, 0x514aa343, 0x63781747, 0xdbb6795b,
0xed065058, 0x42d24b46, 0x1518794c, 0x9b271681, 0x73e4ffad, 0x0654784f, 0x438dc945, 0x641846a6,
0x2d1b0944, 0x94b59148, 0x8d369558, 0xa5a97662, 0x8b705b42, 0xce9204ae, 0x8d584450, 0x2df61555,
0xeebff943, 0x2e75fb4d, 0x3ef8fc57, 0x9921135e, 0x8e31042e, 0xb5afad43, 0x89ecedd1, 0x9cfcc047,
0x8fcd0f4c, 0xbe49f5ad, 0x146a8d45, 0x98669ab8, 0x98d9175e, 0xd1a8e46d, 0x839a3ab8, 0x40a0016c,
0x6d27c257, 0x977fffad, 0x7baa5d5d, 0x1213be43, 0xb167e5a9, 0x640fe8ca, 0xbc9ea655, 0x0f820a4c,
0x0f097059, 0x69ac957c, 0x366d8453, 0xb1ba2844, 0x8857f081, 0x70b5be63, 0xc545454b, 0xaf36ded1,
0xb5a4b052, 0x21f062d1, 0x72ab89b2, 0x74a45318, 0x8312e6bc, 0xb916965f, 0x8aa7c858, 0xfe7effad,
};
@@ -879,12 +970,20 @@ void ThreadOpenConnections2(void* parg)
int64 nStart = GetTime();
loop
{
// Wait
// Limit outbound connections
vnThreadsRunning[1]--;
Sleep(500);
const int nMaxConnections = 8;
while (vNodes.size() >= nMaxConnections)
loop
{
int nOutbound = 0;
CRITICAL_BLOCK(cs_vNodes)
foreach(CNode* pnode, vNodes)
if (!pnode->fInbound)
nOutbound++;
int nMaxOutboundConnections = MAX_OUTBOUND_CONNECTIONS;
nMaxOutboundConnections = min(nMaxOutboundConnections, (int)GetArg("-maxconnections", 125));
if (nOutbound < nMaxOutboundConnections)
break;
Sleep(2000);
if (fShutdown)
return;
@@ -898,7 +997,7 @@ void ThreadOpenConnections2(void* parg)
// Add seed nodes if IRC isn't working
static bool fSeedUsed;
bool fTOR = (fUseProxy && addrProxy.port == htons(9050));
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR))
if (mapAddresses.empty() && (GetTime() - nStart > 60 || fTOR) && !fTestNet)
{
for (int i = 0; i < ARRAYLEN(pnSeed); i++)
{
@@ -931,7 +1030,7 @@ void ThreadOpenConnections2(void* parg)
{
foreach(PAIRTYPE(const vector<unsigned char>, CAddress)& item, mapAddresses)
{
if (setSeed.count(item.second.ip))
if (setSeed.count(item.second.ip) && item.second.nTime != 0)
{
item.second.nTime = 0;
CAddrDB().WriteAddress(item.second);
@@ -948,25 +1047,26 @@ void ThreadOpenConnections2(void* parg)
CAddress addrConnect;
int64 nBest = INT64_MIN;
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect
// Only connect to one address per a.b.?.? range.
// Do this here so we don't have to critsect vNodes inside mapAddresses critsect.
set<unsigned int> setConnected;
CRITICAL_BLOCK(cs_vNodes)
foreach(CNode* pnode, vNodes)
setConnected.insert(pnode->addr.ip);
setConnected.insert(pnode->addr.ip & 0x0000ffff);
CRITICAL_BLOCK(cs_mapAddresses)
{
foreach(const PAIRTYPE(vector<unsigned char>, CAddress)& item, mapAddresses)
{
const CAddress& addr = item.second;
if (!addr.IsIPv4() || !addr.IsValid() || setConnected.count(addr.ip))
if (!addr.IsIPv4() || !addr.IsValid() || setConnected.count(addr.ip & 0x0000ffff))
continue;
int64 nSinceLastSeen = GetAdjustedTime() - addr.nTime;
int64 nSinceLastTry = GetAdjustedTime() - addr.nLastTry;
// Randomize the order in a deterministic way, putting the standard port first
int64 nRandomizer = (uint64)(nStart * 4951 + addr.nLastTry * 9567851 + addr.ip * 7789) % (2 * 60 * 60);
if (addr.port != DEFAULT_PORT)
if (addr.port != GetDefaultPort())
nRandomizer += 2 * 60 * 60;
// Last seen Base retry frequency
@@ -1033,25 +1133,6 @@ bool OpenNetworkConnection(const CAddress& addrConnect)
return false;
pnode->fNetworkNode = true;
if (addrLocalHost.IsRoutable() && !fUseProxy)
{
// Advertise our address
vector<CAddress> vAddr;
vAddr.push_back(addrLocalHost);
pnode->PushMessage("addr", vAddr);
}
// Get as many addresses as we can
pnode->PushMessage("getaddr");
pnode->fGetAddr = true; // don't relay the results of the getaddr
////// should the one on the receiving end do this too?
// Subscribe our local subscription list
const unsigned int nHops = 0;
for (unsigned int nChannel = 0; nChannel < pnodeLocalHost->vfSubscribe.size(); nChannel++)
if (pnodeLocalHost->vfSubscribe[nChannel])
pnode->PushMessage("subscribe", nChannel, nHops);
return true;
}
@@ -1120,9 +1201,13 @@ void ThreadMessageHandler2(void* parg)
pnode->Release();
}
// Wait and allow messages to bunch up
// Wait and allow messages to bunch up.
// Reduce vnThreadsRunning so StopNode has permission to exit while
// we're sleeping, but we must always check fShutdown after doing this.
vnThreadsRunning[2]--;
Sleep(100);
if (fRequestShutdown)
Shutdown(NULL);
vnThreadsRunning[2]++;
if (fShutdown)
return;
@@ -1141,6 +1226,7 @@ bool BindListenPort(string& strError)
{
strError = "";
int nOne = 1;
addrLocalHost.port = GetDefaultPort();
#ifdef __WXMSW__
// Initialize Windows Sockets
@@ -1163,7 +1249,7 @@ bool BindListenPort(string& strError)
return false;
}
#if defined(__BSD__) || defined(__WXMAC_OSX__)
#ifdef BSD
// Different way of disabling SIGPIPE on BSD
setsockopt(hListenSocket, SOL_SOCKET, SO_NOSIGPIPE, (void*)&nOne, sizeof(int));
#endif
@@ -1192,12 +1278,12 @@ bool BindListenPort(string& strError)
memset(&sockaddr, 0, sizeof(sockaddr));
sockaddr.sin_family = AF_INET;
sockaddr.sin_addr.s_addr = INADDR_ANY; // bind to all IPs on this computer
sockaddr.sin_port = DEFAULT_PORT;
sockaddr.sin_port = GetDefaultPort();
if (::bind(hListenSocket, (struct sockaddr*)&sockaddr, sizeof(sockaddr)) == SOCKET_ERROR)
{
int nErr = WSAGetLastError();
if (nErr == WSAEADDRINUSE)
strError = strprintf("Unable to bind to port %d on this computer. Bitcoin is probably already running.", ntohs(sockaddr.sin_port));
strError = strprintf(_("Unable to bind to port %d on this computer. Bitcoin is probably already running."), ntohs(sockaddr.sin_port));
else
strError = strprintf("Error: Unable to bind to port %d on this computer (bind returned error %d)", ntohs(sockaddr.sin_port), nErr);
printf("%s\n", strError.c_str());
@@ -1234,7 +1320,7 @@ void StartNode(void* parg)
printf("host ip %d: %s\n", i, CAddress(*(unsigned int*)phostent->h_addr_list[i]).ToStringIP().c_str());
for (int i = 0; phostent->h_addr_list[i] != NULL; i++)
{
CAddress addr(*(unsigned int*)phostent->h_addr_list[i], DEFAULT_PORT, nLocalServices);
CAddress addr(*(unsigned int*)phostent->h_addr_list[i], GetDefaultPort(), nLocalServices);
if (addr.IsValid() && addr.GetByte(3) != 127)
{
addrLocalHost = addr;
@@ -1262,7 +1348,7 @@ void StartNode(void* parg)
printf("ipv4 %s: %s\n", ifa->ifa_name, pszIP);
// Take the first IP that isn't loopback 127.x.x.x
CAddress addr(*(unsigned int*)&s4->sin_addr, DEFAULT_PORT, nLocalServices);
CAddress addr(*(unsigned int*)&s4->sin_addr, GetDefaultPort(), nLocalServices);
if (addr.IsValid() && addr.GetByte(3) != 127)
{
addrLocalHost = addr;
@@ -1281,8 +1367,7 @@ void StartNode(void* parg)
#endif
printf("addrLocalHost = %s\n", addrLocalHost.ToString().c_str());
// Get our external IP address for incoming connections
if (fUseProxy)
if (fUseProxy || mapArgs.count("-connect") || fNoListen)
{
// Proxies can't take incoming connections
addrLocalHost.ip = CAddress("0.0.0.0").ip;
@@ -1290,15 +1375,7 @@ void StartNode(void* parg)
}
else
{
if (addrIncoming.IsValid())
addrLocalHost.ip = addrIncoming.ip;
if (GetMyExternalIP(addrLocalHost.ip))
{
addrIncoming = addrLocalHost;
CWalletDB().WriteSetting("addrIncoming", addrIncoming);
printf("addrLocalHost = %s\n", addrLocalHost.ToString().c_str());
}
CreateThread(ThreadGetMyExternalIP, NULL);
}
//
@@ -1322,57 +1399,6 @@ void StartNode(void* parg)
// Generate coins in the background
GenerateBitcoins(fGenerateBitcoins);
//
// Thread monitoring
// Not really needed anymore, the cause of the hanging was fixed
//
loop
{
Sleep(1000);
if (fShutdown)
return;
if (GetTime() - nThreadSocketHandlerHeartbeat > 15 * 60)
{
// First see if closing sockets will free it
printf("*** ThreadSocketHandler is stopped ***\n");
CRITICAL_BLOCK(cs_vNodes)
{
foreach(CNode* pnode, vNodes)
{
bool fGot = false;
TRY_CRITICAL_BLOCK(pnode->cs_vRecv)
TRY_CRITICAL_BLOCK(pnode->cs_vSend)
fGot = true;
if (!fGot)
{
printf("*** closing socket\n");
pnode->CloseSocketDisconnect();
}
}
}
Sleep(10000);
if (fShutdown)
return;
if (GetTime() - nThreadSocketHandlerHeartbeat < 60)
continue;
// Hopefully it never comes to this.
// We know it'll always be hung in the recv or send call.
// cs_vRecv or cs_vSend may be left permanently unreleased,
// but we always only use TRY_CRITICAL_SECTION on them.
printf("*** Restarting ThreadSocketHandler ***\n");
TerminateThread(hThreadSocketHandler, 0);
#ifdef __WXMSW__
CloseHandle(hThreadSocketHandler);
#endif
vnThreadsRunning[0] = 0;
// Restart
hThreadSocketHandler = CreateThread(ThreadSocketHandler, NULL, true);
nThreadSocketHandlerHeartbeat = GetTime();
}
}
}
bool StopNode()

47
net.h
View File

@@ -12,7 +12,7 @@ extern int nBestHeight;
static const unsigned short DEFAULT_PORT = 0x8d20; // htons(8333)
inline unsigned short GetDefaultPort() { return fTestNet ? htons(18333) : htons(8333); }
static const unsigned int PUBLISH_HOPS = 5;
enum
{
@@ -24,7 +24,7 @@ enum
bool ConnectSocket(const CAddress& addrConnect, SOCKET& hSocketRet);
bool GetMyExternalIP(unsigned int& ipRet);
bool AddAddress(CAddress addr);
bool AddAddress(CAddress addr, int64 nTimePenalty=0);
void AddressCurrentlyConnected(const CAddress& addr);
CNode* FindNode(unsigned int ip);
CNode* ConnectNode(CAddress addrConnect, int64 nTimeout=0);
@@ -48,10 +48,7 @@ bool StopNode();
// (4) size
// (4) checksum
// The message start string is designed to be unlikely to occur in normal data.
// The characters are rarely used upper ascii, not valid as UTF-8, and produce
// a large 4-byte int at any alignment.
static const char pchMessageStart[4] = { 0xf9, 0xbe, 0xb4, 0xd9 };
extern char pchMessageStart[4];
class CMessageHeader
{
@@ -117,9 +114,9 @@ public:
}
// Message size
if (nMessageSize > 0x10000000)
if (nMessageSize > MAX_SIZE)
{
printf("CMessageHeader::IsValid() : nMessageSize too large %u\n", nMessageSize);
printf("CMessageHeader::IsValid() : (%s, %u bytes) nMessageSize > MAX_SIZE\n", GetCommand().c_str(), nMessageSize);
return false;
}
@@ -142,7 +139,7 @@ public:
unsigned int ip;
unsigned short port;
// disk only
// disk and network only
unsigned int nTime;
// memory only
@@ -153,11 +150,11 @@ public:
Init();
}
CAddress(unsigned int ipIn, unsigned short portIn=DEFAULT_PORT, uint64 nServicesIn=NODE_NETWORK)
CAddress(unsigned int ipIn, unsigned short portIn=0, uint64 nServicesIn=NODE_NETWORK)
{
Init();
ip = ipIn;
port = portIn;
port = (portIn == 0 ? GetDefaultPort() : portIn);
nServices = nServicesIn;
}
@@ -188,15 +185,15 @@ public:
nServices = NODE_NETWORK;
memcpy(pchReserved, pchIPv4, sizeof(pchReserved));
ip = INADDR_NONE;
port = DEFAULT_PORT;
nTime = GetAdjustedTime();
port = GetDefaultPort();
nTime = 100000000;
nLastTry = 0;
}
bool SetAddress(const char* pszIn)
{
ip = INADDR_NONE;
port = DEFAULT_PORT;
port = GetDefaultPort();
char psz[100];
strlcpy(psz, pszIn, sizeof(psz));
unsigned int a=0, b=0, c=0, d=0, e=0;
@@ -221,11 +218,12 @@ public:
IMPLEMENT_SERIALIZE
(
if (fRead)
const_cast<CAddress*>(this)->Init();
if (nType & SER_DISK)
{
READWRITE(nVersion);
if ((nType & SER_DISK) || (nVersion >= 31402 && !(nType & SER_GETHASH)))
READWRITE(nTime);
}
READWRITE(nServices);
READWRITE(FLATDATA(pchReserved)); // for IPv6
READWRITE(ip);
@@ -418,13 +416,13 @@ public:
const char* GetCommand() const
{
if (!IsKnownType())
throw std::out_of_range(strprintf("CInv::GetCommand() : type=% unknown type", type));
throw std::out_of_range(strprintf("CInv::GetCommand() : type=%d unknown type", type));
return ppszTypeName[type];
}
string ToString() const
{
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,16).c_str());
return strprintf("%s %s", GetCommand(), hash.ToString().substr(0,20).c_str());
}
void print() const
@@ -466,7 +464,6 @@ extern CNode* pnodeLocalHost;
extern uint64 nLocalHostNonce;
extern array<int, 10> vnThreadsRunning;
extern SOCKET hListenSocket;
extern int64 nThreadSocketHandlerHeartbeat;
extern vector<CNode*> vNodes;
extern CCriticalSection cs_vNodes;
@@ -504,6 +501,7 @@ public:
unsigned int nMessageStart;
CAddress addr;
int nVersion;
string strSubVer;
bool fClient;
bool fInbound;
bool fNetworkNode;
@@ -520,10 +518,11 @@ public:
uint256 hashLastGetBlocksEnd;
int nStartingHeight;
// flood
// flood relay
vector<CAddress> vAddrToSend;
set<CAddress> setAddrKnown;
bool fGetAddr;
set<uint256> setKnown;
// inventory based relay
set<CInv> setInventoryKnown;
@@ -557,6 +556,7 @@ public:
nMessageStart = -1;
addr = addrIn;
nVersion = 0;
strSubVer = "";
fClient = false; // set by version message
fInbound = fInboundIn;
fNetworkNode = false;
@@ -733,13 +733,6 @@ public:
AbortMessage();
}
const char* GetMessageCommand() const
{
if (nHeaderStart == -1)
return "";
return &vSend[nHeaderStart] + offsetof(CMessageHeader, pchCommand);
}

34
noui.h
View File

@@ -3,7 +3,35 @@
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
inline int MyMessageBox(const string& message, const string& caption="Message", int style=4, void* parent=NULL, int x=-1, int y=-1)
typedef void wxWindow;
#define wxYES 0x00000002
#define wxOK 0x00000004
#define wxNO 0x00000008
#define wxYES_NO (wxYES|wxNO)
#define wxCANCEL 0x00000010
#define wxAPPLY 0x00000020
#define wxCLOSE 0x00000040
#define wxOK_DEFAULT 0x00000000
#define wxYES_DEFAULT 0x00000000
#define wxNO_DEFAULT 0x00000080
#define wxCANCEL_DEFAULT 0x80000000
#define wxICON_EXCLAMATION 0x00000100
#define wxICON_HAND 0x00000200
#define wxICON_WARNING wxICON_EXCLAMATION
#define wxICON_ERROR wxICON_HAND
#define wxICON_QUESTION 0x00000400
#define wxICON_INFORMATION 0x00000800
#define wxICON_STOP wxICON_HAND
#define wxICON_ASTERISK wxICON_INFORMATION
#define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800)
#define wxFORWARD 0x00001000
#define wxBACKWARD 0x00002000
#define wxRESET 0x00004000
#define wxHELP 0x00008000
#define wxMORE 0x00010000
#define wxSETUP 0x00020000
inline int MyMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
printf("%s: %s\n", caption.c_str(), message.c_str());
fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str());
@@ -11,12 +39,12 @@ inline int MyMessageBox(const string& message, const string& caption="Message",
}
#define wxMessageBox MyMessageBox
inline int ThreadSafeMessageBox(const string& message, const string& caption, int style, void* parent, int x, int y)
inline int ThreadSafeMessageBox(const string& message, const string& caption, int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1)
{
return MyMessageBox(message, caption, style, parent, x, y);
}
inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, void* parent)
inline bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
{
return true;
}

1396
rpc.cpp

File diff suppressed because it is too large Load Diff

View File

@@ -16,12 +16,30 @@ static const CBigNum bnZero(0);
static const CBigNum bnOne(1);
static const CBigNum bnFalse(0);
static const CBigNum bnTrue(1);
static const size_t nMaxNumSize = 258;
static const size_t nMaxNumSize = 4;
CBigNum CastToBigNum(const valtype& vch)
{
if (vch.size() > nMaxNumSize)
throw runtime_error("CastToBigNum() : overflow");
// Get rid of extra leading zeros
return CBigNum(CBigNum(vch).getvch());
}
bool CastToBool(const valtype& vch)
{
return (CBigNum(vch) != bnZero);
for (int i = 0; i < vch.size(); i++)
{
if (vch[i] != 0)
{
// Can be negative zero
if (i == vch.size()-1 && vch[i] == 0x80)
return false;
return true;
}
}
return false;
}
void MakeSameSize(valtype& vch1, valtype& vch2)
@@ -41,6 +59,13 @@ void MakeSameSize(valtype& vch1, valtype& vch2)
//
#define stacktop(i) (stack.at(stack.size()+(i)))
#define altstacktop(i) (altstack.at(altstack.size()+(i)))
static inline void popstack(vector<valtype>& stack)
{
if (stack.empty())
throw runtime_error("popstack() : stack empty");
stack.pop_back();
}
bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, const CTransaction& txTo, unsigned int nIn, int nHashType)
{
@@ -48,6 +73,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
CScript::const_iterator pc = script.begin();
CScript::const_iterator pend = script.end();
CScript::const_iterator pbegincodehash = script.begin();
opcodetype opcode;
valtype vchPushValue;
vector<bool> vfExec;
vector<valtype> altstack;
if (script.size() > 10000)
@@ -64,16 +91,31 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
//
// Read instruction
//
opcodetype opcode;
valtype vchPushValue;
if (!script.GetOp(pc, opcode, vchPushValue))
return false;
if (vchPushValue.size() > 5000)
if (vchPushValue.size() > 520)
return false;
if (opcode > OP_16 && nOpCount++ > 200)
if (opcode > OP_16 && ++nOpCount > 201)
return false;
if (fExec && opcode <= OP_PUSHDATA4)
if (opcode == OP_CAT ||
opcode == OP_SUBSTR ||
opcode == OP_LEFT ||
opcode == OP_RIGHT ||
opcode == OP_INVERT ||
opcode == OP_AND ||
opcode == OP_OR ||
opcode == OP_XOR ||
opcode == OP_2MUL ||
opcode == OP_2DIV ||
opcode == OP_MUL ||
opcode == OP_DIV ||
opcode == OP_MOD ||
opcode == OP_LSHIFT ||
opcode == OP_RSHIFT)
return false;
if (fExec && 0 <= opcode && opcode <= OP_PUSHDATA4)
stack.push_back(vchPushValue);
else if (fExec || (OP_IF <= opcode && opcode <= OP_ENDIF))
switch (opcode)
@@ -114,14 +156,6 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_NOP6: case OP_NOP7: case OP_NOP8: case OP_NOP9: case OP_NOP10:
break;
case OP_VER:
case OP_VERIF:
case OP_VERNOTIF:
{
return false;
}
break;
case OP_IF:
case OP_NOTIF:
{
@@ -135,7 +169,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
fValue = CastToBool(vch);
if (opcode == OP_NOTIF)
fValue = !fValue;
stack.pop_back();
popstack(stack);
}
vfExec.push_back(fValue);
}
@@ -165,7 +199,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
return false;
bool fValue = CastToBool(stacktop(-1));
if (fValue)
stack.pop_back();
popstack(stack);
else
return false;
}
@@ -186,7 +220,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (stack.size() < 1)
return false;
altstack.push_back(stacktop(-1));
stack.pop_back();
popstack(stack);
}
break;
@@ -195,15 +229,17 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (altstack.size() < 1)
return false;
stack.push_back(altstacktop(-1));
altstack.pop_back();
popstack(altstack);
}
break;
case OP_2DROP:
{
// (x1 x2 -- )
stack.pop_back();
stack.pop_back();
if (stack.size() < 2)
return false;
popstack(stack);
popstack(stack);
}
break;
@@ -292,7 +328,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// (x -- )
if (stack.size() < 1)
return false;
stack.pop_back();
popstack(stack);
}
break;
@@ -332,8 +368,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// (xn ... x2 x1 x0 n - ... x2 x1 x0 xn)
if (stack.size() < 2)
return false;
int n = CBigNum(stacktop(-1)).getint();
stack.pop_back();
int n = CastToBigNum(stacktop(-1)).getint();
popstack(stack);
if (n < 0 || n >= stack.size())
return false;
valtype vch = stacktop(-n-1);
@@ -386,8 +422,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
valtype& vch1 = stacktop(-2);
valtype& vch2 = stacktop(-1);
vch1.insert(vch1.end(), vch2.begin(), vch2.end());
stack.pop_back();
if (stacktop(-1).size() > 5000)
popstack(stack);
if (stacktop(-1).size() > 520)
return false;
}
break;
@@ -398,8 +434,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (stack.size() < 3)
return false;
valtype& vch = stacktop(-3);
int nBegin = CBigNum(stacktop(-2)).getint();
int nEnd = nBegin + CBigNum(stacktop(-1)).getint();
int nBegin = CastToBigNum(stacktop(-2)).getint();
int nEnd = nBegin + CastToBigNum(stacktop(-1)).getint();
if (nBegin < 0 || nEnd < nBegin)
return false;
if (nBegin > vch.size())
@@ -408,8 +444,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
nEnd = vch.size();
vch.erase(vch.begin() + nEnd, vch.end());
vch.erase(vch.begin(), vch.begin() + nBegin);
stack.pop_back();
stack.pop_back();
popstack(stack);
popstack(stack);
}
break;
@@ -420,7 +456,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (stack.size() < 2)
return false;
valtype& vch = stacktop(-2);
int nSize = CBigNum(stacktop(-1)).getint();
int nSize = CastToBigNum(stacktop(-1)).getint();
if (nSize < 0)
return false;
if (nSize > vch.size())
@@ -429,7 +465,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
vch.erase(vch.begin() + nSize, vch.end());
else
vch.erase(vch.begin(), vch.end() - nSize);
stack.pop_back();
popstack(stack);
}
break;
@@ -483,7 +519,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
for (int i = 0; i < vch1.size(); i++)
vch1[i] ^= vch2[i];
}
stack.pop_back();
popstack(stack);
}
break;
@@ -502,13 +538,13 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// zero bytes after it (numerically, 0x01 == 0x0001 == 0x000001)
//if (opcode == OP_NOTEQUAL)
// fEqual = !fEqual;
stack.pop_back();
stack.pop_back();
popstack(stack);
popstack(stack);
stack.push_back(fEqual ? vchTrue : vchFalse);
if (opcode == OP_EQUALVERIFY)
{
if (fEqual)
stack.pop_back();
popstack(stack);
else
return false;
}
@@ -531,9 +567,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// (in -- out)
if (stack.size() < 1)
return false;
if (stacktop(-1).size() > nMaxNumSize)
return false;
CBigNum bn(stacktop(-1));
CBigNum bn = CastToBigNum(stacktop(-1));
switch (opcode)
{
case OP_1ADD: bn += bnOne; break;
@@ -545,7 +579,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_NOT: bn = (bn == bnZero); break;
case OP_0NOTEQUAL: bn = (bn != bnZero); break;
}
stack.pop_back();
popstack(stack);
stack.push_back(bn.getvch());
}
break;
@@ -572,11 +606,8 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// (x1 x2 -- out)
if (stack.size() < 2)
return false;
if (stacktop(-2).size() > nMaxNumSize ||
stacktop(-1).size() > nMaxNumSize)
return false;
CBigNum bn1(stacktop(-2));
CBigNum bn2(stacktop(-1));
CBigNum bn1 = CastToBigNum(stacktop(-2));
CBigNum bn2 = CastToBigNum(stacktop(-1));
CBigNum bn;
switch (opcode)
{
@@ -627,14 +658,14 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
case OP_MIN: bn = (bn1 < bn2 ? bn1 : bn2); break;
case OP_MAX: bn = (bn1 > bn2 ? bn1 : bn2); break;
}
stack.pop_back();
stack.pop_back();
popstack(stack);
popstack(stack);
stack.push_back(bn.getvch());
if (opcode == OP_NUMEQUALVERIFY)
{
if (CastToBool(stacktop(-1)))
stack.pop_back();
popstack(stack);
else
return false;
}
@@ -646,17 +677,13 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
// (x min max -- out)
if (stack.size() < 3)
return false;
if (stacktop(-3).size() > nMaxNumSize ||
stacktop(-2).size() > nMaxNumSize ||
stacktop(-1).size() > nMaxNumSize)
return false;
CBigNum bn1(stacktop(-3));
CBigNum bn2(stacktop(-2));
CBigNum bn3(stacktop(-1));
CBigNum bn1 = CastToBigNum(stacktop(-3));
CBigNum bn2 = CastToBigNum(stacktop(-2));
CBigNum bn3 = CastToBigNum(stacktop(-1));
bool fValue = (bn2 <= bn1 && bn1 < bn3);
stack.pop_back();
stack.pop_back();
stack.pop_back();
popstack(stack);
popstack(stack);
popstack(stack);
stack.push_back(fValue ? vchTrue : vchFalse);
}
break;
@@ -692,7 +719,7 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
uint256 hash = Hash(vch.begin(), vch.end());
memcpy(&vchHash[0], &hash, sizeof(hash));
}
stack.pop_back();
popstack(stack);
stack.push_back(vchHash);
}
break;
@@ -726,13 +753,13 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
bool fSuccess = CheckSig(vchSig, vchPubKey, scriptCode, txTo, nIn, nHashType);
stack.pop_back();
stack.pop_back();
popstack(stack);
popstack(stack);
stack.push_back(fSuccess ? vchTrue : vchFalse);
if (opcode == OP_CHECKSIGVERIFY)
{
if (fSuccess)
stack.pop_back();
popstack(stack);
else
return false;
}
@@ -748,15 +775,18 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
if (stack.size() < i)
return false;
int nKeysCount = CBigNum(stacktop(-i)).getint();
if (nKeysCount < 0)
int nKeysCount = CastToBigNum(stacktop(-i)).getint();
if (nKeysCount < 0 || nKeysCount > 20)
return false;
nOpCount += nKeysCount;
if (nOpCount > 201)
return false;
int ikey = ++i;
i += nKeysCount;
if (stack.size() < i)
return false;
int nSigsCount = CBigNum(stacktop(-i)).getint();
int nSigsCount = CastToBigNum(stacktop(-i)).getint();
if (nSigsCount < 0 || nSigsCount > nKeysCount)
return false;
int isig = ++i;
@@ -796,13 +826,13 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
}
while (i-- > 0)
stack.pop_back();
popstack(stack);
stack.push_back(fSuccess ? vchTrue : vchFalse);
if (opcode == OP_CHECKMULTISIGVERIFY)
{
if (fSuccess)
stack.pop_back();
popstack(stack);
else
return false;
}
@@ -830,8 +860,6 @@ bool EvalScript(vector<vector<unsigned char> >& stack, const CScript& script, co
return true;
}
#undef top
@@ -919,10 +947,7 @@ bool CheckSig(vector<unsigned char> vchSig, vector<unsigned char> vchPubKey, CSc
return false;
vchSig.pop_back();
if (key.Verify(SignatureHash(scriptCode, txTo, nIn, nHashType), vchSig))
return true;
return false;
return key.Verify(SignatureHash(scriptCode, txTo, nIn, nHashType), vchSig);
}
@@ -960,21 +985,19 @@ bool Solver(const CScript& scriptPubKey, vector<pair<opcodetype, valtype> >& vSo
CScript::const_iterator pc2 = script2.begin();
loop
{
bool f1 = script1.GetOp(pc1, opcode1, vch1);
bool f2 = script2.GetOp(pc2, opcode2, vch2);
if (!f1 && !f2)
if (pc1 == script1.end() && pc2 == script2.end())
{
// Success
// Found a match
reverse(vSolutionRet.begin(), vSolutionRet.end());
return true;
}
else if (f1 != f2)
{
if (!script1.GetOp(pc1, opcode1, vch1))
break;
}
else if (opcode2 == OP_PUBKEY)
if (!script2.GetOp(pc2, opcode2, vch2))
break;
if (opcode2 == OP_PUBKEY)
{
if (vch1.size() <= sizeof(uint256))
if (vch1.size() < 33 || vch1.size() > 120)
break;
vSolutionRet.push_back(make_pair(opcode2, vch1));
}
@@ -984,7 +1007,7 @@ bool Solver(const CScript& scriptPubKey, vector<pair<opcodetype, valtype> >& vSo
break;
vSolutionRet.push_back(make_pair(opcode2, vch1));
}
else if (opcode1 != opcode2)
else if (opcode1 != opcode2 || vch1 != vch2)
{
break;
}
@@ -1042,6 +1065,10 @@ bool Solver(const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& s
scriptSigRet << vchSig << vchPubKey;
}
}
else
{
return false;
}
}
}
@@ -1049,6 +1076,13 @@ bool Solver(const CScript& scriptPubKey, uint256 hash, int nHashType, CScript& s
}
bool IsStandard(const CScript& scriptPubKey)
{
vector<pair<opcodetype, valtype> > vSolution;
return Solver(scriptPubKey, vSolution);
}
bool IsMine(const CScript& scriptPubKey)
{
CScript scriptSig;

196
script.h
View File

@@ -150,18 +150,11 @@ enum opcodetype
// multi-byte opcodes
OP_SINGLEBYTE_END = 0xF0,
OP_DOUBLEBYTE_BEGIN = 0xF000,
// template matching params
OP_PUBKEY,
OP_PUBKEYHASH,
OP_PUBKEYHASH = 0xfd,
OP_PUBKEY = 0xfe,
OP_INVALIDOPCODE = 0xFFFF,
OP_INVALIDOPCODE = 0xff,
};
@@ -304,16 +297,13 @@ inline const char* GetOpName(opcodetype opcode)
// multi-byte opcodes
case OP_SINGLEBYTE_END : return "OP_SINGLEBYTE_END";
case OP_DOUBLEBYTE_BEGIN : return "OP_DOUBLEBYTE_BEGIN";
case OP_PUBKEY : return "OP_PUBKEY";
// template matching params
case OP_PUBKEYHASH : return "OP_PUBKEYHASH";
case OP_PUBKEY : return "OP_PUBKEY";
case OP_INVALIDOPCODE : return "OP_INVALIDOPCODE";
default:
return "UNKNOWN_OPCODE";
return "OP_UNKNOWN";
}
};
@@ -325,8 +315,7 @@ inline string ValueString(const vector<unsigned char>& vch)
if (vch.size() <= 4)
return strprintf("%d", CBigNum(vch).getint());
else
return HexNumStr(vch.begin(), vch.end());
//return string("(") + HexStr(vch.begin(), vch.end()) + string(")");
return HexStr(vch);
}
inline string StackString(const vector<vector<unsigned char> >& vStack)
@@ -363,12 +352,12 @@ protected:
CBigNum bn(n);
*this << bn.getvch();
}
return (*this);
return *this;
}
CScript& push_uint64(uint64 n)
{
if (n == -1 || (n >= 1 && n <= 16))
if (n >= 1 && n <= 16)
{
push_back(n + (OP_1 - 1));
}
@@ -377,7 +366,7 @@ protected:
CBigNum bn(n);
*this << bn.getvch();
}
return (*this);
return *this;
}
public:
@@ -398,7 +387,7 @@ public:
{
CScript ret = a;
ret += b;
return (ret);
return ret;
}
@@ -419,50 +408,43 @@ public:
explicit CScript(const vector<unsigned char>& b) { operator<<(b); }
CScript& operator<<(char b) { return (push_int64(b)); }
CScript& operator<<(short b) { return (push_int64(b)); }
CScript& operator<<(int b) { return (push_int64(b)); }
CScript& operator<<(long b) { return (push_int64(b)); }
CScript& operator<<(int64 b) { return (push_int64(b)); }
CScript& operator<<(unsigned char b) { return (push_uint64(b)); }
CScript& operator<<(unsigned int b) { return (push_uint64(b)); }
CScript& operator<<(unsigned short b) { return (push_uint64(b)); }
CScript& operator<<(unsigned long b) { return (push_uint64(b)); }
CScript& operator<<(uint64 b) { return (push_uint64(b)); }
CScript& operator<<(char b) { return push_int64(b); }
CScript& operator<<(short b) { return push_int64(b); }
CScript& operator<<(int b) { return push_int64(b); }
CScript& operator<<(long b) { return push_int64(b); }
CScript& operator<<(int64 b) { return push_int64(b); }
CScript& operator<<(unsigned char b) { return push_uint64(b); }
CScript& operator<<(unsigned int b) { return push_uint64(b); }
CScript& operator<<(unsigned short b) { return push_uint64(b); }
CScript& operator<<(unsigned long b) { return push_uint64(b); }
CScript& operator<<(uint64 b) { return push_uint64(b); }
CScript& operator<<(opcodetype opcode)
{
if (opcode <= OP_SINGLEBYTE_END)
{
insert(end(), (unsigned char)opcode);
}
else
{
assert(opcode >= OP_DOUBLEBYTE_BEGIN);
insert(end(), (unsigned char)(opcode >> 8));
insert(end(), (unsigned char)(opcode & 0xFF));
}
return (*this);
if (opcode < 0 || opcode > 0xff)
throw runtime_error("CScript::operator<<() : invalid opcode");
insert(end(), (unsigned char)opcode);
return *this;
}
CScript& operator<<(const uint160& b)
{
insert(end(), sizeof(b));
insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b));
return (*this);
return *this;
}
CScript& operator<<(const uint256& b)
{
insert(end(), sizeof(b));
insert(end(), (unsigned char*)&b, (unsigned char*)&b + sizeof(b));
return (*this);
return *this;
}
CScript& operator<<(const CBigNum& b)
{
*this << b.getvch();
return (*this);
return *this;
}
CScript& operator<<(const vector<unsigned char>& b)
@@ -476,14 +458,20 @@ public:
insert(end(), OP_PUSHDATA1);
insert(end(), (unsigned char)b.size());
}
else
else if (b.size() <= 0xffff)
{
insert(end(), OP_PUSHDATA2);
unsigned short nSize = b.size();
insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize));
}
else
{
insert(end(), OP_PUSHDATA4);
unsigned int nSize = b.size();
insert(end(), (unsigned char*)&nSize, (unsigned char*)&nSize + sizeof(nSize));
}
insert(end(), b.begin(), b.end());
return (*this);
return *this;
}
CScript& operator<<(const CScript& b)
@@ -491,7 +479,7 @@ public:
// I'm not sure if this should push the script or concatenate scripts.
// If there's ever a use for pushing a script onto a script, delete this member fn
assert(("warning: pushing a CScript onto a CScript with << is probably not intended, use + to concatenate", false));
return (*this);
return *this;
}
@@ -499,41 +487,59 @@ public:
{
// Wrapper so it can be called with either iterator or const_iterator
const_iterator pc2 = pc;
bool fRet = GetOp(pc2, opcodeRet, vchRet);
bool fRet = GetOp2(pc2, opcodeRet, &vchRet);
pc = begin() + (pc2 - begin());
return fRet;
}
bool GetOp(iterator& pc, opcodetype& opcodeRet)
{
const_iterator pc2 = pc;
bool fRet = GetOp2(pc2, opcodeRet, NULL);
pc = begin() + (pc2 - begin());
return fRet;
}
bool GetOp(const_iterator& pc, opcodetype& opcodeRet, vector<unsigned char>& vchRet) const
{
return GetOp2(pc, opcodeRet, &vchRet);
}
bool GetOp(const_iterator& pc, opcodetype& opcodeRet) const
{
return GetOp2(pc, opcodeRet, NULL);
}
bool GetOp2(const_iterator& pc, opcodetype& opcodeRet, vector<unsigned char>* pvchRet) const
{
opcodeRet = OP_INVALIDOPCODE;
vchRet.clear();
if (pvchRet)
pvchRet->clear();
if (pc >= end())
return false;
// Read instruction
if (end() - pc < 1)
return false;
unsigned int opcode = *pc++;
if (opcode >= OP_SINGLEBYTE_END)
{
if (pc + 1 > end())
return false;
opcode <<= 8;
opcode |= *pc++;
}
// Immediate operand
if (opcode <= OP_PUSHDATA4)
{
unsigned int nSize = opcode;
if (opcode == OP_PUSHDATA1)
unsigned int nSize;
if (opcode < OP_PUSHDATA1)
{
if (pc + 1 > end())
nSize = opcode;
}
else if (opcode == OP_PUSHDATA1)
{
if (end() - pc < 1)
return false;
nSize = *pc++;
}
else if (opcode == OP_PUSHDATA2)
{
if (pc + 2 > end())
if (end() - pc < 2)
return false;
nSize = 0;
memcpy(&nSize, &pc[0], 2);
@@ -541,14 +547,15 @@ public:
}
else if (opcode == OP_PUSHDATA4)
{
if (pc + 4 > end())
if (end() - pc < 4)
return false;
memcpy(&nSize, &pc[0], 4);
pc += 4;
}
if (pc + nSize > end())
if (end() - pc < nSize)
return false;
vchRet.assign(pc, pc + nSize);
if (pvchRet)
pvchRet->assign(pc, pc + nSize);
pc += nSize;
}
@@ -559,20 +566,51 @@ public:
void FindAndDelete(const CScript& b)
{
if (b.empty())
return;
iterator pc = begin();
opcodetype opcode;
vector<unsigned char> vchPushValue;
int count = 0;
do
{
while (end() - pc >= b.size() && memcmp(&pc[0], &b[0], b.size()) == 0)
{
erase(pc, pc + b.size());
count++;
}
}
while (GetOp(pc, opcode, vchPushValue));
//printf("FindAndDeleted deleted %d items\n", count); /// debug
while (GetOp(pc, opcode));
}
int GetSigOpCount() const
{
int n = 0;
const_iterator pc = begin();
while (pc < end())
{
opcodetype opcode;
if (!GetOp(pc, opcode))
break;
if (opcode == OP_CHECKSIG || opcode == OP_CHECKSIGVERIFY)
n++;
else if (opcode == OP_CHECKMULTISIG || opcode == OP_CHECKMULTISIGVERIFY)
n += 20;
}
return n;
}
bool IsPushOnly() const
{
if (size() > 200)
return false;
const_iterator pc = begin();
while (pc < end())
{
opcodetype opcode;
if (!GetOp(pc, opcode))
return false;
if (opcode > OP_16)
return false;
}
return true;
}
@@ -623,7 +661,7 @@ public:
void PrintHex() const
{
printf("CScript(%s)\n", HexStr(begin(), end()).c_str());
printf("CScript(%s)\n", HexStr(begin(), end(), true).c_str());
}
string ToString() const
@@ -631,12 +669,17 @@ public:
string str;
opcodetype opcode;
vector<unsigned char> vch;
const_iterator it = begin();
while (GetOp(it, opcode, vch))
const_iterator pc = begin();
while (pc < end())
{
if (!str.empty())
str += " ";
if (opcode <= OP_PUSHDATA4)
if (!GetOp(pc, opcode, vch))
{
str += "[error]";
return str;
}
if (0 <= opcode && opcode <= OP_PUSHDATA4)
str += ValueString(vch);
else
str += GetOpName(opcode);
@@ -658,6 +701,7 @@ public:
uint256 SignatureHash(CScript scriptCode, const CTransaction& txTo, unsigned int nIn, int nHashType);
bool IsStandard(const CScript& scriptPubKey);
bool IsMine(const CScript& scriptPubKey);
bool ExtractPubKey(const CScript& scriptPubKey, bool fMineOnly, vector<unsigned char>& vchPubKeyRet);
bool ExtractHash160(const CScript& scriptPubKey, uint160& hash160Ret);

View File

@@ -2,9 +2,14 @@
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
#include <string>
#include <vector>
#include <map>
#include <set>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_io.hpp>
#if defined(_MSC_VER) || defined(__BORLANDC__)
typedef __int64 int64;
typedef unsigned __int64 uint64;
@@ -18,9 +23,12 @@ typedef unsigned long long uint64;
class CScript;
class CDataStream;
class CAutoFile;
static const unsigned int MAX_SIZE = 0x02000000;
static const int VERSION = 308;
static const int VERSION = 32001;
static const char* pszSubVer = "";
static const bool VERSION_IS_BETA = true;
@@ -152,7 +160,7 @@ template<typename Stream> inline void Unserialize(Stream& s, bool& a, int, int=0
//
inline unsigned int GetSizeOfCompactSize(uint64 nSize)
{
if (nSize < UCHAR_MAX-2) return sizeof(unsigned char);
if (nSize < 253) return sizeof(unsigned char);
else if (nSize <= USHRT_MAX) return sizeof(unsigned char) + sizeof(unsigned short);
else if (nSize <= UINT_MAX) return sizeof(unsigned char) + sizeof(unsigned int);
else return sizeof(unsigned char) + sizeof(uint64);
@@ -161,30 +169,31 @@ inline unsigned int GetSizeOfCompactSize(uint64 nSize)
template<typename Stream>
void WriteCompactSize(Stream& os, uint64 nSize)
{
if (nSize < UCHAR_MAX-2)
if (nSize < 253)
{
unsigned char chSize = nSize;
WRITEDATA(os, chSize);
}
else if (nSize <= USHRT_MAX)
{
unsigned char chSize = UCHAR_MAX-2;
unsigned char chSize = 253;
unsigned short xSize = nSize;
WRITEDATA(os, chSize);
WRITEDATA(os, xSize);
}
else if (nSize <= UINT_MAX)
{
unsigned char chSize = UCHAR_MAX-1;
unsigned char chSize = 254;
unsigned int xSize = nSize;
WRITEDATA(os, chSize);
WRITEDATA(os, xSize);
}
else
{
unsigned char chSize = UCHAR_MAX;
unsigned char chSize = 255;
uint64 xSize = nSize;
WRITEDATA(os, chSize);
WRITEDATA(os, nSize);
WRITEDATA(os, xSize);
}
return;
}
@@ -195,29 +204,29 @@ uint64 ReadCompactSize(Stream& is)
unsigned char chSize;
READDATA(is, chSize);
uint64 nSizeRet = 0;
if (chSize < UCHAR_MAX-2)
if (chSize < 253)
{
nSizeRet = chSize;
}
else if (chSize == UCHAR_MAX-2)
else if (chSize == 253)
{
unsigned short nSize;
READDATA(is, nSize);
nSizeRet = nSize;
unsigned short xSize;
READDATA(is, xSize);
nSizeRet = xSize;
}
else if (chSize == UCHAR_MAX-1)
else if (chSize == 254)
{
unsigned int nSize;
READDATA(is, nSize);
nSizeRet = nSize;
unsigned int xSize;
READDATA(is, xSize);
nSizeRet = xSize;
}
else
{
uint64 nSize;
READDATA(is, nSize);
nSizeRet = nSize;
uint64 xSize;
READDATA(is, xSize);
nSizeRet = xSize;
}
if (nSizeRet > (uint64)INT_MAX)
if (nSizeRet > (uint64)MAX_SIZE)
throw std::ios_base::failure("ReadCompactSize() : size too large");
return nSizeRet;
}
@@ -333,6 +342,16 @@ template<typename K, typename T> unsigned int GetSerializeSize(const std::pair<K
template<typename Stream, typename K, typename T> void Serialize(Stream& os, const std::pair<K, T>& item, int nType, int nVersion=VERSION);
template<typename Stream, typename K, typename T> void Unserialize(Stream& is, std::pair<K, T>& item, int nType, int nVersion=VERSION);
// 3 tuple
template<typename T0, typename T1, typename T2> unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2>& item, int nType, int nVersion=VERSION);
template<typename Stream, typename T0, typename T1, typename T2> void Serialize(Stream& os, const boost::tuple<T0, T1, T2>& item, int nType, int nVersion=VERSION);
template<typename Stream, typename T0, typename T1, typename T2> void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVersion=VERSION);
// 4 tuple
template<typename T0, typename T1, typename T2, typename T3> unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion=VERSION);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Serialize(Stream& os, const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion=VERSION);
template<typename Stream, typename T0, typename T1, typename T2, typename T3> void Unserialize(Stream& is, boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion=VERSION);
// map
template<typename K, typename T, typename Pred, typename A> unsigned int GetSerializeSize(const std::map<K, T, Pred, A>& m, int nType, int nVersion=VERSION);
template<typename Stream, typename K, typename T, typename Pred, typename A> void Serialize(Stream& os, const std::map<K, T, Pred, A>& m, int nType, int nVersion=VERSION);
@@ -549,6 +568,71 @@ void Unserialize(Stream& is, std::pair<K, T>& item, int nType, int nVersion)
//
// 3 tuple
//
template<typename T0, typename T1, typename T2>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
nSize += GetSerializeSize(get<0>(item), nType, nVersion);
nSize += GetSerializeSize(get<1>(item), nType, nVersion);
nSize += GetSerializeSize(get<2>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
Serialize(os, get<0>(item), nType, nVersion);
Serialize(os, get<1>(item), nType, nVersion);
Serialize(os, get<2>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2>& item, int nType, int nVersion)
{
Unserialize(is, get<0>(item), nType, nVersion);
Unserialize(is, get<1>(item), nType, nVersion);
Unserialize(is, get<2>(item), nType, nVersion);
}
//
// 4 tuple
//
template<typename T0, typename T1, typename T2, typename T3>
unsigned int GetSerializeSize(const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
unsigned int nSize = 0;
nSize += GetSerializeSize(get<0>(item), nType, nVersion);
nSize += GetSerializeSize(get<1>(item), nType, nVersion);
nSize += GetSerializeSize(get<2>(item), nType, nVersion);
nSize += GetSerializeSize(get<3>(item), nType, nVersion);
return nSize;
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Serialize(Stream& os, const boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
Serialize(os, get<0>(item), nType, nVersion);
Serialize(os, get<1>(item), nType, nVersion);
Serialize(os, get<2>(item), nType, nVersion);
Serialize(os, get<3>(item), nType, nVersion);
}
template<typename Stream, typename T0, typename T1, typename T2, typename T3>
void Unserialize(Stream& is, boost::tuple<T0, T1, T2, T3>& item, int nType, int nVersion)
{
Unserialize(is, get<0>(item), nType, nVersion);
Unserialize(is, get<1>(item), nType, nVersion);
Unserialize(is, get<2>(item), nType, nVersion);
Unserialize(is, get<3>(item), nType, nVersion);
}
//
// map
//
@@ -679,6 +763,8 @@ struct secure_allocator : public std::allocator<T>
typedef typename base::value_type value_type;
secure_allocator() throw() {}
secure_allocator(const secure_allocator& a) throw() : base(a) {}
template <typename U>
secure_allocator(const secure_allocator<U>& a) throw() : base(a) {}
~secure_allocator() throw() {}
template<typename _Other> struct rebind
{ typedef secure_allocator<_Other> other; };
@@ -720,39 +806,39 @@ public:
typedef vector_type::const_iterator const_iterator;
typedef vector_type::reverse_iterator reverse_iterator;
explicit CDataStream(int nTypeIn=0, int nVersionIn=VERSION)
explicit CDataStream(int nTypeIn=SER_NETWORK, int nVersionIn=VERSION)
{
Init(nTypeIn, nVersionIn);
}
CDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn=0, int nVersionIn=VERSION) : vch(pbegin, pend)
CDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(pbegin, pend)
{
Init(nTypeIn, nVersionIn);
}
#if !defined(_MSC_VER) || _MSC_VER >= 1300
CDataStream(const char* pbegin, const char* pend, int nTypeIn=0, int nVersionIn=VERSION) : vch(pbegin, pend)
CDataStream(const char* pbegin, const char* pend, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(pbegin, pend)
{
Init(nTypeIn, nVersionIn);
}
#endif
CDataStream(const vector_type& vchIn, int nTypeIn=0, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
CDataStream(const vector_type& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
{
Init(nTypeIn, nVersionIn);
}
CDataStream(const vector<char>& vchIn, int nTypeIn=0, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
CDataStream(const vector<char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch(vchIn.begin(), vchIn.end())
{
Init(nTypeIn, nVersionIn);
}
CDataStream(const vector<unsigned char>& vchIn, int nTypeIn=0, int nVersionIn=VERSION) : vch((char*)&vchIn.begin()[0], (char*)&vchIn.end()[0])
CDataStream(const vector<unsigned char>& vchIn, int nTypeIn=SER_NETWORK, int nVersionIn=VERSION) : vch((char*)&vchIn.begin()[0], (char*)&vchIn.end()[0])
{
Init(nTypeIn, nVersionIn);
}
void Init(int nTypeIn=0, int nVersionIn=VERSION)
void Init(int nTypeIn=SER_NETWORK, int nVersionIn=VERSION)
{
nReadPos = 0;
nType = nTypeIn;

307
setup.nsi
View File

@@ -1,156 +1,151 @@
# Auto-generated by EclipseNSIS Script Wizard
# 3.10.2009 19:00:28
Name Bitcoin
RequestExecutionLevel highest
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.3.8
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
# MUI Symbol Definitions
!define MUI_ICON "src\rc\bitcoin.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.3.8-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 0.3.8.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
InstallDirRegKey HKCU "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File bitcoin.exe
File libeay32.dll
File mingwm10.dll
File license.txt
File readme.txt
SetOutPath $INSTDIR\daemon
File /r daemon\*.*
SetOutPath $INSTDIR\locale
File /r locale\*.*
SetOutPath $INSTDIR\src
File /r src\*.*
SetOutPath $INSTDIR
WriteRegStr HKCU "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin.exe
Delete /REBOOTOK $INSTDIR\libeay32.dll
Delete /REBOOTOK $INSTDIR\mingwm10.dll
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\locale
RMDir /r /REBOOTOK $INSTDIR\src
DeleteRegValue HKCU "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
DeleteRegValue HKCU "${REGKEY}" Path
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd
Name Bitcoin
RequestExecutionLevel highest
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.3.20
!define COMPANY "Bitcoin project"
!define URL http://www.bitcoin.org/
# MUI Symbol Definitions
!define MUI_ICON "src\rc\bitcoin.ico"
!define MUI_FINISHPAGE_NOAUTOCLOSE
!define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
!define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY}
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup
!define MUI_STARTMENUPAGE_DEFAULTFOLDER Bitcoin
!define MUI_FINISHPAGE_RUN $INSTDIR\bitcoin.exe
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
# Included files
!include Sections.nsh
!include MUI2.nsh
# Variables
Var StartMenuGroup
# Installer pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuGroup
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
# Installer languages
!insertmacro MUI_LANGUAGE English
# Installer attributes
OutFile bitcoin-0.3.20-win32-setup.exe
InstallDir $PROGRAMFILES\Bitcoin
CRCCheck on
XPStyle on
ShowInstDetails show
VIProductVersion 0.3.20.0
VIAddVersionKey ProductName Bitcoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
VIAddVersionKey CompanyWebsite "${URL}"
VIAddVersionKey FileVersion "${VERSION}"
VIAddVersionKey FileDescription ""
VIAddVersionKey LegalCopyright ""
InstallDirRegKey HKCU "${REGKEY}" Path
ShowUninstDetails show
# Installer sections
Section -Main SEC0000
SetOutPath $INSTDIR
SetOverwrite on
File bitcoin.exe
File libeay32.dll
File license.txt
File readme.txt
SetOutPath $INSTDIR\daemon
File /r daemon\*.*
SetOutPath $INSTDIR\locale
File /r locale\*.*
SetOutPath $INSTDIR\src
File /r src\*.*
SetOutPath $INSTDIR
WriteRegStr HKCU "${REGKEY}\Components" Main 1
SectionEnd
Section -post SEC0001
WriteRegStr HKCU "${REGKEY}" Path $INSTDIR
SetOutPath $INSTDIR
WriteUninstaller $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
CreateDirectory $SMPROGRAMS\$StartMenuGroup
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk" $INSTDIR\bitcoin.exe
CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk" $INSTDIR\uninstall.exe
!insertmacro MUI_STARTMENU_WRITE_END
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\uninstall.exe
WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
SectionEnd
# Macro for selecting uninstaller sections
!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
Push $R0
ReadRegStr $R0 HKCU "${REGKEY}\Components" "${SECTION_NAME}"
StrCmp $R0 1 0 next${UNSECTION_ID}
!insertmacro SelectSection "${UNSECTION_ID}"
GoTo done${UNSECTION_ID}
next${UNSECTION_ID}:
!insertmacro UnselectSection "${UNSECTION_ID}"
done${UNSECTION_ID}:
Pop $R0
!macroend
# Uninstaller sections
Section /o -un.Main UNSEC0000
Delete /REBOOTOK $INSTDIR\bitcoin.exe
Delete /REBOOTOK $INSTDIR\libeay32.dll
Delete /REBOOTOK $INSTDIR\license.txt
Delete /REBOOTOK $INSTDIR\readme.txt
RMDir /r /REBOOTOK $INSTDIR\daemon
RMDir /r /REBOOTOK $INSTDIR\locale
RMDir /r /REBOOTOK $INSTDIR\src
DeleteRegValue HKCU "${REGKEY}\Components" Main
SectionEnd
Section -un.post UNSEC0001
DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall Bitcoin.lnk"
Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Bitcoin.lnk"
Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk"
Delete /REBOOTOK $INSTDIR\uninstall.exe
Delete /REBOOTOK $INSTDIR\debug.log
Delete /REBOOTOK $INSTDIR\db.log
DeleteRegValue HKCU "${REGKEY}" StartMenuGroup
DeleteRegValue HKCU "${REGKEY}" Path
DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components"
DeleteRegKey /IfEmpty HKCU "${REGKEY}"
RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
RmDir /REBOOTOK $INSTDIR
Push $R0
StrCpy $R0 $StartMenuGroup 1
StrCmp $R0 ">" no_smgroup
no_smgroup:
Pop $R0
SectionEnd
# Installer functions
Function .onInit
InitPluginsDir
FunctionEnd
# Uninstaller functions
Function un.onInit
ReadRegStr $INSTDIR HKCU "${REGKEY}" Path
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuGroup
!insertmacro SELECT_UNSECTION Main ${UNSEC0000}
FunctionEnd

475
sha256.cpp Normal file
View File

@@ -0,0 +1,475 @@
// Copyright (c) 2010 Nils Schneider
// Distributed under the MIT/X11 software license, see the accompanying
// file license.txt or http://www.opensource.org/licenses/mit-license.php.
// 4-way 128-bit SSE2 SHA-256
#ifdef FOURWAYSSE2
#include <string.h>
#include <assert.h>
#include <xmmintrin.h>
#include <stdint.h>
#include <stdio.h>
#define NPAR 32
extern void DoubleBlockSHA256(const void* pin, void* pout, const void* pinit, unsigned int hash[8][NPAR], const void* init2);
static const unsigned int sha256_consts[] = {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, /* 0 */
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, /* 8 */
0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, /* 16 */
0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, /* 24 */
0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, /* 32 */
0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, /* 40 */
0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, /* 48 */
0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, /* 56 */
0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
};
static inline __m128i Ch(const __m128i b, const __m128i c, const __m128i d) {
return (b & c) ^ (~b & d);
}
static inline __m128i Maj(const __m128i b, const __m128i c, const __m128i d) {
return (b & c) ^ (b & d) ^ (c & d);
}
static inline __m128i ROTR(__m128i x, const int n) {
return _mm_srli_epi32(x, n) | _mm_slli_epi32(x, 32 - n);
}
static inline __m128i SHR(__m128i x, const int n) {
return _mm_srli_epi32(x, n);
}
/* SHA256 Functions */
#define BIGSIGMA0_256(x) (ROTR((x), 2) ^ ROTR((x), 13) ^ ROTR((x), 22))
#define BIGSIGMA1_256(x) (ROTR((x), 6) ^ ROTR((x), 11) ^ ROTR((x), 25))
#define SIGMA0_256(x) (ROTR((x), 7) ^ ROTR((x), 18) ^ SHR((x), 3))
#define SIGMA1_256(x) (ROTR((x), 17) ^ ROTR((x), 19) ^ SHR((x), 10))
static inline unsigned int store32(const __m128i x, int i) {
union { unsigned int ret[4]; __m128i x; } box;
box.x = x;
return box.ret[i];
}
static inline void store_epi32(const __m128i x, unsigned int *x0, unsigned int *x1, unsigned int *x2, unsigned int *x3) {
union { unsigned int ret[4]; __m128i x; } box;
box.x = x;
*x0 = box.ret[3]; *x1 = box.ret[2]; *x2 = box.ret[1]; *x3 = box.ret[0];
}
#define add4(x0, x1, x2, x3) _mm_add_epi32(_mm_add_epi32(_mm_add_epi32(x0, x1), x2), x3)
#define add5(x0, x1, x2, x3, x4) _mm_add_epi32(add4(x0, x1, x2, x3), x4)
#define SHA256ROUND(a, b, c, d, e, f, g, h, i, w) \
T1 = add5(h, BIGSIGMA1_256(e), Ch(e, f, g), _mm_set1_epi32(sha256_consts[i]), w); \
d = _mm_add_epi32(d, T1); \
h = _mm_add_epi32(T1, _mm_add_epi32(BIGSIGMA0_256(a), Maj(a, b, c)));
static inline void dumpreg(__m128i x, char *msg) {
union { unsigned int ret[4]; __m128i x; } box;
box.x = x ;
printf("%s %08x %08x %08x %08x\n", msg, box.ret[0], box.ret[1], box.ret[2], box.ret[3]);
}
#if 1
#define dumpstate(i) printf("%s: %08x %08x %08x %08x %08x %08x %08x %08x %08x\n", \
__func__, store32(w0, i), store32(a, i), store32(b, i), store32(c, i), store32(d, i), store32(e, i), store32(f, i), store32(g, i), store32(h, i));
#else
#define dumpstate()
#endif
// Align by increasing pointer, must have extra space at end of buffer
template <size_t nBytes, typename T>
T* alignup(T* p)
{
union
{
T* ptr;
size_t n;
} u;
u.ptr = p;
u.n = (u.n + (nBytes-1)) & ~(nBytes-1);
return u.ptr;
}
static const unsigned int pSHA256InitState[8] =
{0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19};
unsigned int ScanHash_4WaySSE2(char* pmidstate, char* pdata, char* phash1, char* phash, unsigned int& nHashesDone)
{
unsigned int& nNonce = *(unsigned int*)(pdata + 12);
for (;;)
{
nNonce += NPAR;
unsigned int thashbuf[9][NPAR];
unsigned int (&thash)[9][NPAR] = *alignup<16>(&thashbuf);
DoubleBlockSHA256(pdata, phash1, pmidstate, thash, pSHA256InitState);
for (int j = 0; j < NPAR; j++)
{
if (thash[7][j] == 0)
{
for (int i = 0; i < 32/4; i++)
((unsigned int*)phash)[i] = thash[i][j];
return nNonce + j;
}
}
if ((nNonce & 0xffff) == 0)
{
nHashesDone = 0xffff+1;
return -1;
}
}
}
void DoubleBlockSHA256(const void* pin, void* pad, const void *pre, unsigned int thash[9][NPAR], const void *init)
{
unsigned int* In = (unsigned int*)pin;
unsigned int* Pad = (unsigned int*)pad;
unsigned int* hPre = (unsigned int*)pre;
unsigned int* hInit = (unsigned int*)init;
unsigned int i, j, k;
/* vectors used in calculation */
__m128i w0, w1, w2, w3, w4, w5, w6, w7;
__m128i w8, w9, w10, w11, w12, w13, w14, w15;
__m128i T1;
__m128i a, b, c, d, e, f, g, h;
__m128i nonce;
/* nonce offset for vector */
__m128i offset = _mm_set_epi32(0x00000003, 0x00000002, 0x00000001, 0x00000000);
for(k = 0; k<NPAR; k+=4) {
w0 = _mm_set1_epi32(In[0]);
w1 = _mm_set1_epi32(In[1]);
w2 = _mm_set1_epi32(In[2]);
//w3 = _mm_set1_epi32(In[3]); nonce will be later hacked into the hash
w4 = _mm_set1_epi32(In[4]);
w5 = _mm_set1_epi32(In[5]);
w6 = _mm_set1_epi32(In[6]);
w7 = _mm_set1_epi32(In[7]);
w8 = _mm_set1_epi32(In[8]);
w9 = _mm_set1_epi32(In[9]);
w10 = _mm_set1_epi32(In[10]);
w11 = _mm_set1_epi32(In[11]);
w12 = _mm_set1_epi32(In[12]);
w13 = _mm_set1_epi32(In[13]);
w14 = _mm_set1_epi32(In[14]);
w15 = _mm_set1_epi32(In[15]);
/* hack nonce into lowest byte of w3 */
nonce = _mm_set1_epi32(In[3]);
nonce = _mm_add_epi32(nonce, offset);
nonce = _mm_add_epi32(nonce, _mm_set1_epi32(k));
w3 = nonce;
a = _mm_set1_epi32(hPre[0]);
b = _mm_set1_epi32(hPre[1]);
c = _mm_set1_epi32(hPre[2]);
d = _mm_set1_epi32(hPre[3]);
e = _mm_set1_epi32(hPre[4]);
f = _mm_set1_epi32(hPre[5]);
g = _mm_set1_epi32(hPre[6]);
h = _mm_set1_epi32(hPre[7]);
SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
#define store_load(x, i, dest) \
T1 = _mm_set1_epi32((hPre)[i]); \
dest = _mm_add_epi32(T1, x);
store_load(a, 0, w0);
store_load(b, 1, w1);
store_load(c, 2, w2);
store_load(d, 3, w3);
store_load(e, 4, w4);
store_load(f, 5, w5);
store_load(g, 6, w6);
store_load(h, 7, w7);
w8 = _mm_set1_epi32(Pad[8]);
w9 = _mm_set1_epi32(Pad[9]);
w10 = _mm_set1_epi32(Pad[10]);
w11 = _mm_set1_epi32(Pad[11]);
w12 = _mm_set1_epi32(Pad[12]);
w13 = _mm_set1_epi32(Pad[13]);
w14 = _mm_set1_epi32(Pad[14]);
w15 = _mm_set1_epi32(Pad[15]);
a = _mm_set1_epi32(hInit[0]);
b = _mm_set1_epi32(hInit[1]);
c = _mm_set1_epi32(hInit[2]);
d = _mm_set1_epi32(hInit[3]);
e = _mm_set1_epi32(hInit[4]);
f = _mm_set1_epi32(hInit[5]);
g = _mm_set1_epi32(hInit[6]);
h = _mm_set1_epi32(hInit[7]);
SHA256ROUND(a, b, c, d, e, f, g, h, 0, w0);
SHA256ROUND(h, a, b, c, d, e, f, g, 1, w1);
SHA256ROUND(g, h, a, b, c, d, e, f, 2, w2);
SHA256ROUND(f, g, h, a, b, c, d, e, 3, w3);
SHA256ROUND(e, f, g, h, a, b, c, d, 4, w4);
SHA256ROUND(d, e, f, g, h, a, b, c, 5, w5);
SHA256ROUND(c, d, e, f, g, h, a, b, 6, w6);
SHA256ROUND(b, c, d, e, f, g, h, a, 7, w7);
SHA256ROUND(a, b, c, d, e, f, g, h, 8, w8);
SHA256ROUND(h, a, b, c, d, e, f, g, 9, w9);
SHA256ROUND(g, h, a, b, c, d, e, f, 10, w10);
SHA256ROUND(f, g, h, a, b, c, d, e, 11, w11);
SHA256ROUND(e, f, g, h, a, b, c, d, 12, w12);
SHA256ROUND(d, e, f, g, h, a, b, c, 13, w13);
SHA256ROUND(c, d, e, f, g, h, a, b, 14, w14);
SHA256ROUND(b, c, d, e, f, g, h, a, 15, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 16, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 17, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 18, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 19, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 20, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 21, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 22, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 23, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 24, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 25, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 26, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 27, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 28, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 29, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 30, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 31, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 32, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 33, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 34, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 35, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 36, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 37, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 38, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 39, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 40, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 41, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 42, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 43, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 44, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 45, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 46, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 47, w15);
w0 = add4(SIGMA1_256(w14), w9, SIGMA0_256(w1), w0);
SHA256ROUND(a, b, c, d, e, f, g, h, 48, w0);
w1 = add4(SIGMA1_256(w15), w10, SIGMA0_256(w2), w1);
SHA256ROUND(h, a, b, c, d, e, f, g, 49, w1);
w2 = add4(SIGMA1_256(w0), w11, SIGMA0_256(w3), w2);
SHA256ROUND(g, h, a, b, c, d, e, f, 50, w2);
w3 = add4(SIGMA1_256(w1), w12, SIGMA0_256(w4), w3);
SHA256ROUND(f, g, h, a, b, c, d, e, 51, w3);
w4 = add4(SIGMA1_256(w2), w13, SIGMA0_256(w5), w4);
SHA256ROUND(e, f, g, h, a, b, c, d, 52, w4);
w5 = add4(SIGMA1_256(w3), w14, SIGMA0_256(w6), w5);
SHA256ROUND(d, e, f, g, h, a, b, c, 53, w5);
w6 = add4(SIGMA1_256(w4), w15, SIGMA0_256(w7), w6);
SHA256ROUND(c, d, e, f, g, h, a, b, 54, w6);
w7 = add4(SIGMA1_256(w5), w0, SIGMA0_256(w8), w7);
SHA256ROUND(b, c, d, e, f, g, h, a, 55, w7);
w8 = add4(SIGMA1_256(w6), w1, SIGMA0_256(w9), w8);
SHA256ROUND(a, b, c, d, e, f, g, h, 56, w8);
w9 = add4(SIGMA1_256(w7), w2, SIGMA0_256(w10), w9);
SHA256ROUND(h, a, b, c, d, e, f, g, 57, w9);
w10 = add4(SIGMA1_256(w8), w3, SIGMA0_256(w11), w10);
SHA256ROUND(g, h, a, b, c, d, e, f, 58, w10);
w11 = add4(SIGMA1_256(w9), w4, SIGMA0_256(w12), w11);
SHA256ROUND(f, g, h, a, b, c, d, e, 59, w11);
w12 = add4(SIGMA1_256(w10), w5, SIGMA0_256(w13), w12);
SHA256ROUND(e, f, g, h, a, b, c, d, 60, w12);
w13 = add4(SIGMA1_256(w11), w6, SIGMA0_256(w14), w13);
SHA256ROUND(d, e, f, g, h, a, b, c, 61, w13);
w14 = add4(SIGMA1_256(w12), w7, SIGMA0_256(w15), w14);
SHA256ROUND(c, d, e, f, g, h, a, b, 62, w14);
w15 = add4(SIGMA1_256(w13), w8, SIGMA0_256(w0), w15);
SHA256ROUND(b, c, d, e, f, g, h, a, 63, w15);
/* store resulsts directly in thash */
#define store_2(x,i) \
w0 = _mm_set1_epi32(hInit[i]); \
*(__m128i *)&(thash)[i][0+k] = _mm_add_epi32(w0, x);
store_2(a, 0);
store_2(b, 1);
store_2(c, 2);
store_2(d, 3);
store_2(e, 4);
store_2(f, 5);
store_2(g, 6);
store_2(h, 7);
*(__m128i *)&(thash)[8][0+k] = nonce;
}
}
#endif // FOURWAYSSE2

268
ui.cpp
View File

@@ -103,6 +103,18 @@ int InsertLine(wxListCtrl* listCtrl, void* pdata, const wxString& str0, const wx
return nIndex;
}
void SetItemTextColour(wxListCtrl* listCtrl, int nIndex, const wxColour& colour)
{
// Repaint on Windows is more flickery if the colour has ever been set,
// so don't want to set it unless it's different. Default colour has
// alpha 0 transparent, so our colours don't match using operator==.
wxColour c1 = listCtrl->GetItemTextColour(nIndex);
if (!c1.IsOk())
c1 = wxColour(0,0,0);
if (colour.Red() != c1.Red() || colour.Green() != c1.Green() || colour.Blue() != c1.Blue())
listCtrl->SetItemTextColour(nIndex, colour);
}
void SetSelection(wxListCtrl* listCtrl, int nIndex)
{
int nSize = listCtrl->GetItemCount();
@@ -184,7 +196,7 @@ int ThreadSafeMessageBox(const string& message, const string& caption, int style
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent)
{
if (nFeeRequired == 0 || fDaemon)
if (nFeeRequired < CENT || nFeeRequired <= nTransactionFee || fDaemon)
return true;
string strMessage = strprintf(
_("This transaction is over the size limit. You can still send it for a fee of %s, "
@@ -196,7 +208,7 @@ bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* pa
void CalledSetStatusBar(const string& strText, int nField)
{
if (nField == 0 && IsLockdown())
if (nField == 0 && GetWarnings("statusbar") != "")
return;
if (pframeMain && pframeMain->m_statusBar)
pframeMain->m_statusBar->SetStatusText(strText, nField);
@@ -379,7 +391,7 @@ void CMainFrame::OnIconize(wxIconizeEvent& event)
if (!event.Iconized())
fClosedToTray = false;
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
if (mapArgs.count("-minimizetotray")) {
if (GetBoolArg("-minimizetotray")) {
#endif
// The tray icon sometimes disappears on ubuntu karmic
// Hiding the taskbar button doesn't work cleanly on ubuntu lucid
@@ -388,7 +400,7 @@ void CMainFrame::OnIconize(wxIconizeEvent& event)
fClosedToTray = true;
Show(!fClosedToTray);
ptaskbaricon->Show(fMinimizeToTray || fClosedToTray);
#ifdef __WXGTK__
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
}
#endif
}
@@ -434,7 +446,7 @@ int CMainFrame::GetSortIndex(const string& strSort)
#endif
}
void CMainFrame::InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5, const wxString& str6)
void CMainFrame::InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxColour& colour, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5, const wxString& str6)
{
strSort = " " + strSort; // leading space to workaround wx2.9.0 ubuntu 9.10 bug
long nData = *(long*)&hashKey; // where first char of hidden column is displayed
@@ -470,6 +482,7 @@ void CMainFrame::InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSo
m_listCtrl->SetItem(nIndex, 5, str5);
m_listCtrl->SetItem(nIndex, 6, str6);
m_listCtrl->SetItemData(nIndex, nData);
SetItemTextColour(m_listCtrl, nIndex, colour);
}
bool CMainFrame::DeleteLine(uint256 hashKey)
@@ -515,7 +528,7 @@ string SingleLine(const string& strIn)
{
string strOut;
bool fOneSpace = false;
foreach(int c, strIn)
foreach(unsigned char c, strIn)
{
if (isspace(c))
{
@@ -540,6 +553,8 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
int64 nNet = nCredit - nDebit;
uint256 hash = wtx.GetHash();
string strStatus = FormatTxStatus(wtx);
bool fConfirmed = wtx.fConfirmedDisplayed = wtx.IsConfirmed();
wxColour colour = (fConfirmed ? wxColour(0,0,0) : wxColour(128,128,128));
map<string, string> mapValue = wtx.mapValue;
wtx.nLinesDisplayed = 1;
nListViewUpdated++;
@@ -640,7 +655,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
{
//strDescription += _("Received payment to ");
//strDescription += _("Received with address ");
strDescription += _("From: unknown, Received with: ");
strDescription += _("Received with: ");
string strAddress = PubKeyToAddress(vchPubKey);
map<string, string>::iterator mi = mapAddressBook.find(strAddress);
if (mi != mapAddressBook.end() && !(*mi).second.empty())
@@ -658,12 +673,16 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
}
}
InsertLine(fNew, nIndex, hash, strSort,
string strCredit = FormatMoney(nNet, true);
if (!fConfirmed)
strCredit = "[" + strCredit + "]";
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
SingleLine(strDescription),
"",
FormatMoney(nNet, true));
strCredit);
}
else
{
@@ -678,16 +697,13 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
if (fAllFromMe && fAllToMe)
{
// Payment to self
int64 nValue = wtx.vout[0].nValue;
InsertLine(fNew, nIndex, hash, strSort,
int64 nChange = wtx.GetChange();
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
_("Payment to yourself"),
"",
"");
/// issue: can't tell which is the payment and which is the change anymore
// FormatMoney(nNet - nValue, true),
// FormatMoney(nValue, true));
FormatMoney(-(nDebit - nChange), true),
FormatMoney(nCredit - nChange, true));
}
else if (fAllFromMe)
{
@@ -730,6 +746,12 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
strDescription += " - ";
strDescription += mapValue["message"];
}
else if (!mapValue["comment"].empty())
{
if (!strDescription.empty())
strDescription += " - ";
strDescription += mapValue["comment"];
}
int64 nValue = txout.nValue;
if (nTxFee > 0)
@@ -738,12 +760,13 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
nTxFee = 0;
}
InsertLine(fNew, nIndex, hash, strprintf("%s-%d", strSort.c_str(), nOut),
InsertLine(fNew, nIndex, hash, strprintf("%s-%d", strSort.c_str(), nOut), colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
SingleLine(strDescription),
FormatMoney(-nValue, true),
"");
nIndex = -1;
wtx.nLinesDisplayed++;
}
}
@@ -758,7 +781,7 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
foreach(const CTxIn& txin, wtx.vin)
fAllMine = fAllMine && txin.IsMine();
InsertLine(fNew, nIndex, hash, strSort,
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
"",
@@ -885,13 +908,17 @@ void CMainFrame::RefreshStatusColumn()
continue;
}
CWalletTx& wtx = (*mi).second;
if (wtx.IsCoinBase() || wtx.GetTxTime() != wtx.nTimeDisplayed)
if (wtx.IsCoinBase() ||
wtx.GetTxTime() != wtx.nTimeDisplayed ||
wtx.IsConfirmed() != wtx.fConfirmedDisplayed)
{
if (!InsertTransaction(wtx, false, nIndex))
m_listCtrl->DeleteItem(nIndex--);
}
else
{
m_listCtrl->SetItem(nIndex, 2, FormatTxStatus(wtx));
}
}
}
}
@@ -1013,12 +1040,13 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
RefreshStatusColumn();
// Update status bar
static bool fPrevLockdown;
if (IsLockdown())
m_statusBar->SetStatusText(string(" ") + _("WARNING: Displayed transactions may not be correct! You may need to upgrade."), 0);
else if (fPrevLockdown)
static string strPrevWarning;
string strWarning = GetWarnings("statusbar");
if (strWarning != "")
m_statusBar->SetStatusText(string(" ") + _(strWarning), 0);
else if (strPrevWarning != "")
m_statusBar->SetStatusText("", 0);
fPrevLockdown = IsLockdown();
strPrevWarning = strWarning;
string strGen = "";
if (fGenerateBitcoins)
@@ -1027,12 +1055,9 @@ void CMainFrame::OnPaintListCtrl(wxPaintEvent& event)
strGen = _("(not connected)");
m_statusBar->SetStatusText(strGen, 1);
string strStatus = strprintf(_(" %d connections %d blocks %d transactions"), vNodes.size(), nBestHeight + 1, nTransactionCount);
string strStatus = strprintf(_(" %d connections %d blocks %d transactions"), vNodes.size(), nBestHeight, nTransactionCount);
m_statusBar->SetStatusText(strStatus, 2);
if (fDebug && GetTime() - nThreadSocketHandlerHeartbeat > 60)
m_statusBar->SetStatusText(" ERROR: ThreadSocketHandler has stopped", 0);
// Update receiving address
string strDefaultAddress = PubKeyToAddress(vchDefaultKey);
if (m_textCtrlAddress->GetValue() != strDefaultAddress)
@@ -1149,7 +1174,7 @@ void CMainFrame::OnButtonNew(wxCommandEvent& event)
string strName = dialog.GetValue();
// Generate new key
string strAddress = PubKeyToAddress(GenerateNewKey());
string strAddress = PubKeyToAddress(GetKeyFromKeyPool());
// Save
SetAddressBookName(strAddress, strName);
@@ -1354,10 +1379,10 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (fAllToMe)
{
// Payment to self
/// issue: can't tell which is the payment and which is the change anymore
//int64 nValue = wtx.vout[0].nValue;
//strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
//strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
int64 nChange = wtx.GetChange();
int64 nValue = nCredit - nChange;
strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
}
int64 nTxFee = nDebit - wtx.GetValueOut();
@@ -1386,6 +1411,8 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
//
if (!wtx.mapValue["message"].empty())
strHTML += string() + "<br><b>" + _("Message:") + "</b><br>" + HtmlEscape(wtx.mapValue["message"], true) + "<br>";
if (!wtx.mapValue["comment"].empty())
strHTML += string() + "<br><b>" + _("Comment:") + "</b><br>" + HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
if (wtx.IsCoinBase())
strHTML += string() + "<br>" + _("Generated coins must wait 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, it will change to \"not accepted\" and not be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";
@@ -1404,7 +1431,10 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (txout.IsMine())
strHTML += "<b>Credit:</b> " + FormatMoney(txout.GetCredit()) + "<br>";
strHTML += "<b>Inputs:</b><br>";
strHTML += "<br><b>Transaction:</b><br>";
strHTML += HtmlEscape(wtx.ToString(), true);
strHTML += "<br><b>Inputs:</b><br>";
CRITICAL_BLOCK(cs_mapWallet)
{
foreach(const CTxIn& txin, wtx.vin)
@@ -1423,9 +1453,6 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
}
}
}
strHTML += "<br><hr><br><b>Transaction:</b><br>";
strHTML += HtmlEscape(wtx.ToString(), true);
}
@@ -1439,8 +1466,7 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
void CTxDetailsDialog::OnButtonOK(wxCommandEvent& event)
{
Close();
//Destroy();
EndModal(false);
}
@@ -1559,6 +1585,11 @@ void SetStartOnSystemStartup(bool fAutoStart)
}
else
{
char pszExePath[MAX_PATH+1];
memset(pszExePath, 0, sizeof(pszExePath));
if (readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1) == -1)
return;
boost::filesystem::create_directories(GetAutostartDir());
boost::filesystem::ofstream optionFile(GetAutostartFilePath(), ios_base::out|ios_base::trunc);
@@ -1568,9 +1599,6 @@ void SetStartOnSystemStartup(bool fAutoStart)
return;
}
// Write a bitcoin.desktop file to the autostart directory:
char pszExePath[MAX_PATH+1];
memset(pszExePath, 0, sizeof(pszExePath));
readlink("/proc/self/exe", pszExePath, sizeof(pszExePath)-1);
optionFile << "[Desktop Entry]\n";
optionFile << "Type=Application\n";
optionFile << "Name=Bitcoin\n";
@@ -1607,9 +1635,12 @@ COptionsDialog::COptionsDialog(wxWindow* parent) : COptionsDialogBase(parent)
//m_listBox->Append(_("Test 2"));
m_listBox->SetSelection(0);
SelectPage(0);
#ifndef __WXMSW__
SetSize(1.0 * GetSize().GetWidth(), 1.2 * GetSize().GetHeight());
#endif
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
m_checkBoxStartOnSystemStartup->SetLabel(_("&Start Bitcoin on window system startup"));
if (!mapArgs.count("-minimizetotray"))
if (!GetBoolArg("-minimizetotray"))
{
// Minimize to tray is just too buggy on Linux
fMinimizeToTray = false;
@@ -1704,12 +1735,12 @@ void COptionsDialog::OnKillFocusProxy(wxFocusEvent& event)
void COptionsDialog::OnButtonOK(wxCommandEvent& event)
{
OnButtonApply(event);
Close();
EndModal(false);
}
void COptionsDialog::OnButtonCancel(wxCommandEvent& event)
{
Close();
EndModal(false);
}
void COptionsDialog::OnButtonApply(wxCommandEvent& event)
@@ -1772,7 +1803,7 @@ void COptionsDialog::OnButtonApply(wxCommandEvent& event)
CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
{
m_staticTextVersion->SetLabel(strprintf(_("version %d.%d.%d%s beta"), VERSION/10000, (VERSION/100)%100, VERSION%100, pszSubVer));
m_staticTextVersion->SetLabel(strprintf(_("version %s%s BETA"), FormatVersion(VERSION).c_str(), pszSubVer));
// Change (c) into UTF-8 or ANSI copyright symbol
wxString str = m_staticTextMain->GetLabel();
@@ -1796,7 +1827,7 @@ CAboutDialog::CAboutDialog(wxWindow* parent) : CAboutDialogBase(parent)
void CAboutDialog::OnButtonOK(wxCommandEvent& event)
{
Close();
EndModal(false);
}
@@ -1858,7 +1889,7 @@ void CSendDialog::OnTextAddress(wxCommandEvent& event)
{
strFromSave = m_textCtrlFrom->GetValue();
strMessageSave = m_textCtrlMessage->GetValue();
m_textCtrlFrom->SetValue(_("Will appear as \"From: Unknown\""));
m_textCtrlFrom->SetValue(_("n/a"));
m_textCtrlMessage->SetValue(_("Can't include a message when sending to a Bitcoin address"));
}
else if (fEnable && !fEnabledPrev)
@@ -1905,69 +1936,78 @@ void CSendDialog::OnButtonPaste(wxCommandEvent& event)
void CSendDialog::OnButtonSend(wxCommandEvent& event)
{
CWalletTx wtx;
string strAddress = (string)m_textCtrlAddress->GetValue();
static CCriticalSection cs_sendlock;
TRY_CRITICAL_BLOCK(cs_sendlock)
{
CWalletTx wtx;
string strAddress = (string)m_textCtrlAddress->GetValue();
// Parse amount
int64 nValue = 0;
if (!ParseMoney(m_textCtrlAmount->GetValue(), nValue) || nValue <= 0)
{
wxMessageBox(_("Error in amount "), _("Send Coins"));
return;
}
if (nValue > GetBalance())
{
wxMessageBox(_("Amount exceeds your balance "), _("Send Coins"));
return;
}
if (nValue + nTransactionFee > GetBalance())
{
wxMessageBox(string(_("Total exceeds your balance when the ")) + FormatMoney(nTransactionFee) + _(" transaction fee is included "), _("Send Coins"));
return;
}
// Parse bitcoin address
uint160 hash160;
bool fBitcoinAddress = AddressToHash160(strAddress, hash160);
if (fBitcoinAddress)
{
// Send to bitcoin address
CScript scriptPubKey;
scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
string strError = SendMoney(scriptPubKey, nValue, wtx, true);
if (strError == "")
wxMessageBox(_("Payment sent "), _("Sending..."));
else if (strError != "ABORTED")
wxMessageBox(strError + " ", _("Sending..."));
}
else
{
// Parse IP address
CAddress addr(strAddress);
if (!addr.IsValid())
// Parse amount
int64 nValue = 0;
if (!ParseMoney(m_textCtrlAmount->GetValue(), nValue) || nValue <= 0)
{
wxMessageBox(_("Invalid address "), _("Send Coins"));
wxMessageBox(_("Error in amount "), _("Send Coins"));
return;
}
if (nValue > GetBalance())
{
wxMessageBox(_("Amount exceeds your balance "), _("Send Coins"));
return;
}
if (nValue + nTransactionFee > GetBalance())
{
wxMessageBox(string(_("Total exceeds your balance when the ")) + FormatMoney(nTransactionFee) + _(" transaction fee is included "), _("Send Coins"));
return;
}
// Message
wtx.mapValue["to"] = strAddress;
wtx.mapValue["from"] = m_textCtrlFrom->GetValue();
wtx.mapValue["message"] = m_textCtrlMessage->GetValue();
// Parse bitcoin address
uint160 hash160;
bool fBitcoinAddress = AddressToHash160(strAddress, hash160);
// Send to IP address
CSendingDialog* pdialog = new CSendingDialog(this, addr, nValue, wtx);
if (!pdialog->ShowModal())
return;
if (fBitcoinAddress)
{
// Send to bitcoin address
CScript scriptPubKey;
scriptPubKey << OP_DUP << OP_HASH160 << hash160 << OP_EQUALVERIFY << OP_CHECKSIG;
string strError = SendMoney(scriptPubKey, nValue, wtx, true);
if (strError == "")
wxMessageBox(_("Payment sent "), _("Sending..."));
else if (strError == "ABORTED")
return; // leave send dialog open
else
{
wxMessageBox(strError + " ", _("Sending..."));
EndModal(false);
}
}
else
{
// Parse IP address
CAddress addr(strAddress);
if (!addr.IsValid())
{
wxMessageBox(_("Invalid address "), _("Send Coins"));
return;
}
// Message
wtx.mapValue["to"] = strAddress;
wtx.mapValue["from"] = m_textCtrlFrom->GetValue();
wtx.mapValue["message"] = m_textCtrlMessage->GetValue();
// Send to IP address
CSendingDialog* pdialog = new CSendingDialog(this, addr, nValue, wtx);
if (!pdialog->ShowModal())
return;
}
CRITICAL_BLOCK(cs_mapAddressBook)
if (!mapAddressBook.count(strAddress))
SetAddressBookName(strAddress, "");
EndModal(true);
}
CRITICAL_BLOCK(cs_mapAddressBook)
if (!mapAddressBook.count(strAddress))
SetAddressBookName(strAddress, "");
EndModal(true);
}
void CSendDialog::OnButtonCancel(wxCommandEvent& event)
@@ -2186,8 +2226,12 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
if (nRet > 0)
{
string strMessage;
vRecv >> strMessage;
Error(_("Transfer was not accepted"));
if (!vRecv.empty())
vRecv >> strMessage;
if (nRet == 2)
Error(_("Recipient is not accepting transactions sent by IP address"));
else
Error(_("Transfer was not accepted"));
//// todo: enlarge the window and enable a hidden white box to put seller's message
return;
}
@@ -2218,9 +2262,9 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
Error(_("Insufficient funds"));
return;
}
CKey key;
CReserveKey reservekey;
int64 nFeeRequired;
if (!CreateTransaction(scriptPubKey, nPrice, wtx, key, nFeeRequired))
if (!CreateTransaction(scriptPubKey, nPrice, wtx, reservekey, nFeeRequired))
{
if (nPrice + nFeeRequired > GetBalance())
Error(strprintf(_("This is an oversized transaction that requires a transaction fee of %s"), FormatMoney(nFeeRequired).c_str()));
@@ -2260,7 +2304,7 @@ void CSendingDialog::OnReply2(CDataStream& vRecv)
return;
// Commit
if (!CommitTransaction(wtx, key))
if (!CommitTransaction(wtx, reservekey))
{
Error(_("The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here."));
return;
@@ -2538,7 +2582,7 @@ void CAddressBookDialog::OnButtonNew(wxCommandEvent& event)
strName = dialog.GetValue();
// Generate new key
strAddress = PubKeyToAddress(GenerateNewKey());
strAddress = PubKeyToAddress(GetKeyFromKeyPool());
}
// Add to list and select it
@@ -2704,10 +2748,10 @@ wxMenu* CMyTaskBarIcon::CreatePopupMenu()
void CreateMainWindow()
{
pframeMain = new CMainFrame(NULL);
if (mapArgs.count("-min"))
if (GetBoolArg("-min"))
pframeMain->Iconize(true);
#if defined(__WXGTK__) || defined(__WXMAC_OSX__)
if (!mapArgs.count("-minimizetotray"))
if (!GetBoolArg("-minimizetotray"))
fMinimizeToTray = false;
#endif
pframeMain->Show(true); // have to show first to get taskbar button to hide

7
ui.h
View File

@@ -11,7 +11,6 @@ extern wxLocale g_locale;
void HandleCtrlA(wxKeyEvent& event);
string FormatTxStatus(const CWalletTx& wtx);
void UIThreadCall(boost::function0<void>);
int ThreadSafeMessageBox(const string& message, const string& caption="Message", int style=wxOK, wxWindow* parent=NULL, int x=-1, int y=-1);
bool ThreadSafeAskFee(int64 nFeeRequired, const string& strCaption, wxWindow* parent);
@@ -96,7 +95,7 @@ public:
void OnUIThreadCall(wxCommandEvent& event);
int GetSortIndex(const string& strSort);
void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
void InsertLine(bool fNew, int nIndex, uint256 hashKey, string strSort, const wxColour& colour, const wxString& str1, const wxString& str2, const wxString& str3, const wxString& str4, const wxString& str5);
bool DeleteLine(uint256 hashKey);
bool InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex=-1);
void RefreshListCtrl();
@@ -305,8 +304,8 @@ public:
y += 46 + wxString(strMessage2).Freq('\n') * 14;
}
#ifndef __WXMSW__
x *= 1.14;
y *= 1.14;
x = x * 114 / 100;
y = y * 114 / 100;
#endif
SetSize(x, y);
}

30
ui.rc
View File

@@ -1,15 +1,15 @@
bitcoin ICON "rc/bitcoin.ico"
#include "wx/msw/wx.rc"
check ICON "rc/check.ico"
send16 BITMAP "rc/send16.bmp"
send16mask BITMAP "rc/send16mask.bmp"
send16masknoshadow BITMAP "rc/send16masknoshadow.bmp"
send20 BITMAP "rc/send20.bmp"
send20mask BITMAP "rc/send20mask.bmp"
addressbook16 BITMAP "rc/addressbook16.bmp"
addressbook16mask BITMAP "rc/addressbook16mask.bmp"
addressbook20 BITMAP "rc/addressbook20.bmp"
addressbook20mask BITMAP "rc/addressbook20mask.bmp"
favicon ICON "rc/favicon.ico"
bitcoin ICON "rc/bitcoin.ico"
#include "wx/msw/wx.rc"
check ICON "rc/check.ico"
send16 BITMAP "rc/send16.bmp"
send16mask BITMAP "rc/send16mask.bmp"
send16masknoshadow BITMAP "rc/send16masknoshadow.bmp"
send20 BITMAP "rc/send20.bmp"
send20mask BITMAP "rc/send20mask.bmp"
addressbook16 BITMAP "rc/addressbook16.bmp"
addressbook16mask BITMAP "rc/addressbook16mask.bmp"
addressbook20 BITMAP "rc/addressbook20.bmp"
addressbook20mask BITMAP "rc/addressbook20mask.bmp"
favicon ICON "rc/favicon.ico"

View File

@@ -61,7 +61,6 @@ CMainFrameBase::CMainFrameBase( wxWindow* parent, wxWindowID id, const wxString&
m_toolBar->Realize();
m_statusBar = this->CreateStatusBar( 1, wxST_SIZEGRIP, wxID_ANY );
m_statusBar->SetBackgroundColour( wxColour( 240, 240, 240 ) );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxVERTICAL );
@@ -352,28 +351,6 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
bSizer69->Add( 0, 16, 0, wxEXPAND, 5 );
m_staticText32 = new wxStaticText( m_panelMain, wxID_ANY, _("Optional transaction fee you give to the nodes that process your transactions."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText32->Wrap( -1 );
m_staticText32->Hide();
bSizer69->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
wxBoxSizer* bSizer56;
bSizer56 = new wxBoxSizer( wxHORIZONTAL );
m_staticText31 = new wxStaticText( m_panelMain, wxID_ANY, _("Transaction fee:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText31->Wrap( -1 );
m_staticText31->Hide();
bSizer56->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_textCtrlTransactionFee = new wxTextCtrl( m_panelMain, wxID_TRANSACTIONFEE, wxEmptyString, wxDefaultPosition, wxSize( 70,-1 ), 0 );
m_textCtrlTransactionFee->Hide();
bSizer56->Add( m_textCtrlTransactionFee, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bSizer69->Add( bSizer56, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer71;
bSizer71 = new wxBoxSizer( wxHORIZONTAL );
@@ -435,6 +412,25 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
bSizer69->Add( bSizer103, 1, wxEXPAND, 5 );
bSizer69->Add( 0, 1, 0, 0, 5 );
m_staticText32 = new wxStaticText( m_panelMain, wxID_ANY, _("Optional transaction fee per KB that helps make sure your transactions are processed quickly. Most transactions are 1KB. Fee 0.01 recommended."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText32->Wrap( 365 );
bSizer69->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizer56;
bSizer56 = new wxBoxSizer( wxHORIZONTAL );
m_staticText31 = new wxStaticText( m_panelMain, wxID_ANY, _("Pay transaction fee:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText31->Wrap( -1 );
bSizer56->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_textCtrlTransactionFee = new wxTextCtrl( m_panelMain, wxID_TRANSACTIONFEE, wxEmptyString, wxDefaultPosition, wxSize( 70,-1 ), 0 );
bSizer56->Add( m_textCtrlTransactionFee, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
bSizer69->Add( bSizer56, 0, wxEXPAND, 5 );
m_panelMain->SetSizer( bSizer69 );
m_panelMain->Layout();
bSizer69->Fit( m_panelMain );
@@ -486,12 +482,12 @@ COptionsDialogBase::COptionsDialogBase( wxWindow* parent, wxWindowID id, const w
// Connect Events
m_listBox->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( COptionsDialogBase::OnListBox ), NULL, this );
m_textCtrlTransactionFee->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusTransactionFee ), NULL, this );
m_checkBoxLimitProcessors->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxLimitProcessors ), NULL, this );
m_checkBoxMinimizeToTray->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxMinimizeToTray ), NULL, this );
m_checkBoxUseProxy->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxUseProxy ), NULL, this );
m_textCtrlProxyIP->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
m_textCtrlProxyPort->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
m_textCtrlTransactionFee->Connect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusTransactionFee ), NULL, this );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonOK ), NULL, this );
m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonCancel ), NULL, this );
m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonApply ), NULL, this );
@@ -501,12 +497,12 @@ COptionsDialogBase::~COptionsDialogBase()
{
// Disconnect Events
m_listBox->Disconnect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( COptionsDialogBase::OnListBox ), NULL, this );
m_textCtrlTransactionFee->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusTransactionFee ), NULL, this );
m_checkBoxLimitProcessors->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxLimitProcessors ), NULL, this );
m_checkBoxMinimizeToTray->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxMinimizeToTray ), NULL, this );
m_checkBoxUseProxy->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnCheckBoxUseProxy ), NULL, this );
m_textCtrlProxyIP->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
m_textCtrlProxyPort->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusProxy ), NULL, this );
m_textCtrlTransactionFee->Disconnect( wxEVT_KILL_FOCUS, wxFocusEventHandler( COptionsDialogBase::OnKillFocusTransactionFee ), NULL, this );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonOK ), NULL, this );
m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonCancel ), NULL, this );
m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( COptionsDialogBase::OnButtonApply ), NULL, this );
@@ -554,7 +550,7 @@ CAboutDialogBase::CAboutDialogBase( wxWindow* parent, wxWindowID id, const wxStr
bSizer631->Add( 0, 4, 0, wxEXPAND, 5 );
m_staticTextMain = new wxStaticText( this, wxID_ANY, _("Copyright (c) 2009-2010 Satoshi Nakamoto.\n\nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file \nlicense.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the \nOpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \nEric Young (eay@cryptsoft.com)."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMain = new wxStaticText( this, wxID_ANY, _("Copyright (c) 2009-2010 Bitcoin Developers\n\nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file \nlicense.txt or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the \nOpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by \nEric Young (eay@cryptsoft.com)."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextMain->Wrap( -1 );
bSizer631->Add( m_staticTextMain, 0, wxALL, 5 );

View File

@@ -47,9 +47,9 @@
#define wxID_TEXTCTRLADDRESS 1004
#define wxID_BUTTONNEW 1005
#define wxID_BUTTONCOPY 1006
#define wxID_TRANSACTIONFEE 1007
#define wxID_PROXYIP 1008
#define wxID_PROXYPORT 1009
#define wxID_PROXYIP 1007
#define wxID_PROXYPORT 1008
#define wxID_TRANSACTIONFEE 1009
#define wxID_TEXTCTRLPAYTO 1010
#define wxID_BUTTONPASTE 1011
#define wxID_BUTTONADDRESSBOOK 1012
@@ -163,9 +163,6 @@ class COptionsDialogBase : public wxDialog
wxScrolledWindow* m_scrolledWindow;
wxPanel* m_panelMain;
wxStaticText* m_staticText32;
wxStaticText* m_staticText31;
wxTextCtrl* m_textCtrlTransactionFee;
wxCheckBox* m_checkBoxLimitProcessors;
wxSpinCtrl* m_spinCtrlLimitProcessors;
wxStaticText* m_staticText35;
@@ -178,6 +175,10 @@ class COptionsDialogBase : public wxDialog
wxTextCtrl* m_textCtrlProxyIP;
wxStaticText* m_staticTextProxyPort;
wxTextCtrl* m_textCtrlProxyPort;
wxStaticText* m_staticText32;
wxStaticText* m_staticText31;
wxTextCtrl* m_textCtrlTransactionFee;
wxPanel* m_panelTest2;
wxStaticText* m_staticText321;
@@ -188,11 +189,11 @@ class COptionsDialogBase : public wxDialog
// Virtual event handlers, overide them in your derived class
virtual void OnListBox( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusTransactionFee( wxFocusEvent& event ){ event.Skip(); }
virtual void OnCheckBoxLimitProcessors( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxMinimizeToTray( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCheckBoxUseProxy( wxCommandEvent& event ){ event.Skip(); }
virtual void OnKillFocusProxy( wxFocusEvent& event ){ event.Skip(); }
virtual void OnKillFocusTransactionFee( wxFocusEvent& event ){ event.Skip(); }
virtual void OnButtonOK( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonCancel( wxCommandEvent& event ){ event.Skip(); }
virtual void OnButtonApply( wxCommandEvent& event ){ event.Skip(); }

File diff suppressed because it is too large Load Diff

203
util.cpp
View File

@@ -11,9 +11,20 @@ bool fDebug = false;
bool fPrintToConsole = false;
bool fPrintToDebugger = false;
char pszSetDataDir[MAX_PATH] = "";
bool fRequestShutdown = false;
bool fShutdown = false;
bool fDaemon = false;
bool fCommandLine = false;
string strMiscWarning;
bool fTestNet = false;
bool fNoListen = false;
// Workaround for "multiple definition of `_tls_used'"
// http://svn.boost.org/trac/boost/ticket/4258
extern "C" void tss_cleanup_implemented() { }
@@ -70,7 +81,7 @@ instance_of_cinit;
void RandAddSeed()
{
// Seed with CPU performance counter
int64 nCounter = PerformanceCounter();
int64 nCounter = GetPerformanceCounter();
RAND_add(&nCounter, sizeof(nCounter), 1.5);
memset(&nCounter, 0, sizeof(nCounter));
}
@@ -95,12 +106,8 @@ void RandAddSeedPerfmon()
RegCloseKey(HKEY_PERFORMANCE_DATA);
if (ret == ERROR_SUCCESS)
{
uint256 hash;
SHA256(pdata, nSize, (unsigned char*)&hash);
RAND_add(&hash, sizeof(hash), min(nSize/500.0, (double)sizeof(hash)));
hash = 0;
RAND_add(pdata, nSize, nSize/100.0);
memset(pdata, 0, nSize);
printf("%s RandAddSeed() %d bytes\n", DateTimeStrFormat("%x %H:%M", GetTime()).c_str(), nSize);
}
#endif
@@ -121,6 +128,11 @@ uint64 GetRand(uint64 nMax)
return (nRand % nMax);
}
int GetRandInt(int nMax)
{
return GetRand(nMax);
}
@@ -145,10 +157,16 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
else
{
// print to debug.log
char pszFile[MAX_PATH+100];
GetDataDir(pszFile);
strlcat(pszFile, "/debug.log", sizeof(pszFile));
FILE* fileout = fopen(pszFile, "a");
static FILE* fileout = NULL;
if (!fileout)
{
char pszFile[MAX_PATH+100];
GetDataDir(pszFile);
strlcat(pszFile, "/debug.log", sizeof(pszFile));
fileout = fopen(pszFile, "a");
if (fileout) setbuf(fileout, NULL); // unbuffered
}
if (fileout)
{
//// Debug print useful for profiling
@@ -157,15 +175,15 @@ inline int OutputDebugStringF(const char* pszFormat, ...)
va_start(arg_ptr, pszFormat);
ret = vfprintf(fileout, pszFormat, arg_ptr);
va_end(arg_ptr);
fclose(fileout);
}
}
#ifdef __WXMSW__
if (fPrintToDebugger)
{
// accumulate a line at a time
static CCriticalSection cs_OutputDebugStringF;
// accumulate a line at a time
CRITICAL_BLOCK(cs_OutputDebugStringF)
{
static char pszBuffer[50000];
@@ -362,11 +380,6 @@ bool ParseMoney(const char* pszIn, int64& nRet)
vector<unsigned char> ParseHex(const char* psz)
{
vector<unsigned char> vch;
while (isspace(*psz))
psz++;
vch.reserve((strlen(psz)+1)/3);
static char phexdigit[256] =
{ -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
@@ -385,28 +398,26 @@ vector<unsigned char> ParseHex(const char* psz)
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, };
while (*psz)
// convert hex dump to vector
vector<unsigned char> vch;
loop
{
char c = phexdigit[(unsigned char)*psz++];
if (c == -1)
break;
unsigned char n = (c << 4);
if (*psz)
{
char c = phexdigit[(unsigned char)*psz++];
if (c == -1)
break;
n |= c;
vch.push_back(n);
}
while (isspace(*psz))
psz++;
char c = phexdigit[(unsigned char)*psz++];
if (c == (char)-1)
break;
unsigned char n = (c << 4);
c = phexdigit[(unsigned char)*psz++];
if (c == (char)-1)
break;
n |= c;
vch.push_back(n);
}
return vch;
}
vector<unsigned char> ParseHex(const std::string& str)
vector<unsigned char> ParseHex(const string& str)
{
return ParseHex(str.c_str());
}
@@ -474,6 +485,34 @@ const char* wxGetTranslation(const char* pszEnglish)
}
bool WildcardMatch(const char* psz, const char* mask)
{
loop
{
switch (*mask)
{
case '\0':
return (*psz == '\0');
case '*':
return WildcardMatch(psz, mask+1) || (*psz && WildcardMatch(psz+1, mask));
case '?':
if (*psz == '\0')
return false;
break;
default:
if (*psz != *mask)
return false;
break;
}
psz++;
mask++;
}
}
bool WildcardMatch(const string& str, const string& mask)
{
return WildcardMatch(str.c_str(), mask.c_str());
}
@@ -501,23 +540,47 @@ void FormatException(char* pszMessage, std::exception* pex, const char* pszThrea
void LogException(std::exception* pex, const char* pszThread)
{
char pszMessage[1000];
char pszMessage[10000];
FormatException(pszMessage, pex, pszThread);
printf("\n%s", pszMessage);
}
void PrintException(std::exception* pex, const char* pszThread)
{
char pszMessage[1000];
char pszMessage[10000];
FormatException(pszMessage, pex, pszThread);
printf("\n\n************************\n%s\n", pszMessage);
fprintf(stderr, "\n\n************************\n%s\n", pszMessage);
strMiscWarning = pszMessage;
#ifdef GUI
if (wxTheApp && !fDaemon)
MyMessageBox(pszMessage, "Error", wxOK | wxICON_ERROR);
MyMessageBox(pszMessage, "Bitcoin", wxOK | wxICON_ERROR);
#endif
throw;
//DebugBreak();
}
void ThreadOneMessageBox(string strMessage)
{
// Skip message boxes if one is already open
static bool fMessageBoxOpen;
if (fMessageBoxOpen)
return;
fMessageBoxOpen = true;
ThreadSafeMessageBox(strMessage, "Bitcoin", wxOK | wxICON_EXCLAMATION);
fMessageBoxOpen = false;
}
void PrintExceptionContinue(std::exception* pex, const char* pszThread)
{
char pszMessage[10000];
FormatException(pszMessage, pex, pszThread);
printf("\n\n************************\n%s\n", pszMessage);
fprintf(stderr, "\n\n************************\n%s\n", pszMessage);
strMiscWarning = pszMessage;
#ifdef GUI
if (wxTheApp && !fDaemon)
boost::thread(boost::bind(ThreadOneMessageBox, string(pszMessage)));
#endif
}
@@ -593,15 +656,11 @@ string GetDefaultDataDir()
void GetDataDir(char* pszDir)
{
// pszDir must be at least MAX_PATH length.
int nVariation;
if (pszSetDataDir[0] != 0)
{
strlcpy(pszDir, pszSetDataDir, MAX_PATH);
static bool fMkdirDone;
if (!fMkdirDone)
{
fMkdirDone = true;
filesystem::create_directory(pszDir);
}
nVariation = 0;
}
else
{
@@ -609,11 +668,23 @@ void GetDataDir(char* pszDir)
// value so we don't have to do memory allocations after that.
static char pszCachedDir[MAX_PATH];
if (pszCachedDir[0] == 0)
{
strlcpy(pszCachedDir, GetDefaultDataDir().c_str(), sizeof(pszCachedDir));
filesystem::create_directory(pszCachedDir);
}
strlcpy(pszDir, pszCachedDir, MAX_PATH);
nVariation = 1;
}
if (fTestNet)
{
char* p = pszDir + strlen(pszDir);
if (p > pszDir && p[-1] != '/' && p[-1] != '\\')
*p++ = '/';
strcpy(p, "testnet");
nVariation += 2;
}
static bool pfMkdir[4];
if (!pfMkdir[nVariation])
{
pfMkdir[nVariation] = true;
filesystem::create_directory(pszDir);
}
}
@@ -627,7 +698,7 @@ string GetDataDir()
string GetConfigFile()
{
namespace fs = boost::filesystem;
fs::path pathConfig(mapArgs.count("-conf") ? mapArgs["-conf"] : string("bitcoin.conf"));
fs::path pathConfig(GetArg("-conf", "bitcoin.conf"));
if (!pathConfig.is_complete())
pathConfig = fs::path(GetDataDir()) / pathConfig;
return pathConfig.string();
@@ -695,13 +766,10 @@ void ShrinkDebugFile()
//
// "Never go to sea with two chronometers; take one or three."
// Our three chronometers are:
// Our three time sources are:
// - System clock
// - Median of other server's clocks
// - NTP servers
//
// note: NTP isn't implemented yet, so until then we just use the median
// of other nodes clocks to correct ours.
// - Median of other nodes's clocks
// - The user (asking the user to fix the system clock if the first two disagree)
//
int64 GetTime()
{
@@ -734,14 +802,33 @@ void AddTimeData(unsigned int ip, int64 nTime)
{
sort(vTimeOffsets.begin(), vTimeOffsets.end());
int64 nMedian = vTimeOffsets[vTimeOffsets.size()/2];
nTimeOffset = nMedian;
if ((nMedian > 0 ? nMedian : -nMedian) > 70 * 60)
// Only let other nodes change our time by so much
if (abs64(nMedian) < 70 * 60)
{
nTimeOffset = nMedian;
}
else
{
// Only let other nodes change our clock so far before we
// go to the NTP servers
/// todo: Get time from NTP servers, then set a flag
/// to make sure it doesn't get changed again
nTimeOffset = 0;
static bool fDone;
if (!fDone)
{
// If nobody has a time different than ours but within 5 minutes of ours, give a warning
bool fMatch = false;
foreach(int64 nOffset, vTimeOffsets)
if (nOffset != 0 && abs64(nOffset) < 5 * 60)
fMatch = true;
if (!fMatch)
{
fDone = true;
string strMessage = _("Warning: Please check that your computer's date and time are correct. If your clock is wrong Bitcoin will not work properly.");
strMiscWarning = strMessage;
printf("*** %s\n", strMessage.c_str());
boost::thread(boost::bind(ThreadSafeMessageBox, strMessage+" ", string("Bitcoin"), wxOK | wxICON_EXCLAMATION, (wxWindow*)NULL, -1, -1));
}
}
}
foreach(int64 n, vTimeOffsets)
printf("%+"PRI64d" ", n);

132
util.h
View File

@@ -140,9 +140,13 @@ extern bool fDebug;
extern bool fPrintToConsole;
extern bool fPrintToDebugger;
extern char pszSetDataDir[MAX_PATH];
extern bool fRequestShutdown;
extern bool fShutdown;
extern bool fDaemon;
extern bool fCommandLine;
extern string strMiscWarning;
extern bool fTestNet;
extern bool fNoListen;
void RandAddSeed();
void RandAddSeedPerfmon();
@@ -150,16 +154,19 @@ int OutputDebugStringF(const char* pszFormat, ...);
int my_snprintf(char* buffer, size_t limit, const char* format, ...);
string strprintf(const char* format, ...);
bool error(const char* format, ...);
void PrintException(std::exception* pex, const char* pszThread);
void LogException(std::exception* pex, const char* pszThread);
void PrintException(std::exception* pex, const char* pszThread);
void PrintExceptionContinue(std::exception* pex, const char* pszThread);
void ParseString(const string& str, char c, vector<string>& v);
string FormatMoney(int64 n, bool fPlus=false);
bool ParseMoney(const string& str, int64& nRet);
bool ParseMoney(const char* pszIn, int64& nRet);
vector<unsigned char> ParseHex(const char* psz);
vector<unsigned char> ParseHex(const std::string& str);
vector<unsigned char> ParseHex(const string& str);
void ParseParameters(int argc, char* argv[]);
const char* wxGetTranslation(const char* psz);
bool WildcardMatch(const char* psz, const char* mask);
bool WildcardMatch(const string& str, const string& mask);
int GetFilesize(FILE* file);
void GetDataDir(char* pszDirRet);
string GetConfigFile();
@@ -170,6 +177,7 @@ string MyGetSpecialFolderPath(int nFolder, bool fCreate);
string GetDefaultDataDir();
string GetDataDir();
void ShrinkDebugFile();
int GetRandInt(int nMax);
uint64 GetRand(uint64 nMax);
int64 GetTime();
int64 GetAdjustedTime();
@@ -298,18 +306,26 @@ inline int64 roundint64(double d)
return (int64)(d > 0 ? d + 0.5 : d - 0.5);
}
template<typename T>
string HexStr(const T itbegin, const T itend, bool fSpaces=true)
inline int64 abs64(int64 n)
{
return (n >= 0 ? n : -n);
}
template<typename T>
string HexStr(const T itbegin, const T itend, bool fSpaces=false)
{
if (itbegin == itend)
return "";
const unsigned char* pbegin = (const unsigned char*)&itbegin[0];
const unsigned char* pend = pbegin + (itend - itbegin) * sizeof(itbegin[0]);
string str;
str.reserve((pend-pbegin) * (fSpaces ? 3 : 2));
for (const unsigned char* p = pbegin; p != pend; p++)
str += strprintf((fSpaces && p != pend-1 ? "%02x " : "%02x"), *p);
return str;
}
inline string HexStr(vector<unsigned char> vch, bool fSpaces=true)
inline string HexStr(const vector<unsigned char>& vch, bool fSpaces=false)
{
return HexStr(vch.begin(), vch.end(), fSpaces);
}
@@ -317,26 +333,34 @@ inline string HexStr(vector<unsigned char> vch, bool fSpaces=true)
template<typename T>
string HexNumStr(const T itbegin, const T itend, bool f0x=true)
{
if (itbegin == itend)
return "";
const unsigned char* pbegin = (const unsigned char*)&itbegin[0];
const unsigned char* pend = pbegin + (itend - itbegin) * sizeof(itbegin[0]);
string str = (f0x ? "0x" : "");
str.reserve(str.size() + (pend-pbegin) * 2);
for (const unsigned char* p = pend-1; p >= pbegin; p--)
str += strprintf("%02X", *p);
str += strprintf("%02x", *p);
return str;
}
inline string HexNumStr(const vector<unsigned char>& vch, bool f0x=true)
{
return HexNumStr(vch.begin(), vch.end(), f0x);
}
template<typename T>
void PrintHex(const T pbegin, const T pend, const char* pszFormat="%s", bool fSpaces=true)
{
printf(pszFormat, HexStr(pbegin, pend, fSpaces).c_str());
}
inline void PrintHex(vector<unsigned char> vch, const char* pszFormat="%s", bool fSpaces=true)
inline void PrintHex(const vector<unsigned char>& vch, const char* pszFormat="%s", bool fSpaces=true)
{
printf(pszFormat, HexStr(vch, fSpaces).c_str());
}
inline int64 PerformanceCounter()
inline int64 GetPerformanceCounter()
{
int64 nCounter = 0;
#ifdef __WXMSW__
@@ -380,6 +404,39 @@ inline bool IsSwitchChar(char c)
#endif
}
inline string GetArg(const string& strArg, const string& strDefault)
{
if (mapArgs.count(strArg))
return mapArgs[strArg];
return strDefault;
}
inline int64 GetArg(const string& strArg, int64 nDefault)
{
if (mapArgs.count(strArg))
return atoi64(mapArgs[strArg]);
return nDefault;
}
inline bool GetBoolArg(const string& strArg)
{
if (mapArgs.count(strArg))
{
if (mapArgs[strArg].empty())
return true;
return (atoi(mapArgs[strArg]) != 0);
}
return false;
}
inline string FormatVersion(int nVersion)
{
if (nVersion%100 == 0)
return strprintf("%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100);
else
return strprintf("%d.%d.%d.%d", nVersion/1000000, (nVersion/10000)%100, (nVersion/100)%100, nVersion%100);
}
@@ -399,16 +456,16 @@ inline void heapchk()
}
// Randomize the stack to help protect against buffer overrun exploits
#define IMPLEMENT_RANDOMIZE_STACK(ThreadFn) \
{ \
static char nLoops; \
if (nLoops <= 0) \
nLoops = GetRand(20) + 1; \
if (nLoops-- > 1) \
{ \
ThreadFn; \
return; \
} \
#define IMPLEMENT_RANDOMIZE_STACK(ThreadFn) \
{ \
static char nLoops; \
if (nLoops <= 0) \
nLoops = GetRand(20) + 1; \
if (nLoops-- > 1) \
{ \
ThreadFn; \
return; \
} \
}
#define CATCH_PRINT_EXCEPTION(pszFn) \
@@ -430,8 +487,9 @@ inline void heapchk()
template<typename T1>
inline uint256 Hash(const T1 pbegin, const T1 pend)
{
static unsigned char pblank[1];
uint256 hash1;
SHA256((unsigned char*)&pbegin[0], (pend - pbegin) * sizeof(pbegin[0]), (unsigned char*)&hash1);
SHA256((pbegin == pend ? pblank : (unsigned char*)&pbegin[0]), (pend - pbegin) * sizeof(pbegin[0]), (unsigned char*)&hash1);
uint256 hash2;
SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2);
return hash2;
@@ -441,11 +499,12 @@ template<typename T1, typename T2>
inline uint256 Hash(const T1 p1begin, const T1 p1end,
const T2 p2begin, const T2 p2end)
{
static unsigned char pblank[1];
uint256 hash1;
SHA256_CTX ctx;
SHA256_Init(&ctx);
SHA256_Update(&ctx, (unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]));
SHA256_Update(&ctx, (unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]));
SHA256_Update(&ctx, (p1begin == p1end ? pblank : (unsigned char*)&p1begin[0]), (p1end - p1begin) * sizeof(p1begin[0]));
SHA256_Update(&ctx, (p2begin == p2end ? pblank : (unsigned char*)&p2begin[0]), (p2end - p2begin) * sizeof(p2begin[0]));
SHA256_Final((unsigned char*)&hash1, &ctx);
uint256 hash2;
SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2);
@@ -457,12 +516,13 @@ inline uint256 Hash(const T1 p1begin, const T1 p1end,
const T2 p2begin, const T2 p2end,
const T3 p3begin, const T3 p3end)
{
static unsigned char pblank[1];
uint256 hash1;
SHA256_CTX ctx;
SHA256_Init(&ctx);
SHA256_Update(&ctx, (unsigned char*)&p1begin[0], (p1end - p1begin) * sizeof(p1begin[0]));
SHA256_Update(&ctx, (unsigned char*)&p2begin[0], (p2end - p2begin) * sizeof(p2begin[0]));
SHA256_Update(&ctx, (unsigned char*)&p3begin[0], (p3end - p3begin) * sizeof(p3begin[0]));
SHA256_Update(&ctx, (p1begin == p1end ? pblank : (unsigned char*)&p1begin[0]), (p1end - p1begin) * sizeof(p1begin[0]));
SHA256_Update(&ctx, (p2begin == p2end ? pblank : (unsigned char*)&p2begin[0]), (p2end - p2begin) * sizeof(p2begin[0]));
SHA256_Update(&ctx, (p3begin == p3end ? pblank : (unsigned char*)&p3begin[0]), (p3end - p3begin) * sizeof(p3begin[0]));
SHA256_Final((unsigned char*)&hash1, &ctx);
uint256 hash2;
SHA256((unsigned char*)&hash1, sizeof(hash1), (unsigned char*)&hash2);
@@ -574,3 +634,27 @@ inline void ExitThread(unsigned int nExitCode)
pthread_exit((void*)nExitCode);
}
#endif
inline bool AffinityBugWorkaround(void(*pfn)(void*))
{
#ifdef __WXMSW__
// Sometimes after a few hours affinity gets stuck on one processor
DWORD dwProcessAffinityMask = -1;
DWORD dwSystemAffinityMask = -1;
GetProcessAffinityMask(GetCurrentProcess(), &dwProcessAffinityMask, &dwSystemAffinityMask);
DWORD dwPrev1 = SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinityMask);
DWORD dwPrev2 = SetThreadAffinityMask(GetCurrentThread(), dwProcessAffinityMask);
if (dwPrev2 != dwProcessAffinityMask)
{
printf("AffinityBugWorkaround() : SetThreadAffinityMask=%d, ProcessAffinityMask=%d, restarting thread\n", dwPrev2, dwProcessAffinityMask);
if (!CreateThread(pfn, NULL))
printf("Error: CreateThread() failed\n");
return true;
}
#endif
return false;
}

View File

@@ -1,278 +1,278 @@
/* XPM */
static const char * addressbook16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #E6EFF7",
"+ c #E6E6F7",
"@ c #CEE6F7",
"# c #DEDEEF",
"$ c #D6DEEF",
"% c #D6DEE6",
"& c #CEDEF7",
"* c #CEDEEF",
"= c #EFF708",
"- c #C5DEF7",
"; c #CED6EF",
": c None",
"> c #C5D6E6",
", c #BDD6F7",
"< c #BDD6EF",
"1 c #D6CECE",
"2 c #BDCEE6",
"3 c #BDC5E6",
"4 c #B5C5DE",
"5 c #BDD631",
"6 c #ADBDDE",
"7 c #B5B5BD",
"8 c #A5B5D6",
"9 c #00FFFF",
"0 c #9CB5CE",
"q c #9CADD6",
"w c #94A5D6",
"e c #8CA5D6",
"r c #8CA5CE",
"t c #8CA5C5",
"y c #849CC5",
"u c #7B9CD6",
"i c #7B9CCE",
"p c #31BDCE",
"a c #6B9CD6",
"s c #00F708",
"d c #8494AD",
"f c #7B94B5",
"g c #6B94D6",
"h c #6B9C84",
"j c #7B8CAD",
"k c #738CAD",
"l c #638CC5",
"z c #10CE42",
"x c #638CBD",
"c c #7B849C",
"v c #73849C",
"b c #6B84A5",
"n c #7B7BA5",
"m c #6B849C",
"M c #7B8C42",
"N c #5A84C5",
"B c #29AD6B",
"V c #F74A4A",
"C c #6384A5",
"Z c #5284C5",
"A c #637BA5",
"S c #637B9C",
"D c #9C637B",
"F c #6B7B5A",
"G c #637394",
"H c #52739C",
"J c #5A7384",
"K c #526B94",
"L c #426B94",
"P c #52638C",
"I c #426B7B",
"U c #5A5A8C",
"Y c #524A7B",
"T c #425273",
"R c #21636B",
"E c #106394",
"W c #106B52",
"Q c #3A4273",
"! c #31426B",
"~ c #523163",
"^ c #29426B",
"/ c #293A63",
"( c #213A63",
") c #193A63",
"_ c #193163",
"` c #19315A",
"' c #212963",
"] c #10315A",
"[ c #082952",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
": : : : : : : : : : : : : : : : ",
": : H H H A d : 7 G K H H : : : ",
"n n c X 4 k j X b n n : ",
"n 2 c $ 8 6 4 x < + 4 4 C V ~ : ",
"n * c X o $ y N u 6 $ + b D Y : ",
"n * c X > g , S z R : ",
"n * c * r r y g , 6 r q S s W : ",
"n * c X 4 N u + m B I : ",
"n * c X ; a - S 5 F : ",
"n * c * r r r g - S = M : ",
"n * c X 4 N - m h J : ",
"n * c X ; a - A 9 E : ",
"n * ( ] ` ^ P l y T / / ( p L : ",
"n O > 0 f ) ! t 8 % n : ",
"U U U U U U U ' Q U U U U U U : ",
": : : : : : : : : : : : : : : : "
};
/* XPM */
static const char * addressbook16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #E6EFF7",
"+ c #E6E6F7",
"@ c #CEE6F7",
"# c #DEDEEF",
"$ c #D6DEEF",
"% c #D6DEE6",
"& c #CEDEF7",
"* c #CEDEEF",
"= c #EFF708",
"- c #C5DEF7",
"; c #CED6EF",
": c None",
"> c #C5D6E6",
", c #BDD6F7",
"< c #BDD6EF",
"1 c #D6CECE",
"2 c #BDCEE6",
"3 c #BDC5E6",
"4 c #B5C5DE",
"5 c #BDD631",
"6 c #ADBDDE",
"7 c #B5B5BD",
"8 c #A5B5D6",
"9 c #00FFFF",
"0 c #9CB5CE",
"q c #9CADD6",
"w c #94A5D6",
"e c #8CA5D6",
"r c #8CA5CE",
"t c #8CA5C5",
"y c #849CC5",
"u c #7B9CD6",
"i c #7B9CCE",
"p c #31BDCE",
"a c #6B9CD6",
"s c #00F708",
"d c #8494AD",
"f c #7B94B5",
"g c #6B94D6",
"h c #6B9C84",
"j c #7B8CAD",
"k c #738CAD",
"l c #638CC5",
"z c #10CE42",
"x c #638CBD",
"c c #7B849C",
"v c #73849C",
"b c #6B84A5",
"n c #7B7BA5",
"m c #6B849C",
"M c #7B8C42",
"N c #5A84C5",
"B c #29AD6B",
"V c #F74A4A",
"C c #6384A5",
"Z c #5284C5",
"A c #637BA5",
"S c #637B9C",
"D c #9C637B",
"F c #6B7B5A",
"G c #637394",
"H c #52739C",
"J c #5A7384",
"K c #526B94",
"L c #426B94",
"P c #52638C",
"I c #426B7B",
"U c #5A5A8C",
"Y c #524A7B",
"T c #425273",
"R c #21636B",
"E c #106394",
"W c #106B52",
"Q c #3A4273",
"! c #31426B",
"~ c #523163",
"^ c #29426B",
"/ c #293A63",
"( c #213A63",
") c #193A63",
"_ c #193163",
"` c #19315A",
"' c #212963",
"] c #10315A",
"[ c #082952",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
": : : : : : : : : : : : : : : : ",
": : H H H A d : 7 G K H H : : : ",
"n n c X 4 k j X b n n : ",
"n 2 c $ 8 6 4 x < + 4 4 C V ~ : ",
"n * c X o $ y N u 6 $ + b D Y : ",
"n * c X > g , S z R : ",
"n * c * r r y g , 6 r q S s W : ",
"n * c X 4 N u + m B I : ",
"n * c X ; a - S 5 F : ",
"n * c * r r r g - S = M : ",
"n * c X 4 N - m h J : ",
"n * c X ; a - A 9 E : ",
"n * ( ] ` ^ P l y T / / ( p L : ",
"n O > 0 f ) ! t 8 % n : ",
"U U U U U U U ' Q U U U U U U : ",
": : : : : : : : : : : : : : : : "
};

View File

@@ -1,282 +1,282 @@
/* XPM */
static const char * addressbook20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #EFF7F7",
"+ c #E6EFFF",
"@ c #E6EFF7",
"# c #DEEFFF",
"$ c #DEE6F7",
"% c #DEE6EF",
"& c #D6E6F7",
"* c #FFFF00",
"= c #DEDEE6",
"- c #D6DEE6",
"; c #D6D6DE",
": c #CED6E6",
"> c None",
", c #C5D6E6",
"< c #C5CEE6",
"1 c #B5CEEF",
"2 c #C5C5C5",
"3 c #C5DE31",
"4 c #B5C5DE",
"5 c #BDC5C5",
"6 c #ADC5EF",
"7 c #B5C5CE",
"8 c #BDBDBD",
"9 c #B5BDCE",
"0 c #ADBDDE",
"q c #ADBDD6",
"w c #B5CE52",
"e c #ADB5C5",
"r c #00FFFF",
"t c #A5B5C5",
"y c #9CB5CE",
"u c #94B5DE",
"i c #9CADD6",
"p c #A5ADB5",
"a c #94ADDE",
"s c #94ADD6",
"d c #9CADBD",
"f c #8CADDE",
"g c #BD9CA5",
"h c #9CA5BD",
"j c #9CA5B5",
"k c #29D6E6",
"l c #8CA5CE",
"z c #849CCE",
"x c #6BA5C5",
"c c #739CDE",
"v c #00FF00",
"b c #739CD6",
"n c #7B94CE",
"m c #8494AD",
"M c #7394CE",
"N c #7B94B5",
"B c #4AB584",
"V c #848CB5",
"C c #6B94CE",
"Z c #6394D6",
"A c #6394CE",
"S c #7B8CAD",
"D c #6B8CC5",
"F c #738CAD",
"G c #5294B5",
"H c #6B84C5",
"J c #7384A5",
"K c #73849C",
"L c #738494",
"P c #FF4A4A",
"I c #FF4A42",
"U c #737B8C",
"Y c #637BAD",
"T c #527BBD",
"R c #637394",
"E c #637352",
"W c #5A6B8C",
"Q c #526B9C",
"! c #63638C",
"~ c #5A734A",
"^ c #4A6B9C",
"/ c #526B63",
"( c #0884A5",
") c #526384",
"_ c #52637B",
"` c #4A6B5A",
"' c #52636B",
"] c #525A8C",
"[ c #525A7B",
"{ c #426363",
"} c #4A5A7B",
"| c #425A8C",
" . c #196B94",
".. c #3A5A8C",
"X. c #3A5A84",
"o. c #087B4A",
"O. c #21636B",
"+. c #634263",
"@. c #3A527B",
"#. c #424A84",
"$. c #315284",
"%. c #295284",
"&. c #3A4A6B",
"*. c #42427B",
"=. c #424273",
"-. c #294A84",
";. c #3A3A73",
":. c #194284",
">. c #104A63",
",. c #213A6B",
"<. c #31316B",
"1. c #21315A",
"2. c #212163",
"3. c #08295A",
"4. c #082152",
"5. c #101952",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > U $.| | ^ S 2 > p W | | @.L > > > > ",
"8 5 R - < Y j S O - ) g e > > ",
"! V K - % a Q # - +.P <.> > ",
"! & K - 0 z n D C b f n n z q +.P <.> > ",
"! & K - % M A 1 - %.G #.> > ",
"! & K - % u b # - o.v >.> > ",
"! & K - 0 z n H M b 6 z n z q o.v >.> > ",
"! & K - X - M A a - O.B @.> > ",
"! & K - X % u b # - ` 3 / > > ",
"! & K - 0 l i 4 u b # - ~ * E > > ",
"! & K - X o $ s T b # - { w ' > > ",
"! & K - % f b # - .k -.> > ",
"! & K m d t 7 , u b # ; 9 9 h ( r :.> > ",
"! & h _ _ [ &.4.$.A ,.1.} _ _ F x ] > > ",
"! @ , y N _ 3._ N y , @ ! > > ",
"*.*.*.*.*.*.*.*.;.5.*.*.*.*.*.*.*.2.> > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > "
};
/* XPM */
static const char * addressbook20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #FFFFFF",
". c #F7FFFF",
"X c #F7F7FF",
"o c #EFF7FF",
"O c #EFF7F7",
"+ c #E6EFFF",
"@ c #E6EFF7",
"# c #DEEFFF",
"$ c #DEE6F7",
"% c #DEE6EF",
"& c #D6E6F7",
"* c #FFFF00",
"= c #DEDEE6",
"- c #D6DEE6",
"; c #D6D6DE",
": c #CED6E6",
"> c None",
", c #C5D6E6",
"< c #C5CEE6",
"1 c #B5CEEF",
"2 c #C5C5C5",
"3 c #C5DE31",
"4 c #B5C5DE",
"5 c #BDC5C5",
"6 c #ADC5EF",
"7 c #B5C5CE",
"8 c #BDBDBD",
"9 c #B5BDCE",
"0 c #ADBDDE",
"q c #ADBDD6",
"w c #B5CE52",
"e c #ADB5C5",
"r c #00FFFF",
"t c #A5B5C5",
"y c #9CB5CE",
"u c #94B5DE",
"i c #9CADD6",
"p c #A5ADB5",
"a c #94ADDE",
"s c #94ADD6",
"d c #9CADBD",
"f c #8CADDE",
"g c #BD9CA5",
"h c #9CA5BD",
"j c #9CA5B5",
"k c #29D6E6",
"l c #8CA5CE",
"z c #849CCE",
"x c #6BA5C5",
"c c #739CDE",
"v c #00FF00",
"b c #739CD6",
"n c #7B94CE",
"m c #8494AD",
"M c #7394CE",
"N c #7B94B5",
"B c #4AB584",
"V c #848CB5",
"C c #6B94CE",
"Z c #6394D6",
"A c #6394CE",
"S c #7B8CAD",
"D c #6B8CC5",
"F c #738CAD",
"G c #5294B5",
"H c #6B84C5",
"J c #7384A5",
"K c #73849C",
"L c #738494",
"P c #FF4A4A",
"I c #FF4A42",
"U c #737B8C",
"Y c #637BAD",
"T c #527BBD",
"R c #637394",
"E c #637352",
"W c #5A6B8C",
"Q c #526B9C",
"! c #63638C",
"~ c #5A734A",
"^ c #4A6B9C",
"/ c #526B63",
"( c #0884A5",
") c #526384",
"_ c #52637B",
"` c #4A6B5A",
"' c #52636B",
"] c #525A8C",
"[ c #525A7B",
"{ c #426363",
"} c #4A5A7B",
"| c #425A8C",
" . c #196B94",
".. c #3A5A8C",
"X. c #3A5A84",
"o. c #087B4A",
"O. c #21636B",
"+. c #634263",
"@. c #3A527B",
"#. c #424A84",
"$. c #315284",
"%. c #295284",
"&. c #3A4A6B",
"*. c #42427B",
"=. c #424273",
"-. c #294A84",
";. c #3A3A73",
":. c #194284",
">. c #104A63",
",. c #213A6B",
"<. c #31316B",
"1. c #21315A",
"2. c #212163",
"3. c #08295A",
"4. c #082152",
"5. c #101952",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > U $.| | ^ S 2 > p W | | @.L > > > > ",
"8 5 R - < Y j S O - ) g e > > ",
"! V K - % a Q # - +.P <.> > ",
"! & K - 0 z n D C b f n n z q +.P <.> > ",
"! & K - % M A 1 - %.G #.> > ",
"! & K - % u b # - o.v >.> > ",
"! & K - 0 z n H M b 6 z n z q o.v >.> > ",
"! & K - X - M A a - O.B @.> > ",
"! & K - X % u b # - ` 3 / > > ",
"! & K - 0 l i 4 u b # - ~ * E > > ",
"! & K - X o $ s T b # - { w ' > > ",
"! & K - % f b # - .k -.> > ",
"! & K m d t 7 , u b # ; 9 9 h ( r :.> > ",
"! & h _ _ [ &.4.$.A ,.1.} _ _ F x ] > > ",
"! @ , y N _ 3._ N y , @ ! > > ",
"*.*.*.*.*.*.*.*.;.5.*.*.*.*.*.*.*.2.> > ",
"> > > > > > > > > > > > > > > > > > > > ",
"> > > > > > > > > > > > > > > > > > > > "
};

View File

@@ -1,41 +1,41 @@
/* XPM */
static const char * check_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c #008000",
". c #00FF00",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX . XXXXXXXXXXX",
"XXXXXXXXXXXXXXXX .. XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX . XXXXXXXXXXXX",
"XXXXXXXXXXXXXXX .. XXXXXXXXXXXXX",
"XXXXXXXXXXX XX . XXXXXXXXXXXXX",
"XXXXXXXXXXX . .. XXXXXXXXXXXXXX",
"XXXXXXXXXXX .. . XXXXXXXXXXXXXX",
"XXXXXXXXXXXX ... XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXX . XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};
/* XPM */
static const char * check_xpm[] = {
/* columns rows colors chars-per-pixel */
"32 32 3 1",
" c #008000",
". c #00FF00",
"X c None",
/* pixels */
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXX . XXXXXXXXXXX",
"XXXXXXXXXXXXXXXX .. XXXXXXXXXXXX",
"XXXXXXXXXXXXXXXX . XXXXXXXXXXXX",
"XXXXXXXXXXXXXXX .. XXXXXXXXXXXXX",
"XXXXXXXXXXX XX . XXXXXXXXXXXXX",
"XXXXXXXXXXX . .. XXXXXXXXXXXXXX",
"XXXXXXXXXXX .. . XXXXXXXXXXXXXX",
"XXXXXXXXXXXX ... XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXX . XXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXX XXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
};

View File

@@ -1,278 +1,278 @@
/* XPM */
static const char * send16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k i ",
"l O ; ; ; ; ; < a f b 0 j k t : ",
"l k k k k k k k s j 7 j k q = X ",
"X $ = = = = = k g 7 j k 9 & X X ",
"X X X X X X X k 2 j k 6 $ X X X ",
"X X X X X X X k j k 5 + X X X X ",
"X X X X X X X k k 1 + X X X X X ",
"X X X X X X X = , X X X X X X X "
};
/* XPM */
static const char * send16_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k i ",
"l O ; ; ; ; ; < a f b 0 j k t : ",
"l k k k k k k k s j 7 j k q = X ",
"X $ = = = = = k g 7 j k 9 & X X ",
"X X X X X X X k 2 j k 6 $ X X X ",
"X X X X X X X k j k 5 + X X X X ",
"X X X X X X X k k 1 + X X X X X ",
"X X X X X X X = , X X X X X X X "
};

View File

@@ -1,278 +1,278 @@
/* XPM */
static const char * send16noshadow_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k X ",
"l O ; ; ; ; ; < a f b 0 j k X X ",
"l k k k k k k k s j 7 j k X X X ",
"X X X X X X X k g 7 j k X X X X ",
"X X X X X X X k 2 j k X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k k X X X X X X X ",
"X X X X X X X X X X X X X X X X "
};
/* XPM */
static const char * send16noshadow_xpm[] = {
/* columns rows colors chars-per-pixel */
"16 16 256 2",
" c #ADF7AD",
". c #9CFF9C",
"X c None",
"o c #ADEFAD",
"O c #94FF94",
"+ c #D6CECE",
"@ c #8CFF8C",
"# c #CECECE",
"$ c #CECEC5",
"% c #84FF84",
"& c #CEC5C5",
"* c #73FF73",
"= c #C5C5C5",
"- c #6BFF6B",
"; c #73F773",
": c #C5BDBD",
"> c #6BF76B",
", c #BDBDBD",
"< c #63F763",
"1 c #B5B5B5",
"2 c #52F752",
"3 c #42FF42",
"4 c #3AFF3A",
"5 c #ADADAD",
"6 c #ADADA5",
"7 c #4AEF4A",
"8 c #29FF29",
"9 c #A5A5A5",
"0 c #42E642",
"q c #9CA59C",
"w c #3AE63A",
"e c #10FF10",
"r c #08FF08",
"t c #949C94",
"y c #00FF00",
"u c #00F700",
"i c #8C948C",
"p c #00EF00",
"a c #08E608",
"s c #10DE10",
"d c #00E600",
"f c #00DE00",
"g c #19C519",
"h c #00CE00",
"j c #00C500",
"k c #008C00",
"l c #008400",
"z c #669900",
"x c #999900",
"c c #CC9900",
"v c #FF9900",
"b c #00CC00",
"n c #33CC00",
"m c #66CC00",
"M c #99CC00",
"N c #CCCC00",
"B c #FFCC00",
"V c #66FF00",
"C c #99FF00",
"Z c #CCFF00",
"A c #000033",
"S c #330033",
"D c #660033",
"F c #990033",
"G c #CC0033",
"H c #FF0033",
"J c #003333",
"K c #333333",
"L c #663333",
"P c #993333",
"I c #CC3333",
"U c #FF3333",
"Y c #006633",
"T c #336633",
"R c #666633",
"E c #996633",
"W c #CC6633",
"Q c #FF6633",
"! c #009933",
"~ c #339933",
"^ c #669933",
"/ c #999933",
"( c #CC9933",
") c #FF9933",
"_ c #00CC33",
"` c #33CC33",
"' c #66CC33",
"] c #99CC33",
"[ c #CCCC33",
"{ c #FFCC33",
"} c #33FF33",
"| c #66FF33",
" . c #99FF33",
".. c #CCFF33",
"X. c #FFFF33",
"o. c #000066",
"O. c #330066",
"+. c #660066",
"@. c #990066",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"X X X X X X X k k X X X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k o j k X X X X X ",
"X X X X X X X k * o j k X X X X ",
"l k k k k k k k * * . j k X X X ",
"l @ @ @ @ @ @ @ 4 e e % j k X X ",
"l O 3 8 e r r r r r r e ; j k X ",
"l @ e e r r r r r u p a f < j k ",
"l @ r u p a a a a a f f w j k X ",
"l O ; ; ; ; ; < a f b 0 j k X X ",
"l k k k k k k k s j 7 j k X X X ",
"X X X X X X X k g 7 j k X X X X ",
"X X X X X X X k 2 j k X X X X X ",
"X X X X X X X k j k X X X X X X ",
"X X X X X X X k k X X X X X X X ",
"X X X X X X X X X X X X X X X X "
};

View File

@@ -1,282 +1,282 @@
/* XPM */
static const char * send20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #CEFFCE",
". c #BDFFBD",
"X c #C5F7C5",
"o c #B5FFB5",
"O c #ADFFAD",
"+ c #A5FFA5",
"@ c #9CFF9C",
"# c None",
"$ c #94FF94",
"% c #D6CECE",
"& c #8CFF8C",
"* c #CECEC5",
"= c #84FF84",
"- c #94EF94",
"; c #7BFF7B",
": c #CEC5C5",
"> c #73FF73",
", c #C5C5C5",
"< c #C5C5BD",
"1 c #6BFF6B",
"2 c #BDC5B5",
"3 c #63FF63",
"4 c #6BF76B",
"5 c #BDBDBD",
"6 c #BDBDB5",
"7 c #5AFF5A",
"8 c #63F763",
"9 c #B5BDB5",
"0 c #B5BDAD",
"q c #52FF52",
"w c #BDB5B5",
"e c #5AF75A",
"r c #B5B5B5",
"t c #B5B5AD",
"y c #52F752",
"u c #42FF42",
"i c #52EF52",
"p c #ADADAD",
"a c #ADADA5",
"s c #4AEF4A",
"d c #31FF31",
"f c #29FF29",
"g c #A5A5A5",
"h c #21FF21",
"j c #5AD65A",
"k c #42E642",
"l c #94AD94",
"z c #4ADE4A",
"x c #3AE63A",
"c c #5ACE5A",
"v c #10FF10",
"b c #9C9C9C",
"n c #31E631",
"m c #08FF08",
"M c #949C94",
"N c #84A584",
"B c #00FF00",
"V c #3AD63A",
"C c #52C552",
"Z c #00F700",
"A c #8C948C",
"S c #849484",
"D c #00EF00",
"F c #739C73",
"G c #08E608",
"H c #4AB54A",
"J c #31C531",
"K c #00E600",
"L c #739473",
"P c #00DE00",
"I c #63945A",
"U c #6B8C6B",
"Y c #00D600",
"T c #42A542",
"R c #638C63",
"E c #00CE00",
"W c #21B521",
"Q c #5A8C5A",
"! c #00C500",
"~ c #528C52",
"^ c #3A9C3A",
"/ c #4A8C4A",
"( c #00BD00",
") c #319431",
"_ c #219C21",
"` c #318C31",
"' c #3A843A",
"] c #219421",
"[ c #298C29",
"{ c #318431",
"} c #218C21",
"| c #218C19",
" . c #198C19",
".. c #218421",
"X. c #297B29",
"o. c #198419",
"O. c #217B21",
"+. c #108410",
"@. c #197B19",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"# # # # # # # # # # # # # # # # # # # # ",
"# # # # # # # ` 0 # # # # # # # # # # # ",
"# # # # # # # ..` l # # # # # # # # # # ",
"# # # # # # # [ X ) N # # # # # # # # # ",
"# # # # # # # [ &X. ^ F # # # # # # # # ",
"# # # # # # # } o & o T I : # # # # # # ",
"` ` ` ` ` ` ` ` + 7 ; + H ~ < # # # # # ",
"` = = = = = = - @ d v h $ C ' 5 # # # # ",
"` = = 3 u h v v v m m m v ; c { 6 # # # ",
"` = f v v m m m m m m Z G G 4 j ..t # # ",
"` = v m m m Z Z D D G G G P n ; _ R 5 # ",
"` = m Z G G G G G G G P Y x 4 _ Q g # # ",
"` = $ $ $ $ $ & e P P E k 8 .U g # # # ",
"..[ ......[ [ ] e Y ! s i o.L p # # # # ",
"# # 5 6 6 6 9 ..i ( i z o.S t # # # # # ",
"# # # # # # # } i i V O.A r # # # # # # ",
"# # # # # # # } 7 J X.M 6 # # # # # # # ",
"# # # # # # # | W ' b < # # # # # # # # ",
"# # # # # # # @.~ g , # # # # # # # # # ",
"# # # # # # # 6 < , # # # # # # # # # # "
};
/* XPM */
static const char * send20_xpm[] = {
/* columns rows colors chars-per-pixel */
"20 20 256 2",
" c #CEFFCE",
". c #BDFFBD",
"X c #C5F7C5",
"o c #B5FFB5",
"O c #ADFFAD",
"+ c #A5FFA5",
"@ c #9CFF9C",
"# c None",
"$ c #94FF94",
"% c #D6CECE",
"& c #8CFF8C",
"* c #CECEC5",
"= c #84FF84",
"- c #94EF94",
"; c #7BFF7B",
": c #CEC5C5",
"> c #73FF73",
", c #C5C5C5",
"< c #C5C5BD",
"1 c #6BFF6B",
"2 c #BDC5B5",
"3 c #63FF63",
"4 c #6BF76B",
"5 c #BDBDBD",
"6 c #BDBDB5",
"7 c #5AFF5A",
"8 c #63F763",
"9 c #B5BDB5",
"0 c #B5BDAD",
"q c #52FF52",
"w c #BDB5B5",
"e c #5AF75A",
"r c #B5B5B5",
"t c #B5B5AD",
"y c #52F752",
"u c #42FF42",
"i c #52EF52",
"p c #ADADAD",
"a c #ADADA5",
"s c #4AEF4A",
"d c #31FF31",
"f c #29FF29",
"g c #A5A5A5",
"h c #21FF21",
"j c #5AD65A",
"k c #42E642",
"l c #94AD94",
"z c #4ADE4A",
"x c #3AE63A",
"c c #5ACE5A",
"v c #10FF10",
"b c #9C9C9C",
"n c #31E631",
"m c #08FF08",
"M c #949C94",
"N c #84A584",
"B c #00FF00",
"V c #3AD63A",
"C c #52C552",
"Z c #00F700",
"A c #8C948C",
"S c #849484",
"D c #00EF00",
"F c #739C73",
"G c #08E608",
"H c #4AB54A",
"J c #31C531",
"K c #00E600",
"L c #739473",
"P c #00DE00",
"I c #63945A",
"U c #6B8C6B",
"Y c #00D600",
"T c #42A542",
"R c #638C63",
"E c #00CE00",
"W c #21B521",
"Q c #5A8C5A",
"! c #00C500",
"~ c #528C52",
"^ c #3A9C3A",
"/ c #4A8C4A",
"( c #00BD00",
") c #319431",
"_ c #219C21",
"` c #318C31",
"' c #3A843A",
"] c #219421",
"[ c #298C29",
"{ c #318431",
"} c #218C21",
"| c #218C19",
" . c #198C19",
".. c #218421",
"X. c #297B29",
"o. c #198419",
"O. c #217B21",
"+. c #108410",
"@. c #197B19",
"#. c #CC0066",
"$. c #FF0066",
"%. c #003366",
"&. c #333366",
"*. c #663366",
"=. c #993366",
"-. c #CC3366",
";. c #FF3366",
":. c #006666",
">. c #336666",
",. c #666666",
"<. c #996666",
"1. c #CC6666",
"2. c #009966",
"3. c #339966",
"4. c #669966",
"5. c #999966",
"6. c #CC9966",
"7. c #FF9966",
"8. c #00CC66",
"9. c #33CC66",
"0. c #99CC66",
"q. c #CCCC66",
"w. c #FFCC66",
"e. c #00FF66",
"r. c #33FF66",
"t. c #99FF66",
"y. c #CCFF66",
"u. c #FF00CC",
"i. c #CC00FF",
"p. c #009999",
"a. c #993399",
"s. c #990099",
"d. c #CC0099",
"f. c #000099",
"g. c #333399",
"h. c #660099",
"j. c #CC3399",
"k. c #FF0099",
"l. c #006699",
"z. c #336699",
"x. c #663399",
"c. c #996699",
"v. c #CC6699",
"b. c #FF3399",
"n. c #339999",
"m. c #669999",
"M. c #999999",
"N. c #CC9999",
"B. c #FF9999",
"V. c #00CC99",
"C. c #33CC99",
"Z. c #66CC66",
"A. c #99CC99",
"S. c #CCCC99",
"D. c #FFCC99",
"F. c #00FF99",
"G. c #33FF99",
"H. c #66CC99",
"J. c #99FF99",
"K. c #CCFF99",
"L. c #FFFF99",
"P. c #0000CC",
"I. c #330099",
"U. c #6600CC",
"Y. c #9900CC",
"T. c #CC00CC",
"R. c #003399",
"E. c #3333CC",
"W. c #6633CC",
"Q. c #9933CC",
"!. c #CC33CC",
"~. c #FF33CC",
"^. c #0066CC",
"/. c #3366CC",
"(. c #666699",
"). c #9966CC",
"_. c #CC66CC",
"`. c #FF6699",
"'. c #0099CC",
"]. c #3399CC",
"[. c #6699CC",
"{. c #9999CC",
"}. c #CC99CC",
"|. c #FF99CC",
" X c #00CCCC",
".X c #33CCCC",
"XX c #66CCCC",
"oX c #99CCCC",
"OX c #CCCCCC",
"+X c #FFCCCC",
"@X c #00FFCC",
"#X c #33FFCC",
"$X c #66FF99",
"%X c #99FFCC",
"&X c #CCFFCC",
"*X c #FFFFCC",
"=X c #3300CC",
"-X c #6600FF",
";X c #9900FF",
":X c #0033CC",
">X c #3333FF",
",X c #6633FF",
"<X c #9933FF",
"1X c #CC33FF",
"2X c #FF33FF",
"3X c #0066FF",
"4X c #3366FF",
"5X c #6666CC",
"6X c #9966FF",
"7X c #CC66FF",
"8X c #FF66CC",
"9X c #0099FF",
"0X c #3399FF",
"qX c #6699FF",
"wX c #9999FF",
"eX c #CC99FF",
"rX c #FF99FF",
"tX c #00CCFF",
"yX c #33CCFF",
"uX c #66CCFF",
"iX c #99CCFF",
"pX c #CCCCFF",
"aX c #FFCCFF",
"sX c #33FFFF",
"dX c #66FFCC",
"fX c #99FFFF",
"gX c #CCFFFF",
"hX c #FF6666",
"jX c #66FF66",
"kX c #FFFF66",
"lX c #6666FF",
"zX c #FF66FF",
"xX c #66FFFF",
"cX c #A50021",
"vX c #5F5F5F",
"bX c #777777",
"nX c #868686",
"mX c #969696",
"MX c #CBCBCB",
"NX c #B2B2B2",
"BX c #D7D7D7",
"VX c #DDDDDD",
"CX c #E3E3E3",
"ZX c #EAEAEA",
"AX c #F1F1F1",
"SX c #F8F8F8",
"DX c #FFFBF0",
"FX c #A0A0A4",
"GX c #808080",
"HX c #FF0000",
"JX c #00FF00",
"KX c #FFFF00",
"LX c #0000FF",
"PX c #FF00FF",
"IX c #00FFFF",
"UX c #FFFFFF",
/* pixels */
"# # # # # # # # # # # # # # # # # # # # ",
"# # # # # # # ` 0 # # # # # # # # # # # ",
"# # # # # # # ..` l # # # # # # # # # # ",
"# # # # # # # [ X ) N # # # # # # # # # ",
"# # # # # # # [ &X. ^ F # # # # # # # # ",
"# # # # # # # } o & o T I : # # # # # # ",
"` ` ` ` ` ` ` ` + 7 ; + H ~ < # # # # # ",
"` = = = = = = - @ d v h $ C ' 5 # # # # ",
"` = = 3 u h v v v m m m v ; c { 6 # # # ",
"` = f v v m m m m m m Z G G 4 j ..t # # ",
"` = v m m m Z Z D D G G G P n ; _ R 5 # ",
"` = m Z G G G G G G G P Y x 4 _ Q g # # ",
"` = $ $ $ $ $ & e P P E k 8 .U g # # # ",
"..[ ......[ [ ] e Y ! s i o.L p # # # # ",
"# # 5 6 6 6 9 ..i ( i z o.S t # # # # # ",
"# # # # # # # } i i V O.A r # # # # # # ",
"# # # # # # # } 7 J X.M 6 # # # # # # # ",
"# # # # # # # | W ' b < # # # # # # # # ",
"# # # # # # # @.~ g , # # # # # # # # # ",
"# # # # # # # 6 < , # # # # # # # # # # "
};