├── ver1.0.1 ├── contrib ├── debian │ ├── compat │ ├── patches │ │ ├── series │ │ └── README │ ├── source │ │ └── format │ ├── speedcoind.install │ ├── speedcoind.examples │ ├── speedcoind.bash-completion │ ├── speedcoind.manpages │ ├── gbp.conf │ ├── speedcoind.lintian-overrides │ ├── speedcoin-qt.lintian-overrides │ ├── speedcoin-qt.protocol │ ├── speedcoin-qt.install │ ├── speedcoin-qt.desktop.desktop │ ├── watch │ ├── README │ └── rules ├── testgen │ └── README ├── macdeploy │ ├── background.png │ ├── background.psd │ ├── fancy.plist │ └── notes.txt ├── gitian-downloader │ ├── sipa-key.pgp │ ├── tcatm-key.pgp │ ├── bluematt-key.pgp │ ├── devrandom-key.pgp │ ├── luke-jr-key.pgp │ ├── gavinandresen-key.pgp │ ├── aspect-key.pgp │ ├── linux-download-config │ ├── win32-download-config │ ├── laanwj-key.pgp │ └── thrasher-key.pgp ├── wallettools │ ├── walletunlock.py │ └── walletchangepass.py ├── pyminer │ ├── README │ └── example-config.cfg ├── test-patches │ └── README ├── spendfrom │ ├── setup.py │ └── README ├── seeds │ ├── README │ └── makeseeds.py ├── qt_translations.py ├── gitian-descriptors │ ├── gitian.yml │ └── boost-linux.yml └── tidy_datadir.sh ├── src ├── obj │ └── .gitignore ├── obj-test │ └── .gitignore ├── qt │ ├── res │ │ ├── icons │ │ │ ├── add.png │ │ │ ├── edit.png │ │ │ ├── key.png │ │ │ ├── quit.png │ │ │ ├── send.png │ │ │ ├── clock1.png │ │ │ ├── clock2.png │ │ │ ├── clock3.png │ │ │ ├── clock4.png │ │ │ ├── clock5.png │ │ │ ├── export.png │ │ │ ├── history.png │ │ │ ├── qrcode.png │ │ │ ├── receive.png │ │ │ ├── remove.png │ │ │ ├── synced.png │ │ │ ├── toolbar.png │ │ │ ├── configure.png │ │ │ ├── editcopy.png │ │ │ ├── editpaste.png │ │ │ ├── filesave.png │ │ │ ├── lock_open.png │ │ │ ├── notsynced.png │ │ │ ├── overview.png │ │ │ ├── speedcoin.ico │ │ │ ├── speedcoin.png │ │ │ ├── tx_inout.png │ │ │ ├── tx_input.png │ │ │ ├── tx_mined.png │ │ │ ├── tx_output.png │ │ │ ├── address-book.png │ │ │ ├── connect0_16.png │ │ │ ├── connect1_16.png │ │ │ ├── connect2_16.png │ │ │ ├── connect3_16.png │ │ │ ├── connect4_16.png │ │ │ ├── debugwindow.png │ │ │ ├── lock_closed.png │ │ │ ├── speedcoin.icns │ │ │ ├── transaction0.png │ │ │ ├── transaction2.png │ │ │ ├── speedcoin_testnet.ico │ │ │ ├── speedcoin_testnet.png │ │ │ └── toolbar_testnet.png │ │ ├── images │ │ │ ├── about.png │ │ │ ├── splash.png │ │ │ └── splash_testnet.png │ │ ├── movies │ │ │ └── update_spinner.mng │ │ └── speedcoin-qt.rc │ ├── test │ │ ├── uritests.h │ │ └── test_main.cpp │ ├── coincontroltreewidget.h │ ├── splashscreen.h │ ├── aboutdialog.h │ ├── transactiondesc.h │ ├── macnotificationhandler.h │ ├── bitcoinaddressvalidator.h │ ├── transactiondescdialog.cpp │ ├── transactiondescdialog.h │ ├── qvaluecombobox.cpp │ ├── qvalidatedlineedit.h │ ├── qrcodedialog.h │ ├── coincontroltreewidget.cpp │ ├── monitoreddatamapper.h │ ├── qvaluecombobox.h │ ├── qvalidatedlineedit.cpp │ ├── csvmodelwriter.h │ ├── macdockiconhandler.h │ ├── monitoreddatamapper.cpp │ ├── guiconstants.h │ ├── editaddressdialog.h │ ├── aboutdialog.cpp │ ├── askpassphrasedialog.h │ ├── signverifymessagedialog.h │ ├── overviewpage.h │ ├── sendcoinsentry.h │ ├── transactionfilterproxy.h │ ├── bitcoinamountfield.h │ ├── optionsdialog.h │ ├── rpcconsole.h │ ├── forms │ │ └── transactiondescdialog.ui │ └── paymentserver.h ├── test │ ├── data │ │ ├── alertTests │ │ ├── base58_encode_decode.json │ │ └── sig_canonical.json │ ├── uint160_tests.cpp │ ├── uint256_tests.cpp │ ├── base32_tests.cpp │ ├── base64_tests.cpp │ ├── README │ ├── Checkpoints_tests.cpp │ ├── scrypt_tests.cpp │ ├── sigopcount_tests.cpp │ ├── compress_tests.cpp │ ├── test_bitcoin.cpp │ └── checkblock_tests.cpp ├── leveldb │ ├── .gitignore │ ├── AUTHORS │ ├── util │ │ ├── filter_policy.cc │ │ ├── hash.h │ │ ├── options.cc │ │ ├── histogram.h │ │ ├── mutexlock.h │ │ ├── hash.cc │ │ ├── crc32c.h │ │ ├── testutil.cc │ │ ├── logging.h │ │ ├── arena_test.cc │ │ ├── testutil.h │ │ ├── testharness.cc │ │ ├── crc32c_test.cc │ │ ├── arena.h │ │ ├── logging.cc │ │ ├── status.cc │ │ └── arena.cc │ ├── port │ │ ├── README │ │ ├── port.h │ │ ├── win │ │ │ └── stdint.h │ │ ├── thread_annotations.h │ │ └── port_posix.cc │ ├── NEWS │ ├── TODO │ ├── helpers │ │ └── memenv │ │ │ └── memenv.h │ ├── db │ │ ├── db_iter.h │ │ ├── log_format.h │ │ ├── builder.h │ │ ├── log_writer.h │ │ ├── version_edit_test.cc │ │ ├── write_batch_internal.h │ │ ├── snapshot.h │ │ └── table_cache.h │ ├── table │ │ ├── merger.h │ │ ├── block.h │ │ ├── two_level_iterator.h │ │ ├── iterator.cc │ │ └── block_builder.h │ ├── WINDOWS.md │ ├── doc │ │ └── doc.css │ ├── LICENSE │ ├── README │ └── include │ │ └── leveldb │ │ └── write_batch.h ├── json │ ├── json_spirit_value.cpp │ ├── json_spirit.h │ ├── LICENSE.txt │ ├── json_spirit_error_position.h │ ├── json_spirit_utils.h │ ├── json_spirit_writer.h │ └── json_spirit_stream_reader.h ├── init.h ├── clientversion.h ├── checkpoints.h ├── coincontrol.h ├── scrypt.h ├── hash.cpp ├── noui.cpp ├── version.h ├── compat.h └── txdb.h ├── .gitattributes ├── share ├── pixmaps │ ├── check.ico │ ├── favicon.ico │ ├── send16.bmp │ ├── send20.bmp │ ├── send16mask.bmp │ ├── send20mask.bmp │ ├── speedcoin.ico │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── speedcoin-bc.ico │ ├── speedcoin128.png │ ├── speedcoin16.png │ ├── speedcoin256.png │ ├── speedcoin32.png │ ├── speedcoin64.png │ ├── addressbook16.bmp │ ├── addressbook20.bmp │ ├── addressbook16mask.bmp │ ├── addressbook20mask.bmp │ └── send16masknoshadow.bmp ├── qt │ ├── img │ │ └── reload.xcf │ ├── make_windows_icon.sh │ ├── clean_mac_info_plist.py │ ├── make_spinner.py │ ├── Info.plist │ └── extract_strings_qt.py ├── ui.rc └── genbuild.sh ├── doc ├── bitcoin_logo_doxygen.png ├── release-notes.md ├── files.txt ├── unit-tests.md ├── README_windows.txt ├── README.md └── build-unix.md ├── .gitignore ├── INSTALL └── COPYING /ver1.0.1: -------------------------------------------------------------------------------- 1 | ver 1.0.1 -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /contrib/debian/patches/series: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/obj/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | src/version.cpp export-subst 2 | -------------------------------------------------------------------------------- /contrib/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /src/obj-test/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /contrib/debian/speedcoind.install: -------------------------------------------------------------------------------- 1 | src/speedcoind usr/bin 2 | -------------------------------------------------------------------------------- /contrib/debian/speedcoind.examples: -------------------------------------------------------------------------------- 1 | debian/examples/speedcoin.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/speedcoind.bash-completion: -------------------------------------------------------------------------------- 1 | contrib/speedcoind.bash-completion speedcoind 2 | -------------------------------------------------------------------------------- /contrib/testgen/README: -------------------------------------------------------------------------------- 1 | Utilities to generate test vectors for the data-driven Speedcoin tests 2 | -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/qt/img/reload.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/qt/img/reload.xcf -------------------------------------------------------------------------------- /contrib/debian/speedcoind.manpages: -------------------------------------------------------------------------------- 1 | debian/manpages/speedcoind.1 2 | debian/manpages/speedcoin.conf.5 3 | -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/add.png -------------------------------------------------------------------------------- /src/qt/res/icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/edit.png -------------------------------------------------------------------------------- /src/qt/res/icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/key.png -------------------------------------------------------------------------------- /src/qt/res/icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/quit.png -------------------------------------------------------------------------------- /src/qt/res/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/send.png -------------------------------------------------------------------------------- /src/test/data/alertTests: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/test/data/alertTests -------------------------------------------------------------------------------- /doc/bitcoin_logo_doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/doc/bitcoin_logo_doxygen.png -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/speedcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin.ico -------------------------------------------------------------------------------- /src/qt/res/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/clock1.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/clock2.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/clock3.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/clock4.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/clock5.png -------------------------------------------------------------------------------- /src/qt/res/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/export.png -------------------------------------------------------------------------------- /src/qt/res/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/history.png -------------------------------------------------------------------------------- /src/qt/res/icons/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/qrcode.png -------------------------------------------------------------------------------- /src/qt/res/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/receive.png -------------------------------------------------------------------------------- /src/qt/res/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/remove.png -------------------------------------------------------------------------------- /src/qt/res/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/synced.png -------------------------------------------------------------------------------- /src/qt/res/icons/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/toolbar.png -------------------------------------------------------------------------------- /src/qt/res/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/images/about.png -------------------------------------------------------------------------------- /src/qt/res/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/images/splash.png -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /share/pixmaps/speedcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/speedcoin128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin128.png -------------------------------------------------------------------------------- /share/pixmaps/speedcoin16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin16.png -------------------------------------------------------------------------------- /share/pixmaps/speedcoin256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin256.png -------------------------------------------------------------------------------- /share/pixmaps/speedcoin32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin32.png -------------------------------------------------------------------------------- /share/pixmaps/speedcoin64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/speedcoin64.png -------------------------------------------------------------------------------- /src/qt/res/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/configure.png -------------------------------------------------------------------------------- /src/qt/res/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/editcopy.png -------------------------------------------------------------------------------- /src/qt/res/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/editpaste.png -------------------------------------------------------------------------------- /src/qt/res/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/filesave.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/icons/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/overview.png -------------------------------------------------------------------------------- /src/qt/res/icons/speedcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/speedcoin.ico -------------------------------------------------------------------------------- /src/qt/res/icons/speedcoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/speedcoin.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/tx_output.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/macdeploy/background.psd -------------------------------------------------------------------------------- /share/pixmaps/addressbook16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/address-book.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/debugwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/debugwindow.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/icons/speedcoin.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/speedcoin.icns -------------------------------------------------------------------------------- /src/qt/res/icons/transaction0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/transaction0.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/transaction2.png -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /contrib/gitian-downloader/sipa-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/sipa-key.pgp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/speedcoin_testnet.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/speedcoin_testnet.ico -------------------------------------------------------------------------------- /src/qt/res/icons/speedcoin_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/speedcoin_testnet.png -------------------------------------------------------------------------------- /src/qt/res/icons/toolbar_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/icons/toolbar_testnet.png -------------------------------------------------------------------------------- /src/qt/res/images/splash_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/images/splash_testnet.png -------------------------------------------------------------------------------- /src/qt/res/movies/update_spinner.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/src/qt/res/movies/update_spinner.mng -------------------------------------------------------------------------------- /contrib/gitian-downloader/tcatm-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/tcatm-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/bluematt-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/bluematt-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/devrandom-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/devrandom-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/luke-jr-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/luke-jr-key.pgp -------------------------------------------------------------------------------- /contrib/debian/gbp.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for git-buildpackage and friends 2 | 3 | [DEFAULT] 4 | pristine-tar = True 5 | sign-tags = True 6 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/gavinandresen-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/Speedcoin/master/contrib/gitian-downloader/gavinandresen-key.pgp -------------------------------------------------------------------------------- /contrib/debian/speedcoind.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | speedcoind: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/debian/speedcoin-qt.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | speedcoin-qt: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/debian/patches/README: -------------------------------------------------------------------------------- 1 | 0xxx: Grabbed from upstream development. 2 | 1xxx: Possibly relevant for upstream adoption. 3 | 2xxx: Only relevant for official Debian release. 4 | -------------------------------------------------------------------------------- /src/leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | leveldbutil 10 | Release 11 | Debug 12 | Benchmark 13 | vs2010.* 14 | -------------------------------------------------------------------------------- /contrib/wallettools/walletunlock.py: -------------------------------------------------------------------------------- 1 | from jsonrpc import ServiceProxy 2 | access = ServiceProxy("http://127.0.0.1:24776") 3 | pwd = raw_input("Enter wallet passphrase: ") 4 | access.walletpassphrase(pwd, 60) 5 | -------------------------------------------------------------------------------- /contrib/pyminer/README: -------------------------------------------------------------------------------- 1 | 2 | This is a 'getwork' CPU mining client for bitcoin. 3 | 4 | It is pure-python, and therefore very, very slow. The purpose is to 5 | provide a reference implementation of a miner, for study. 6 | 7 | -------------------------------------------------------------------------------- /contrib/debian/speedcoin-qt.protocol: -------------------------------------------------------------------------------- 1 | [Protocol] 2 | exec=speedcoin-qt '%u' 3 | protocol=speedcoin 4 | input=none 5 | output=none 6 | helper=true 7 | listing= 8 | reading=false 9 | writing=false 10 | makedir=false 11 | deleting=false 12 | -------------------------------------------------------------------------------- /contrib/test-patches/README: -------------------------------------------------------------------------------- 1 | These patches are applied when the automated pull-tester 2 | tests each pull and when master is tested using jenkins. 3 | You can find more information about the tests run at 4 | http://jenkins.bluematt.me/pull-tester/files/ 5 | -------------------------------------------------------------------------------- /src/json/json_spirit_value.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2007 John W Wilkinson 2 | 3 | This source code can be used for any purpose as long as 4 | this comment is retained. */ 5 | 6 | // json spirit version 2.00 7 | 8 | #include "json_spirit_value.h" 9 | -------------------------------------------------------------------------------- /contrib/wallettools/walletchangepass.py: -------------------------------------------------------------------------------- 1 | from jsonrpc import ServiceProxy 2 | access = ServiceProxy("http://127.0.0.1:24776") 3 | pwd = raw_input("Enter old wallet passphrase: ") 4 | pwd2 = raw_input("Enter new wallet passphrase: ") 5 | access.walletpassphrasechange(pwd, pwd2) 6 | -------------------------------------------------------------------------------- /src/qt/test/uritests.h: -------------------------------------------------------------------------------- 1 | #ifndef URITESTS_H 2 | #define URITESTS_H 3 | 4 | #include 5 | #include 6 | 7 | class URITests : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | private slots: 12 | void uriTests(); 13 | }; 14 | 15 | #endif // URITESTS_H 16 | -------------------------------------------------------------------------------- /contrib/debian/speedcoin-qt.install: -------------------------------------------------------------------------------- 1 | speedcoin-qt usr/bin 2 | share/pixmaps/speedcoin32.xpm usr/share/pixmaps 3 | share/pixmaps/speedcoin16.xpm usr/share/pixmaps 4 | share/pixmaps/speedcoin128.png usr/share/pixmaps 5 | debian/speedcoin-qt.desktop usr/share/applications 6 | debian/speedcoin-qt.protocol usr/share/kde4/services/ 7 | -------------------------------------------------------------------------------- /src/leveldb/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | 10 | # Partial list of contributors: 11 | Kevin Regan 12 | -------------------------------------------------------------------------------- /contrib/debian/speedcoin-qt.desktop.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=Speedcoin 4 | Comment=Speedcoin P2P Cryptocurrency 5 | Exec=/usr/bin/speedcoin-qt %u 6 | Terminal=false 7 | Type=Application 8 | Icon=/usr/share/pixmaps/speedcoin128.png 9 | MimeType=x-scheme-handler/bitcoin; 10 | Categories=Office; 11 | Name[en_US]=speedcoin-qt.desktop 12 | -------------------------------------------------------------------------------- /contrib/spendfrom/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | setup(name='btcspendfrom', 3 | version='1.0', 4 | description='Command-line utility for bitcoin "coin control"', 5 | author='Gavin Andresen', 6 | author_email='gavin@bitcoinfoundation.org', 7 | requires=['jsonrpc'], 8 | scripts=['spendfrom.py'], 9 | ) 10 | -------------------------------------------------------------------------------- /src/qt/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "uritests.h" 5 | 6 | // This is all you need to run all the tests 7 | int main(int argc, char *argv[]) 8 | { 9 | bool fInvalid = false; 10 | 11 | URITests test1; 12 | if (QTest::qExec(&test1) != 0) 13 | fInvalid = true; 14 | 15 | return fInvalid; 16 | } 17 | -------------------------------------------------------------------------------- /src/leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /share/qt/make_windows_icon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # create multiresolution windows icon 3 | ICON_SRC=../../src/qt/res/icons/speedcoin.png 4 | ICON_DST=../../src/qt/res/icons/speedcoin.ico 5 | convert ${ICON_SRC} -resize 16x16 speedcoin-16.png 6 | convert ${ICON_SRC} -resize 32x32 speedcoin-32.png 7 | convert ${ICON_SRC} -resize 48x48 speedcoin-48.png 8 | convert speedcoin-16.png speedcoin-32.png speedcoin-48.png ${ICON_DST} 9 | 10 | -------------------------------------------------------------------------------- /src/qt/coincontroltreewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROLTREEWIDGET_H 2 | #define COINCONTROLTREEWIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class CoinControlTreeWidget : public QTreeWidget { 8 | Q_OBJECT 9 | 10 | public: 11 | explicit CoinControlTreeWidget(QWidget *parent = 0); 12 | 13 | protected: 14 | virtual void keyPressEvent(QKeyEvent *event); 15 | }; 16 | 17 | #endif // COINCONTROLTREEWIDGET_H -------------------------------------------------------------------------------- /src/test/uint160_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "uint256.h" 4 | 5 | BOOST_AUTO_TEST_SUITE(uint160_tests) 6 | 7 | BOOST_AUTO_TEST_CASE(uint160_equality) 8 | { 9 | uint160 num1 = 10; 10 | uint160 num2 = 11; 11 | BOOST_CHECK(num1+1 == num2); 12 | 13 | uint64 num3 = 10; 14 | BOOST_CHECK(num1 == num3); 15 | BOOST_CHECK(num1+num2 == num3+num2); 16 | } 17 | 18 | BOOST_AUTO_TEST_SUITE_END() 19 | -------------------------------------------------------------------------------- /src/test/uint256_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "uint256.h" 4 | 5 | BOOST_AUTO_TEST_SUITE(uint256_tests) 6 | 7 | BOOST_AUTO_TEST_CASE(uint256_equality) 8 | { 9 | uint256 num1 = 10; 10 | uint256 num2 = 11; 11 | BOOST_CHECK(num1+1 == num2); 12 | 13 | uint64 num3 = 10; 14 | BOOST_CHECK(num1 == num3); 15 | BOOST_CHECK(num1+num2 == num3+num2); 16 | } 17 | 18 | BOOST_AUTO_TEST_SUITE_END() 19 | -------------------------------------------------------------------------------- /contrib/debian/watch: -------------------------------------------------------------------------------- 1 | # Run the "uscan" command to check for upstream updates and more. 2 | version=3 3 | # use qa.debian.org redirector; see man uscan 4 | opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/;s/\-src//,dversionmangle=s/~dfsg\d*// \ 5 | http://sf.net/bitcoin/bitcoin-(\d.*)-linux\.tar\.gz debian 6 | opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\d*// \ 7 | http://githubredir.debian.net/github/bitcoin/bitcoin v(.*).tar.gz 8 | -------------------------------------------------------------------------------- /src/leveldb/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /contrib/pyminer/example-config.cfg: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # RPC login details 4 | # 5 | host=127.0.0.1 6 | port=24776 7 | 8 | rpcuser=myusername 9 | rpcpass=mypass 10 | 11 | 12 | # 13 | # mining details 14 | # 15 | 16 | threads=4 17 | 18 | # periodic rate for requesting new work, if solution not found 19 | scantime=60 20 | 21 | 22 | # 23 | # misc. 24 | # 25 | 26 | # not really used right now 27 | logdir=/tmp/pyminer 28 | 29 | # set to 1, to enable hashmeter output 30 | hashmeter=0 31 | 32 | 33 | -------------------------------------------------------------------------------- /contrib/seeds/README: -------------------------------------------------------------------------------- 1 | Utility to generate the pnSeed[] array that is compiled into the client 2 | (see src/net.cpp). 3 | 4 | The 600 seeds compiled into the 0.8 release were created from bengt's DNS seed data, like this: 5 | 6 | curl -s http://p2pool2.etyd.org/seeds | head -1000 | ./makeseeds.py 7 | 8 | The input to makeseeds.py is assumed to be approximately sorted from most-reliable to least-reliable, 9 | with IP:port first on each line (lines that don't match IPv4:port are ignored). 10 | -------------------------------------------------------------------------------- /src/json/json_spirit.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT 2 | #define JSON_SPIRIT 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include "json_spirit_value.h" 14 | #include "json_spirit_reader.h" 15 | #include "json_spirit_writer.h" 16 | #include "json_spirit_utils.h" 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | src/*.exe 2 | src/speedcoin 3 | src/speedcoind 4 | src/test_speedcoin 5 | .*.swp 6 | *.*~* 7 | *.bak 8 | *.rej 9 | *.orig 10 | *.o 11 | *.patch 12 | 13 | # Compilation and Qt preprocessor part 14 | *.qm 15 | speedcoin-qt 16 | Speedcoin-Qt.app 17 | 18 | # Unit-tests 19 | Makefile.test 20 | speedcoin-qt_test 21 | 22 | # Resources cpp 23 | qrc_*.cpp 24 | 25 | # Qt creator 26 | *.pro.user 27 | 28 | # Mac specific 29 | .DS_Store 30 | build 31 | Info 32 | Speedcoin-Qt.xcodeproj 33 | 34 | 35 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building Speedcoin 2 | 3 | See doc/readme-qt.rst for instructions on building Speedcoin-Qt, 4 | the intended-for-end-users, nice-graphical-interface, reference 5 | implementation of Speedcoin. 6 | 7 | See doc/build-*.txt for instructions on building speedcoind, 8 | the intended-for-services, no-graphical-interface, reference 9 | implementation of Speedcoin. 10 | 11 | Further build information and documentation is available at 12 | the official Speedcoin website, http://www.speedcoin.co 13 | -------------------------------------------------------------------------------- /src/test/data/base58_encode_decode.json: -------------------------------------------------------------------------------- 1 | [ 2 | ["", ""], 3 | ["61", "2g"], 4 | ["626262", "a3gV"], 5 | ["636363", "aPEr"], 6 | ["73696d706c792061206c6f6e6720737472696e67", "2cFupjhnEsSn59qHXstmK2ffpLv2"], 7 | ["00eb15231dfceb60925886b67d065299925915aeb172c06647", "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"], 8 | ["516b6fcd0f", "ABnLTmg"], 9 | ["bf4f89001e670274dd", "3SEo3LWLoPntC"], 10 | ["572e4794", "3EFU7m"], 11 | ["ecac89cad93923c02321", "EJDM8drfXA6uyA"], 12 | ["10c8511e", "Rt5zm"], 13 | ["00000000000000000000", "1111111111"] 14 | ] 15 | -------------------------------------------------------------------------------- /src/test/data/sig_canonical.json: -------------------------------------------------------------------------------- 1 | [ 2 | "300602010002010001", 3 | "3008020200ff020200ff01", 4 | "304402203932c892e2e550f3af8ee4ce9c215a87f9bb831dcac87b2838e2c2eaa891df0c022030b61dd36543125d56b9f9f3a1f9353189e5af33cdda8d77a5209aec03978fa001", 5 | "30450220076045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01", 6 | "3046022100876045be6f9eca28ff1ec606b833d0b87e70b2a630f5e3a496b110967a40f90a0221008fffd599910eefe00bc803c688c2eca1d2ba7f6b180620eaa03488e6585db6ba01" 7 | ] 8 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef BITCOIN_INIT_H 6 | #define BITCOIN_INIT_H 7 | 8 | #include "wallet.h" 9 | 10 | extern CWallet* pwalletMain; 11 | 12 | void StartShutdown(); 13 | bool ShutdownRequested(); 14 | void Shutdown(); 15 | bool AppInit2(boost::thread_group& threadGroup); 16 | std::string HelpMessage(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /src/leveldb/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /src/leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /doc/release-notes.md: -------------------------------------------------------------------------------- 1 | 1.0.1.0 changes 2 | ============= 3 | Mac and Windows Official Gitian Builds: upgrade to openssl-1.0.1g for CVE-2014-0160 Linux was not vulnerable with Lucid openssl-0.9.8k Older versions were only vulnerable with rarely used RPC SSL 4 | If you build from source, be sure that your openssl is patched for CVE-2014-0160. 5 | Upgrade openssl, qt, miniupnpc, zlib, libpng, qrencode 6 | Merge Litecoin 0.8.7.1 7 | Many bug fixes from Bitcoin 0.8.7rc stable branch including transaction malleability mitigation backports from 0.9 8 | 9 | 10 | 1.0.0.0 changes 11 | ============= 12 | 13 | - Initial Release 14 | -------------------------------------------------------------------------------- /src/leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /src/qt/splashscreen.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef SPLASHSCREEN_H 6 | #define SPLASHSCREEN_H 7 | 8 | #include 9 | 10 | /** class for the splashscreen with information of the running client 11 | */ 12 | class SplashScreen : public QSplashScreen 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit SplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0); 18 | }; 19 | 20 | #endif // SPLASHSCREEN_H 21 | -------------------------------------------------------------------------------- /contrib/debian/README: -------------------------------------------------------------------------------- 1 | This directory contains files used to package speedcoind/speedcoin-qt 2 | for Debian-based Linux systems. 3 | 4 | If you compile speedcoind/speedcoin-qt yourself, there are some 5 | useful files here: 6 | 7 | speedcoin: URI support 8 | -------------------- 9 | 10 | speedcoin-qt.desktop (Gnome / Open Desktop) 11 | To install: 12 | sudo desktop-file-install speedcoin-qt.desktop 13 | sudo update-desktop-database 14 | 15 | If you build yourself, you will either need to modify the paths in 16 | the .desktop file or copy or symlink your speedcoin-qt binary to /usr/bin 17 | and the ../../share/pixmaps/speedcoin128.png to /usr/share/pixmaps 18 | 19 | speedcoin-qt.protocol (KDE) 20 | 21 | -------------------------------------------------------------------------------- /contrib/qt_translations.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Helpful little script that spits out a comma-separated list of 4 | # language codes for Qt icons that should be included 5 | # in binary bitcoin distributions 6 | 7 | import glob 8 | import os 9 | import re 10 | import sys 11 | 12 | if len(sys.argv) != 3: 13 | sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.argv[0]) 14 | 15 | d1 = sys.argv[1] 16 | d2 = sys.argv[2] 17 | 18 | l1 = set([ re.search(r'qt_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d1, 'qt_*.qm')) ]) 19 | l2 = set([ re.search(r'bitcoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'bitcoin_*.qm')) ]) 20 | 21 | print ",".join(sorted(l1.intersection(l2))) 22 | 23 | -------------------------------------------------------------------------------- /src/test/base32_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "util.h" 4 | 5 | BOOST_AUTO_TEST_SUITE(base32_tests) 6 | 7 | BOOST_AUTO_TEST_CASE(base32_testvectors) 8 | { 9 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 10 | static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"}; 11 | for (unsigned int i=0; i 2 | 3 | #include "main.h" 4 | #include "wallet.h" 5 | #include "util.h" 6 | 7 | BOOST_AUTO_TEST_SUITE(base64_tests) 8 | 9 | BOOST_AUTO_TEST_CASE(base64_testvectors) 10 | { 11 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 12 | static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"}; 13 | for (unsigned int i=0; i 9 | 10 | namespace Ui { 11 | class AboutDialog; 12 | } 13 | class ClientModel; 14 | 15 | /** "About" dialog box */ 16 | class AboutDialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit AboutDialog(QWidget *parent = 0); 22 | ~AboutDialog(); 23 | 24 | void setModel(ClientModel *model); 25 | 26 | private: 27 | Ui::AboutDialog *ui; 28 | 29 | private slots: 30 | void on_buttonBox_accepted(); 31 | }; 32 | 33 | #endif // ABOUTDIALOG_H 34 | -------------------------------------------------------------------------------- /src/qt/transactiondesc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef TRANSACTIONDESC_H 6 | #define TRANSACTIONDESC_H 7 | 8 | #include 9 | #include 10 | 11 | class CWallet; 12 | class CWalletTx; 13 | 14 | /** Provide a human-readable extended HTML description of a transaction. 15 | */ 16 | class TransactionDesc: public QObject 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | static QString toHTML(CWallet *wallet, CWalletTx &wtx); 22 | 23 | private: 24 | TransactionDesc() {} 25 | 26 | static QString FormatTxStatus(const CWalletTx& wtx); 27 | }; 28 | 29 | #endif // TRANSACTIONDESC_H 30 | -------------------------------------------------------------------------------- /src/qt/macnotificationhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MACNOTIFICATIONHANDLER_H 2 | #define MACNOTIFICATIONHANDLER_H 3 | #include 4 | 5 | /** Macintosh-specific notification handler (supports UserNotificationCenter and Growl). 6 | */ 7 | class MacNotificationHandler : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | /** shows a 10.8+ UserNotification in the UserNotificationCenter 13 | */ 14 | void showNotification(const QString &title, const QString &text); 15 | 16 | /** executes AppleScript */ 17 | void sendAppleScript(const QString &script); 18 | 19 | /** check if OS can handle UserNotifications */ 20 | bool hasUserNotificationCenterSupport(void); 21 | static MacNotificationHandler *instance(); 22 | }; 23 | 24 | 25 | #endif // MACNOTIFICATIONHANDLER_H 26 | -------------------------------------------------------------------------------- /src/leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /src/qt/bitcoinaddressvalidator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOINADDRESSVALIDATOR_H 6 | #define BITCOINADDRESSVALIDATOR_H 7 | 8 | #include 9 | 10 | /** Base58 entry widget validator. 11 | Corrects near-miss characters and refuses characters that are not part of base58. 12 | */ 13 | class BitcoinAddressValidator : public QValidator 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit BitcoinAddressValidator(QObject *parent = 0); 19 | 20 | State validate(QString &input, int &pos) const; 21 | 22 | static const int MaxAddressLength = 35; 23 | }; 24 | 25 | #endif // BITCOINADDRESSVALIDATOR_H 26 | -------------------------------------------------------------------------------- /src/qt/transactiondescdialog.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "transactiondescdialog.h" 6 | #include "ui_transactiondescdialog.h" 7 | 8 | #include "transactiontablemodel.h" 9 | 10 | #include 11 | 12 | TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *parent) : 13 | QDialog(parent), 14 | ui(new Ui::TransactionDescDialog) 15 | { 16 | ui->setupUi(this); 17 | QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString(); 18 | ui->detailText->setHtml(desc); 19 | } 20 | 21 | TransactionDescDialog::~TransactionDescDialog() 22 | { 23 | delete ui; 24 | } 25 | -------------------------------------------------------------------------------- /src/qt/transactiondescdialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef TRANSACTIONDESCDIALOG_H 6 | #define TRANSACTIONDESCDIALOG_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class TransactionDescDialog; 12 | } 13 | 14 | QT_BEGIN_NAMESPACE 15 | class QModelIndex; 16 | QT_END_NAMESPACE 17 | 18 | /** Dialog showing transaction details. */ 19 | class TransactionDescDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0); 25 | ~TransactionDescDialog(); 26 | 27 | private: 28 | Ui::TransactionDescDialog *ui; 29 | }; 30 | 31 | #endif // TRANSACTIONDESCDIALOG_H 32 | -------------------------------------------------------------------------------- /contrib/seeds/makeseeds.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Generate pnSeed[] from Bengt's DNS seeder 4 | # 5 | 6 | NSEEDS=600 7 | 8 | import re 9 | import sys 10 | from subprocess import check_output 11 | 12 | def main(): 13 | lines = sys.stdin.readlines() 14 | 15 | ips = [] 16 | pattern = re.compile(r"^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3}):24777") 17 | for line in lines: 18 | m = pattern.match(line) 19 | if m is None: 20 | continue 21 | ip = 0 22 | for i in range(0,4): 23 | ip = ip + (int(m.group(i+1)) << (8*(i))) 24 | if ip == 0: 25 | continue 26 | ips.append(ip) 27 | 28 | for row in range(0, min(NSEEDS,len(ips)), 6): 29 | print " " + ", ".join([ "0x%08x"%i for i in ips[row:row+6] ]) + "," 30 | 31 | if __name__ == '__main__': 32 | main() 33 | -------------------------------------------------------------------------------- /src/leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #elif defined(LEVELDB_PLATFORM_WINDOWS) 18 | # include "port/port_win.h" 19 | #endif 20 | 21 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 22 | -------------------------------------------------------------------------------- /contrib/macdeploy/fancy.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | window_bounds 6 | 7 | 300 8 | 300 9 | 800 10 | 620 11 | 12 | background_picture 13 | background.png 14 | icon_size 15 | 96 16 | applications_symlink 17 | 18 | items_position 19 | 20 | Applications 21 | 22 | 370 23 | 156 24 | 25 | Speedcoin-Qt.app 26 | 27 | 128 28 | 156 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/clientversion.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTVERSION_H 2 | #define CLIENTVERSION_H 3 | 4 | // 5 | // client versioning and copyright year 6 | // 7 | 8 | // These need to be macros, as version.cpp's and speedcoin-qt.rc's voodoo requires it 9 | #define CLIENT_VERSION_MAJOR 1 10 | #define CLIENT_VERSION_MINOR 0 11 | #define CLIENT_VERSION_REVISION 1 12 | #define CLIENT_VERSION_BUILD 0 13 | 14 | // Set to true for release, false for prerelease or test build 15 | #define CLIENT_VERSION_IS_RELEASE true 16 | 17 | // Copyright year (2009-this) 18 | // Todo: update this when changing our copyright comments in the source 19 | #define COPYRIGHT_YEAR 2014 20 | 21 | // Converts the parameter X to a string after macro replacement on X has been performed. 22 | // Don't merge these into one macro! 23 | #define STRINGIZE(X) DO_STRINGIZE(X) 24 | #define DO_STRINGIZE(X) #X 25 | 26 | #endif // CLIENTVERSION_H 27 | -------------------------------------------------------------------------------- /src/leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "qvaluecombobox.h" 6 | 7 | QValueComboBox::QValueComboBox(QWidget *parent) : 8 | QComboBox(parent), role(Qt::UserRole) 9 | { 10 | connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int))); 11 | } 12 | 13 | QVariant QValueComboBox::value() const 14 | { 15 | return itemData(currentIndex(), role); 16 | } 17 | 18 | void QValueComboBox::setValue(const QVariant &value) 19 | { 20 | setCurrentIndex(findData(value, role)); 21 | } 22 | 23 | void QValueComboBox::setRole(int role) 24 | { 25 | this->role = role; 26 | } 27 | 28 | void QValueComboBox::handleSelectionChanged(int idx) 29 | { 30 | emit valueChanged(); 31 | } 32 | -------------------------------------------------------------------------------- /src/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /src/qt/qvalidatedlineedit.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef QVALIDATEDLINEEDIT_H 6 | #define QVALIDATEDLINEEDIT_H 7 | 8 | #include 9 | 10 | /** Line edit that can be marked as "invalid" to show input validation feedback. When marked as invalid, 11 | it will get a red background until it is focused. 12 | */ 13 | class QValidatedLineEdit : public QLineEdit 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit QValidatedLineEdit(QWidget *parent = 0); 19 | void clear(); 20 | 21 | protected: 22 | void focusInEvent(QFocusEvent *evt); 23 | 24 | private: 25 | bool valid; 26 | 27 | public slots: 28 | void setValid(bool valid); 29 | 30 | private slots: 31 | void markValid(); 32 | }; 33 | 34 | #endif // QVALIDATEDLINEEDIT_H 35 | -------------------------------------------------------------------------------- /src/leveldb/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /src/qt/qrcodedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef QRCODEDIALOG_H 2 | #define QRCODEDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class QRCodeDialog; 9 | } 10 | class OptionsModel; 11 | 12 | class QRCodeDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent = 0); 18 | ~QRCodeDialog(); 19 | 20 | void setModel(OptionsModel *model); 21 | 22 | private slots: 23 | void on_lnReqAmount_textChanged(); 24 | void on_lnLabel_textChanged(); 25 | void on_lnMessage_textChanged(); 26 | void on_btnSaveAs_clicked(); 27 | void on_chkReqPayment_toggled(bool fChecked); 28 | 29 | void updateDisplayUnit(); 30 | 31 | private: 32 | Ui::QRCodeDialog *ui; 33 | OptionsModel *model; 34 | QString address; 35 | QImage myImage; 36 | 37 | void genCode(); 38 | QString getURI(); 39 | }; 40 | 41 | #endif // QRCODEDIALOG_H 42 | -------------------------------------------------------------------------------- /src/qt/coincontroltreewidget.cpp: -------------------------------------------------------------------------------- 1 | #include "coincontroltreewidget.h" 2 | #include "coincontroldialog.h" 3 | 4 | CoinControlTreeWidget::CoinControlTreeWidget(QWidget *parent) : 5 | QTreeWidget(parent) 6 | { 7 | 8 | } 9 | 10 | void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event) 11 | { 12 | if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox 13 | { 14 | event->ignore(); 15 | int COLUMN_CHECKBOX = 0; 16 | this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); 17 | } 18 | else if (event->key() == Qt::Key_Escape) // press esc -> close dialog 19 | { 20 | event->ignore(); 21 | CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget(); 22 | coinControlDialog->done(QDialog::Accepted); 23 | } 24 | else 25 | { 26 | this->QTreeWidget::keyPressEvent(event); 27 | } 28 | } -------------------------------------------------------------------------------- /src/leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /share/genbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -gt 0 ]; then 4 | FILE="$1" 5 | shift 6 | if [ -f "$FILE" ]; then 7 | INFO="$(head -n 1 "$FILE")" 8 | fi 9 | else 10 | echo "Usage: $0 " 11 | exit 1 12 | fi 13 | 14 | if [ -e "$(which git)" ]; then 15 | # clean 'dirty' status of touched files that haven't been modified 16 | git diff >/dev/null 2>/dev/null 17 | 18 | # get a string like "v0.6.0-66-g59887e8-dirty" 19 | # DESC="$(git describe --dirty 2>/dev/null)" 20 | DESC="$(git describe --abbrev=0 2>/dev/null)" 21 | 22 | # get a string like "2012-04-10 16:27:19 +0200" 23 | TIME="$(date '+%F %T %z')" 24 | fi 25 | 26 | if [ -n "$DESC" ]; then 27 | NEWINFO="#define BUILD_DESC \"$DESC\"" 28 | else 29 | NEWINFO="// No build information available" 30 | fi 31 | 32 | # only update build.h if necessary 33 | if [ "$INFO" != "$NEWINFO" ]; then 34 | echo "$NEWINFO" >"$FILE" 35 | echo "#define BUILD_DATE \"$TIME\"" >>"$FILE" 36 | fi 37 | -------------------------------------------------------------------------------- /src/checkpoints.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2012 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_CHECKPOINT_H 5 | #define BITCOIN_CHECKPOINT_H 6 | 7 | #include 8 | 9 | class uint256; 10 | class CBlockIndex; 11 | 12 | /** Block-chain checkpoints are compiled-in sanity checks. 13 | * They are updated every release or three. 14 | */ 15 | namespace Checkpoints 16 | { 17 | // Returns true if block passes checkpoint checks 18 | bool CheckBlock(int nHeight, const uint256& hash); 19 | 20 | // Return conservative estimate of total number of blocks, 0 if unknown 21 | int GetTotalBlocksEstimate(); 22 | 23 | // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint 24 | CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex); 25 | 26 | double GuessVerificationProgress(CBlockIndex *pindex); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /share/qt/clean_mac_info_plist.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Jonas Schnelli, 2013 3 | # make sure the Speedcoin-Qt.app contains the right plist (including the right version) 4 | # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) 5 | 6 | from string import Template 7 | from datetime import date 8 | 9 | bitcoinDir = "./"; 10 | 11 | inFile = bitcoinDir+"/share/qt/Info.plist" 12 | outFile = "Speedcoin-Qt.app/Contents/Info.plist" 13 | version = "unknown"; 14 | 15 | fileForGrabbingVersion = bitcoinDir+"speedcoin-qt.pro" 16 | for line in open(fileForGrabbingVersion): 17 | lineArr = line.replace(" ", "").split("="); 18 | if lineArr[0].startswith("VERSION"): 19 | version = lineArr[1].replace("\n", ""); 20 | 21 | fIn = open(inFile, "r") 22 | fileContent = fIn.read() 23 | s = Template(fileContent) 24 | newFileContent = s.substitute(VERSION=version,YEAR=date.today().year) 25 | 26 | fOut = open(outFile, "w"); 27 | fOut.write(newFileContent); 28 | 29 | print "Info.plist fresh created" -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- mode: makefile; coding: utf-8 -*- 3 | 4 | #DEB_MAKE_CHECK_TARGET = test_speedcoin 5 | #build/speedcoind:: 6 | # $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_speedcoin) 7 | 8 | DEB_INSTALL_EXAMPLES_speedcoind += debian/examples/* 9 | DEB_INSTALL_MANPAGES_speedcoind += debian/manpages/* 10 | 11 | %: 12 | dh --with bash-completion $@ 13 | 14 | override_dh_auto_build: 15 | cd src; $(MAKE) -f makefile.unix speedcoind 16 | $(MAKE) 17 | 18 | override_dh_auto_clean: 19 | if [ -f Makefile ]; then $(MAKE) clean; else rm -rf build/; rm -f speedcoin-qt; fi 20 | cd src; $(MAKE) -f makefile.unix clean 21 | 22 | override_dh_auto_configure: 23 | qmake speedcoin-qt.pro USE_QRCODE=1 24 | 25 | override_dh_auto_test: 26 | cd src; $(MAKE) -f makefile.unix test_speedcoin 27 | src/test_speedcoin 28 | 29 | # Ensure wrapper is set executable 30 | binary-post-install/speedcoind: 31 | chmod +x $(cdbs_curdestdir)usr/bin/speedcoind 32 | binary-post-install/speedcoin-qt: 33 | chmod +x $(cdbs_curdestdir)usr/bin/speedcoin-qt 34 | -------------------------------------------------------------------------------- /src/leveldb/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.txt for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), type (1 byte), length (2 bytes). 30 | static const int kHeaderSize = 4 + 1 + 2; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /src/qt/monitoreddatamapper.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef MONITOREDDATAMAPPER_H 6 | #define MONITOREDDATAMAPPER_H 7 | 8 | #include 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QWidget; 12 | QT_END_NAMESPACE 13 | 14 | /** Data to Widget mapper that watches for edits and notifies listeners when a field is edited. 15 | This can be used, for example, to enable a commit/apply button in a configuration dialog. 16 | */ 17 | class MonitoredDataMapper : public QDataWidgetMapper 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit MonitoredDataMapper(QObject *parent=0); 23 | 24 | void addMapping(QWidget *widget, int section); 25 | void addMapping(QWidget *widget, int section, const QByteArray &propertyName); 26 | 27 | private: 28 | void addChangeMonitor(QWidget *widget); 29 | 30 | signals: 31 | void viewModified(); 32 | }; 33 | 34 | #endif // MONITOREDDATAMAPPER_H 35 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef QVALUECOMBOBOX_H 6 | #define QVALUECOMBOBOX_H 7 | 8 | #include 9 | #include 10 | 11 | /* QComboBox that can be used with QDataWidgetMapper to select ordinal values from a model. */ 12 | class QValueComboBox : public QComboBox 13 | { 14 | Q_OBJECT 15 | 16 | Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) 17 | 18 | public: 19 | explicit QValueComboBox(QWidget *parent = 0); 20 | 21 | QVariant value() const; 22 | void setValue(const QVariant &value); 23 | 24 | /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */ 25 | void setRole(int role); 26 | 27 | signals: 28 | void valueChanged(); 29 | 30 | private: 31 | int role; 32 | 33 | private slots: 34 | void handleSelectionChanged(int idx); 35 | }; 36 | 37 | #endif // QVALUECOMBOBOX_H 38 | -------------------------------------------------------------------------------- /src/leveldb/util/histogram.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 6 | #define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 7 | 8 | #include 9 | 10 | namespace leveldb { 11 | 12 | class Histogram { 13 | public: 14 | Histogram() { } 15 | ~Histogram() { } 16 | 17 | void Clear(); 18 | void Add(double value); 19 | void Merge(const Histogram& other); 20 | 21 | std::string ToString() const; 22 | 23 | private: 24 | double min_; 25 | double max_; 26 | double num_; 27 | double sum_; 28 | double sum_squares_; 29 | 30 | enum { kNumBuckets = 154 }; 31 | static const double kBucketLimit[kNumBuckets]; 32 | double buckets_[kNumBuckets]; 33 | 34 | double Median() const; 35 | double Percentile(double p) const; 36 | double Average() const; 37 | double StandardDeviation() const; 38 | }; 39 | 40 | } // namespace leveldb 41 | 42 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 43 | -------------------------------------------------------------------------------- /doc/files.txt: -------------------------------------------------------------------------------- 1 | Used in 0.8.0: 2 | * wallet.dat: personal wallet (BDB) with keys and transactions 3 | * peers.dat: peer IP address database (custom format); since 0.7.0 4 | * blocks/blk000??.dat: block data (custom, 128 MiB per file); since 0.8.0 5 | * blocks/rev000??.dat; block undo data (custom); since 0.8.0 (format changed since pre-0.8) 6 | * blocks/index/*; block index (LevelDB); since 0.8.0 7 | * chainstate/*; block chain state database (LevelDB); since 0.8.0 8 | * database/*: BDB database environment; only used for wallet since 0.8.0 9 | 10 | Only used in pre-0.8.0: 11 | * blktree/*; block chain index (LevelDB); since pre-0.8, replaced by blocks/index/* in 0.8.0 12 | * coins/*; unspent transaction output database (LevelDB); since pre-0.8, replaced by chainstate/* in 0.8.0 13 | 14 | Only used before 0.8.0: 15 | * blkindex.dat: block chain index database (BDB); replaced by {chainstate/*,blocks/index/*,blocks/rev000??.dat} in 0.8.0 16 | * blk000?.dat: block data (custom, 2 GiB per file); replaced by blocks/blk000??.dat in 0.8.0 17 | 18 | Only used before 0.7.0: 19 | * addr.dat: peer IP address database (BDB); replaced by peers.dat in 0.7.0 20 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/aspect-key.pgp: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: GnuPG v1.4.13 (GNU/Linux) 3 | 4 | mQENBFHHt8wBCADfLkCS9624TrJ4pbFf5Cg88p0Sp7qofcPGjPa6K1Gs9cLfPHLu 5 | EX17YvS9zxdmdlogVDGQ3d82O2OrjDCr26yioZteHsK1oPdzgwQJ5tAGxlv75UiW 6 | BvhaDKXVfX+rdb+wnK3YMhynNQbG6pxQ0Q1Qujh6Xw0b1wbvg2FNEwpfHmL1ZoYd 7 | ba0w6eRmREBMrk50lp8pmDxWjc7+7SdKPxqWsPpWOJTaMBVQNSaVr7ePoCOKwFNI 8 | 7CQiqMlGJUG1Zb7CnEkbiwNSwEi0VQkz8Ir8gBFzCTEgt2K1EGO8yo0Mq0hNTRdW 9 | bC14pamlbu/+nx+LAefSJ9sMx7n/uzTjI1uTABEBAAG0LUFudG9uIFllbWVseWFu 10 | b3YgPGFudG9uLnllbWVseWFub3ZAZ21haWwuY29tPokBOQQTAQIAIwUCUce3zAIb 11 | DwcLCQgHAwIBBhUIAgkKCwQWAgMBAh4BAheAAAoJEKFZZWb4e+YxUwIIAM7DoCnv 12 | lJXX5+z9My0RBIpd99if1udXBVtVxPgaF7lDDIaKY2cBktyXBp/R/G8arYRc9zIK 13 | e+0bY+POpTrfMoTioqbiwoxPwhkXu39KwvPfSWY1UBQHTcMpFibMuFjRu6YrAEZ2 14 | ZH+CrLcmn6rB66uVm3OPE55sKdAL9C+TGIKU/GIRgQzI3S9/DT8E/F4Oifx/V9sh 15 | V2flIXU2QBH4ZOP0G+OTp6QXZRD9TBfmrYRMU+yL5sYMalCjwz79ZZua50CQI5hN 16 | 5pEBvHxZ4GziWc5V40GSv1RnM/mGgrdmBlzej34OLjfEac2PCrZy8+FnQf04Lhvn 17 | cRQpj+5V0a6RIfKIRgQQEQIABgUCUciczAAKCRBr3f6OVKKs8dqgAJ94zRvs99HM 18 | pItL1r8v8vS5lXZrHgCfXy5V7AFtL8XvZlPC0uQqdyWKzHo= 19 | =Bp2a 20 | -----END PGP PUBLIC KEY BLOCK----- 21 | -------------------------------------------------------------------------------- /src/json/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2007 - 2009 John W. Wilkinson 4 | 5 | Permission is hereby granted, free of charge, to any person 6 | obtaining a copy of this software and associated documentation 7 | files (the "Software"), to deal in the Software without 8 | restriction, including without limitation the rights to use, 9 | copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the 11 | Software is furnished to do so, subject to the following 12 | conditions: 13 | 14 | The above copyright notice and this permission notice shall be 15 | included in all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 18 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 19 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 21 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 22 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 24 | OTHER DEALINGS IN THE SOFTWARE. 25 | -------------------------------------------------------------------------------- /src/qt/qvalidatedlineedit.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "qvalidatedlineedit.h" 6 | 7 | #include "guiconstants.h" 8 | 9 | QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) : 10 | QLineEdit(parent), valid(true) 11 | { 12 | connect(this, SIGNAL(textChanged(QString)), this, SLOT(markValid())); 13 | } 14 | 15 | void QValidatedLineEdit::setValid(bool valid) 16 | { 17 | if(valid == this->valid) 18 | { 19 | return; 20 | } 21 | 22 | if(valid) 23 | { 24 | setStyleSheet(""); 25 | } 26 | else 27 | { 28 | setStyleSheet(STYLE_INVALID); 29 | } 30 | this->valid = valid; 31 | } 32 | 33 | void QValidatedLineEdit::focusInEvent(QFocusEvent *evt) 34 | { 35 | // Clear invalid flag on focus 36 | setValid(true); 37 | QLineEdit::focusInEvent(evt); 38 | } 39 | 40 | void QValidatedLineEdit::markValid() 41 | { 42 | setValid(true); 43 | } 44 | 45 | void QValidatedLineEdit::clear() 46 | { 47 | setValid(true); 48 | QLineEdit::clear(); 49 | } 50 | -------------------------------------------------------------------------------- /src/test/README: -------------------------------------------------------------------------------- 1 | The sources in this directory are unit test cases. Boost includes a 2 | unit testing framework, and since bitcoin already uses boost, it makes 3 | sense to simply use this framework rather than require developers to 4 | configure some other framework (we want as few impediments to creating 5 | unit tests as possible). 6 | 7 | The build system is setup to compile an executable called "test_bitcoin" 8 | that runs all of the unit tests. The main source file is called 9 | test_bitcoin.cpp, which simply includes other files that contain the 10 | actual unit tests (outside of a couple required preprocessor 11 | directives). The pattern is to create one test file for each class or 12 | source file for which you want to create unit tests. The file naming 13 | convention is "_tests.cpp" and such files should wrap 14 | their tests in a test suite called "_tests". For an 15 | examples of this pattern, examine uint160_tests.cpp and 16 | uint256_tests.cpp. 17 | 18 | For further reading, I found the following website to be helpful in 19 | explaining how the boost unit test framework works: 20 | 21 | http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/ 22 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2013 Bitcoin Developers 2 | Copyright (c) 2011-2013 Litecoin Developers 3 | Copyright (c) 2014 Speedcoin Developers 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /share/qt/make_spinner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # W.J. van der Laan, 2011 3 | # Make spinning .mng animation from a .png 4 | # Requires imagemagick 6.7+ 5 | from __future__ import division 6 | from os import path 7 | from PIL import Image 8 | from subprocess import Popen 9 | 10 | SRC='img/reload_scaled.png' 11 | DST='../../src/qt/res/movies/update_spinner.mng' 12 | TMPDIR='/tmp' 13 | TMPNAME='tmp-%03i.png' 14 | NUMFRAMES=35 15 | FRAMERATE=10.0 16 | CONVERT='convert' 17 | CLOCKWISE=True 18 | DSIZE=(16,16) 19 | 20 | im_src = Image.open(SRC) 21 | 22 | if CLOCKWISE: 23 | im_src = im_src.transpose(Image.FLIP_LEFT_RIGHT) 24 | 25 | def frame_to_filename(frame): 26 | return path.join(TMPDIR, TMPNAME % frame) 27 | 28 | frame_files = [] 29 | for frame in xrange(NUMFRAMES): 30 | rotation = (frame + 0.5) / NUMFRAMES * 360.0 31 | if CLOCKWISE: 32 | rotation = -rotation 33 | im_new = im_src.rotate(rotation, Image.BICUBIC) 34 | im_new.thumbnail(DSIZE, Image.ANTIALIAS) 35 | outfile = frame_to_filename(frame) 36 | im_new.save(outfile, 'png') 37 | frame_files.append(outfile) 38 | 39 | p = Popen([CONVERT, "-delay", str(FRAMERATE), "-dispose", "2"] + frame_files + [DST]) 40 | p.communicate() 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/leveldb/table/block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_H_ 7 | 8 | #include 9 | #include 10 | #include "leveldb/iterator.h" 11 | 12 | namespace leveldb { 13 | 14 | struct BlockContents; 15 | class Comparator; 16 | 17 | class Block { 18 | public: 19 | // Initialize the block with the specified contents. 20 | explicit Block(const BlockContents& contents); 21 | 22 | ~Block(); 23 | 24 | size_t size() const { return size_; } 25 | Iterator* NewIterator(const Comparator* comparator); 26 | 27 | private: 28 | uint32_t NumRestarts() const; 29 | 30 | const char* data_; 31 | size_t size_; 32 | uint32_t restart_offset_; // Offset in data_ of restart array 33 | bool owned_; // Block owns data_[] 34 | 35 | // No copying allowed 36 | Block(const Block&); 37 | void operator=(const Block&); 38 | 39 | class Iter; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_ 45 | -------------------------------------------------------------------------------- /doc/unit-tests.md: -------------------------------------------------------------------------------- 1 | Compiling/running speedcoind unit tests 2 | ------------------------------------ 3 | 4 | speedcoind unit tests are in the `src/test/` directory; they 5 | use the Boost::Test unit-testing framework. 6 | 7 | To compile and run the tests: 8 | 9 | cd src 10 | make -f makefile.unix test_speedcoin # Replace makefile.unix if you're not on unix 11 | ./test_speedcoin # Runs the unit tests 12 | 13 | If all tests succeed the last line of output will be: 14 | `*** No errors detected` 15 | 16 | To add more tests, add `BOOST_AUTO_TEST_CASE` functions to the existing 17 | .cpp files in the test/ directory or add new .cpp files that 18 | implement new BOOST_AUTO_TEST_SUITE sections (the makefiles are 19 | set up to add test/*.cpp to test_speedcoin automatically). 20 | 21 | 22 | Compiling/running Speedcoin-Qt unit tests 23 | --------------------------------------- 24 | 25 | Bitcoin-Qt unit tests are in the src/qt/test/ directory; they 26 | use the Qt unit-testing framework. 27 | 28 | To compile and run the tests: 29 | 30 | qmake speedcoin-qt.pro BITCOIN_QT_TEST=1 31 | make 32 | ./speedcoin-qt_test 33 | 34 | To add more tests, add them to the `src/qt/test/` directory, 35 | the `src/qt/test/test_main.cpp` file, and speedcoin-qt.pro. 36 | -------------------------------------------------------------------------------- /src/test/Checkpoints_tests.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Unit tests for block-chain checkpoints 3 | // 4 | #include // for 'map_list_of()' 5 | #include 6 | #include 7 | 8 | #include "../checkpoints.h" 9 | #include "../util.h" 10 | 11 | using namespace std; 12 | 13 | BOOST_AUTO_TEST_SUITE(Checkpoints_tests) 14 | 15 | BOOST_AUTO_TEST_CASE(sanity) 16 | { 17 | uint256 p1500 = uint256("0x841a2965955dd288cfa707a755d05a54e45f8bd476835ec9af4402a2b59a2967"); 18 | uint256 p120000 = uint256("0xbd9d26924f05f6daa7f0155f32828ec89e8e29cee9e7121b026a7a3552ac6131"); 19 | BOOST_CHECK(Checkpoints::CheckBlock(1500, p1500)); 20 | BOOST_CHECK(Checkpoints::CheckBlock(120000, p120000)); 21 | 22 | 23 | // Wrong hashes at checkpoints should fail: 24 | BOOST_CHECK(!Checkpoints::CheckBlock(1500, p120000)); 25 | BOOST_CHECK(!Checkpoints::CheckBlock(120000, p1500)); 26 | 27 | // ... but any hash not at a checkpoint should succeed: 28 | BOOST_CHECK(Checkpoints::CheckBlock(1500+1, p120000)); 29 | BOOST_CHECK(Checkpoints::CheckBlock(120000+1, p1500)); 30 | 31 | BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate() >= 120000); 32 | } 33 | 34 | BOOST_AUTO_TEST_SUITE_END() 35 | -------------------------------------------------------------------------------- /src/leveldb/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | extern Status BuildTable(const std::string& dbname, 26 | Env* env, 27 | const Options& options, 28 | TableCache* table_cache, 29 | Iterator* iter, 30 | FileMetaData* meta); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 35 | -------------------------------------------------------------------------------- /src/coincontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROL_H 2 | #define COINCONTROL_H 3 | 4 | /** Coin Control Features. */ 5 | class CCoinControl 6 | { 7 | public: 8 | CTxDestination destChange; 9 | 10 | CCoinControl() 11 | { 12 | SetNull(); 13 | } 14 | 15 | void SetNull() 16 | { 17 | destChange = CNoDestination(); 18 | setSelected.clear(); 19 | } 20 | 21 | bool HasSelected() const 22 | { 23 | return (setSelected.size() > 0); 24 | } 25 | 26 | bool IsSelected(const uint256& hash, unsigned int n) const 27 | { 28 | COutPoint outpt(hash, n); 29 | return (setSelected.count(outpt) > 0); 30 | } 31 | 32 | void Select(COutPoint& output) 33 | { 34 | setSelected.insert(output); 35 | } 36 | 37 | void UnSelect(COutPoint& output) 38 | { 39 | setSelected.erase(output); 40 | } 41 | 42 | void UnSelectAll() 43 | { 44 | setSelected.clear(); 45 | } 46 | 47 | void ListSelected(std::vector& vOutpoints) 48 | { 49 | vOutpoints.assign(setSelected.begin(), setSelected.end()); 50 | } 51 | 52 | private: 53 | std::set setSelected; 54 | 55 | }; 56 | 57 | #endif // COINCONTROL_H 58 | -------------------------------------------------------------------------------- /src/qt/csvmodelwriter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef CSVMODELWRITER_H 6 | #define CSVMODELWRITER_H 7 | 8 | #include 9 | #include 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QAbstractItemModel; 13 | QT_END_NAMESPACE 14 | 15 | /** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in 16 | a spreadsheet. 17 | */ 18 | class CSVModelWriter : public QObject 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit CSVModelWriter(const QString &filename, QObject *parent = 0); 24 | 25 | void setModel(const QAbstractItemModel *model); 26 | void addColumn(const QString &title, int column, int role=Qt::EditRole); 27 | 28 | /** Perform export of the model to CSV. 29 | @returns true on success, false otherwise 30 | */ 31 | bool write(); 32 | 33 | private: 34 | QString filename; 35 | const QAbstractItemModel *model; 36 | 37 | struct Column 38 | { 39 | QString title; 40 | int column; 41 | int role; 42 | }; 43 | QList columns; 44 | }; 45 | 46 | #endif // CSVMODELWRITER_H 47 | -------------------------------------------------------------------------------- /src/qt/macdockiconhandler.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef MACDOCKICONHANDLER_H 6 | #define MACDOCKICONHANDLER_H 7 | 8 | #include 9 | #include 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QMenu; 13 | class QIcon; 14 | class QWidget; 15 | QT_END_NAMESPACE 16 | 17 | #ifdef __OBJC__ 18 | @class DockIconClickEventHandler; 19 | #else 20 | class DockIconClickEventHandler; 21 | #endif 22 | 23 | /** Macintosh-specific dock icon handler. 24 | */ 25 | class MacDockIconHandler : public QObject 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | ~MacDockIconHandler(); 31 | 32 | QMenu *dockMenu(); 33 | void setIcon(const QIcon &icon); 34 | void setMainWindow(QMainWindow *window); 35 | static MacDockIconHandler *instance(); 36 | 37 | void handleDockIconClickEvent(); 38 | 39 | signals: 40 | void dockIconClicked(); 41 | 42 | private: 43 | MacDockIconHandler(); 44 | 45 | DockIconClickEventHandler *m_dockIconClickEventHandler; 46 | QWidget *m_dummyWidget; 47 | QMenu *m_dockMenu; 48 | QMainWindow *mainWindow; 49 | }; 50 | 51 | #endif // MACDOCKICONCLICKHANDLER_H 52 | -------------------------------------------------------------------------------- /share/qt/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIconFile 6 | speedcoin.icns 7 | CFBundlePackageType 8 | APPL 9 | CFBundleGetInfoString 10 | $VERSION, Copyright © $YEAR The Speedcoin developers 11 | CFBundleShortVersionString 12 | $VERSION 13 | CFBundleVersion 14 | $VERSION 15 | CFBundleSignature 16 | ???? 17 | CFBundleExecutable 18 | Speedcoin-Qt 19 | CFBundleIdentifier 20 | org.speedcoin.Speedcoin-Qt 21 | CFBundleURLTypes 22 | 23 | 24 | CFBundleTypeRole 25 | Editor 26 | CFBundleURLName 27 | org.speedcoin.SpeedcoinPayment 28 | CFBundleURLSchemes 29 | 30 | speedcoin 31 | 32 | 33 | 34 | NSHighResolutionCapable 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/leveldb/WINDOWS.md: -------------------------------------------------------------------------------- 1 | # Building LevelDB On Windows 2 | 3 | ## Prereqs 4 | 5 | Install the [Windows Software Development Kit version 7.1](http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b). 6 | 7 | Download and extract the [Snappy source distribution](http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz) 8 | 9 | 1. Open the "Windows SDK 7.1 Command Prompt" : 10 | Start Menu -> "Microsoft Windows SDK v7.1" > "Windows SDK 7.1 Command Prompt" 11 | 2. Change the directory to the leveldb project 12 | 13 | ## Building the Static lib 14 | 15 | * 32 bit Version 16 | 17 | setenv /x86 18 | msbuild.exe /p:Configuration=Release /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 19 | 20 | * 64 bit Version 21 | 22 | setenv /x64 23 | msbuild.exe /p:Configuration=Release /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 24 | 25 | 26 | ## Building and Running the Benchmark app 27 | 28 | * 32 bit Version 29 | 30 | setenv /x86 31 | msbuild.exe /p:Configuration=Benchmark /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 32 | Benchmark\leveldb.exe 33 | 34 | * 64 bit Version 35 | 36 | setenv /x64 37 | msbuild.exe /p:Configuration=Benchmark /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 38 | x64\Benchmark\leveldb.exe 39 | 40 | -------------------------------------------------------------------------------- /src/leveldb/util/mutexlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 6 | #define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 7 | 8 | #include "port/port.h" 9 | #include "port/thread_annotations.h" 10 | 11 | namespace leveldb { 12 | 13 | // Helper class that locks a mutex on construction and unlocks the mutex when 14 | // the destructor of the MutexLock object is invoked. 15 | // 16 | // Typical usage: 17 | // 18 | // void MyClass::MyMethod() { 19 | // MutexLock l(&mu_); // mu_ is an instance variable 20 | // ... some complex code, possibly with multiple return paths ... 21 | // } 22 | 23 | class SCOPED_LOCKABLE MutexLock { 24 | public: 25 | explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) 26 | : mu_(mu) { 27 | this->mu_->Lock(); 28 | } 29 | ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } 30 | 31 | private: 32 | port::Mutex *const mu_; 33 | // No copying allowed 34 | MutexLock(const MutexLock&); 35 | void operator=(const MutexLock&); 36 | }; 37 | 38 | } // namespace leveldb 39 | 40 | 41 | #endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 42 | -------------------------------------------------------------------------------- /doc/README_windows.txt: -------------------------------------------------------------------------------- 1 | Speedcoin 1.0.x 2 | 3 | Copyright (c) 2009-2013 Bitcoin Developers 4 | Copyright (c) 2011-2013 Litecoin Developers 5 | Copyright (c) 2014 Speedcoin Developers 6 | Distributed under the MIT/X11 software license, see the accompanying 7 | file COPYING or http://www.opensource.org/licenses/mit-license.php. 8 | This product includes software developed by the OpenSSL Project for use in 9 | the OpenSSL Toolkit (http://www.openssl.org/). This product includes 10 | cryptographic software written by Eric Young (eay@cryptsoft.com). 11 | 12 | 13 | Intro 14 | ----- 15 | Speedcoin is a free open source peer-to-peer electronic cash system that is 16 | completely decentralized, without the need for a central server or trusted 17 | parties. Users hold the crypto keys to their own money and transact directly 18 | with each other, with the help of a P2P network to check for double-spending. 19 | 20 | 21 | Setup 22 | ----- 23 | Unpack the files into a directory and run speedcoin-qt.exe. 24 | 25 | Speedcoin-Qt is the original Speedcoin client and it builds the backbone of the network. 26 | However, it downloads and stores the entire history of Speedcoin transactions; 27 | depending on the speed of your computer and network connection, the synchronization 28 | process can take anywhere from a few hours to a day or more. 29 | 30 | -------------------------------------------------------------------------------- /src/scrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRYPT_H 2 | #define SCRYPT_H 3 | #include 4 | #include 5 | 6 | static const int SCRYPT_SCRATCHPAD_SIZE = 131072 + 63; 7 | 8 | void scrypt_N_1_1_256(const char *input, char *output, unsigned char Nfactor); 9 | void scrypt_N_1_1_256_sp_generic(const char *input, char *output, char *scratchpad, unsigned char Nfactor); 10 | 11 | #if defined(USE_SSE2) 12 | extern void scrypt_detect_sse2(unsigned int cpuid_edx); 13 | void scrypt_N_1_1_256_sp_sse2(const char *input, char *output, char *scratchpad, unsigned char Nfactor); 14 | extern void (*scrypt_N_1_1_256_sp)(const char *input, char *output, char *scratchpad, unsigned char Nfactor); 15 | #endif 16 | 17 | void 18 | PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt, 19 | size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen); 20 | 21 | 22 | static inline uint32_t scrypt_le32dec(const void *pp) 23 | { 24 | const uint8_t *p = (uint8_t const *)pp; 25 | return ((uint32_t)(p[0]) + ((uint32_t)(p[1]) << 8) + 26 | ((uint32_t)(p[2]) << 16) + ((uint32_t)(p[3]) << 24)); 27 | } 28 | 29 | static inline void scrypt_le32enc(void *pp, uint32_t x) 30 | { 31 | uint8_t *p = (uint8_t *)pp; 32 | p[0] = x & 0xff; 33 | p[1] = (x >> 8) & 0xff; 34 | p[2] = (x >> 16) & 0xff; 35 | p[3] = (x >> 24) & 0xff; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /contrib/macdeploy/notes.txt: -------------------------------------------------------------------------------- 1 | 2 | macdeployqtplus works best on OS X Lion, for Snow Leopard you'd need to install 3 | Python 2.7 and make it your default Python installation. 4 | 5 | You will need the appscript package for the fancy disk image creation to work. 6 | Install it by invoking "sudo easy_install appscript". 7 | 8 | This script should be invoked in the target directory like this: 9 | $source_dir/contrib/macdeploy/macdeployqtplus Speedcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy $source_dir/contrib/macdeploy/fancy.plist -verbose 2 10 | 11 | During the process, the disk image window will pop up briefly where the fancy 12 | settings are applied. This is normal, please do not interfere. 13 | 14 | You can also set up Qt Creator for invoking the script. For this, go to the 15 | "Projects" tab on the left side, switch to "Run Settings" above and add a 16 | deploy configuration. Next add a deploy step choosing "Custom Process Step". 17 | Fill in the following. 18 | 19 | Enable custom process step: [x] 20 | Command: %{sourceDir}/contrib/macdeploy/macdeployqtplus 21 | Working directory: %{buildDir} 22 | Command arguments: Speedcoin-Qt.app -add-qt-tr da,de,es,hu,ru,uk,zh_CN,zh_TW -dmg -fancy %{sourceDir}/contrib/macdeploy/fancy.plist -verbose 2 23 | 24 | After that you can start the deployment process through the menu with 25 | Build -> Deploy Project "bitcoin-qt" 26 | 27 | -------------------------------------------------------------------------------- /src/leveldb/table/two_level_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 6 | #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 7 | 8 | #include "leveldb/iterator.h" 9 | 10 | namespace leveldb { 11 | 12 | struct ReadOptions; 13 | 14 | // Return a new two level iterator. A two-level iterator contains an 15 | // index iterator whose values point to a sequence of blocks where 16 | // each block is itself a sequence of key,value pairs. The returned 17 | // two-level iterator yields the concatenation of all key/value pairs 18 | // in the sequence of blocks. Takes ownership of "index_iter" and 19 | // will delete it when no longer needed. 20 | // 21 | // Uses a supplied function to convert an index_iter value into 22 | // an iterator over the contents of the corresponding block. 23 | extern Iterator* NewTwoLevelIterator( 24 | Iterator* index_iter, 25 | Iterator* (*block_function)( 26 | void* arg, 27 | const ReadOptions& options, 28 | const Slice& index_value), 29 | void* arg, 30 | const ReadOptions& options); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 35 | -------------------------------------------------------------------------------- /src/qt/monitoreddatamapper.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "monitoreddatamapper.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | MonitoredDataMapper::MonitoredDataMapper(QObject *parent) : 12 | QDataWidgetMapper(parent) 13 | { 14 | } 15 | 16 | void MonitoredDataMapper::addMapping(QWidget *widget, int section) 17 | { 18 | QDataWidgetMapper::addMapping(widget, section); 19 | addChangeMonitor(widget); 20 | } 21 | 22 | void MonitoredDataMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName) 23 | { 24 | QDataWidgetMapper::addMapping(widget, section, propertyName); 25 | addChangeMonitor(widget); 26 | } 27 | 28 | void MonitoredDataMapper::addChangeMonitor(QWidget *widget) 29 | { 30 | // Watch user property of widget for changes, and connect 31 | // the signal to our viewModified signal. 32 | QMetaProperty prop = widget->metaObject()->userProperty(); 33 | int signal = prop.notifySignalIndex(); 34 | int method = this->metaObject()->indexOfMethod("viewModified()"); 35 | if(signal != -1 && method != -1) 36 | { 37 | QMetaObject::connect(widget, signal, this, method); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/qt/guiconstants.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef GUICONSTANTS_H 6 | #define GUICONSTANTS_H 7 | 8 | /* Milliseconds between model updates */ 9 | static const int MODEL_UPDATE_DELAY = 250; 10 | 11 | /* AskPassphraseDialog -- Maximum passphrase length */ 12 | static const int MAX_PASSPHRASE_SIZE = 1024; 13 | 14 | /* BitcoinGUI -- Size of icons in status bar */ 15 | static const int STATUSBAR_ICONSIZE = 16; 16 | 17 | /* Invalid field background style */ 18 | #define STYLE_INVALID "background:#FF8080" 19 | 20 | /* Transaction list -- unconfirmed transaction */ 21 | #define COLOR_UNCONFIRMED QColor(128, 128, 128) 22 | /* Transaction list -- negative amount */ 23 | #define COLOR_NEGATIVE QColor(255, 0, 0) 24 | /* Transaction list -- bare address (without label) */ 25 | #define COLOR_BAREADDRESS QColor(140, 140, 140) 26 | 27 | /* Tooltips longer than this (in characters) are converted into rich text, 28 | so that they can be word-wrapped. 29 | */ 30 | static const int TOOLTIP_WRAP_THRESHOLD = 80; 31 | 32 | /* Maximum allowed URI length */ 33 | static const int MAX_URI_LENGTH = 255; 34 | 35 | /* QRCodeDialog -- size of exported QR Code image */ 36 | #define EXPORT_IMAGE_SIZE 256 37 | 38 | #endif // GUICONSTANTS_H 39 | -------------------------------------------------------------------------------- /src/qt/editaddressdialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef EDITADDRESSDIALOG_H 6 | #define EDITADDRESSDIALOG_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class EditAddressDialog; 12 | } 13 | class AddressTableModel; 14 | 15 | QT_BEGIN_NAMESPACE 16 | class QDataWidgetMapper; 17 | QT_END_NAMESPACE 18 | 19 | /** Dialog for editing an address and associated information. 20 | */ 21 | class EditAddressDialog : public QDialog 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | enum Mode { 27 | NewReceivingAddress, 28 | NewSendingAddress, 29 | EditReceivingAddress, 30 | EditSendingAddress 31 | }; 32 | 33 | explicit EditAddressDialog(Mode mode, QWidget *parent = 0); 34 | ~EditAddressDialog(); 35 | 36 | void setModel(AddressTableModel *model); 37 | void loadRow(int row); 38 | 39 | QString getAddress() const; 40 | void setAddress(const QString &address); 41 | 42 | public slots: 43 | void accept(); 44 | 45 | private: 46 | bool saveCurrentRow(); 47 | 48 | Ui::EditAddressDialog *ui; 49 | QDataWidgetMapper *mapper; 50 | Mode mode; 51 | AddressTableModel *model; 52 | 53 | QString address; 54 | }; 55 | 56 | #endif // EDITADDRESSDIALOG_H 57 | -------------------------------------------------------------------------------- /src/qt/aboutdialog.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "aboutdialog.h" 6 | #include "ui_aboutdialog.h" 7 | 8 | #include "clientmodel.h" 9 | #include "clientversion.h" 10 | 11 | // Copyright year (2009-this) 12 | // Todo: update this when changing our copyright comments in the source 13 | const int ABOUTDIALOG_COPYRIGHT_YEAR = 2014; 14 | 15 | AboutDialog::AboutDialog(QWidget *parent) : 16 | QDialog(parent), 17 | ui(new Ui::AboutDialog) 18 | { 19 | ui->setupUi(this); 20 | 21 | // Set current copyright year 22 | ui->copyrightLabel->setText(tr("Copyright") + QString(" © 2009-%1 ").arg(COPYRIGHT_YEAR) + tr("The Bitcoin developers") + QString("
") + tr("Copyright") + QString(" © ") + tr("2011-%1 The Litecoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR) + QString("
") + tr("Copyright") + QString(" © ") + tr("%1 The Speedcoin developers").arg(ABOUTDIALOG_COPYRIGHT_YEAR)); 23 | } 24 | 25 | void AboutDialog::setModel(ClientModel *model) 26 | { 27 | if(model) 28 | { 29 | ui->versionLabel->setText(model->formatFullVersion()); 30 | } 31 | } 32 | 33 | AboutDialog::~AboutDialog() 34 | { 35 | delete ui; 36 | } 37 | 38 | void AboutDialog::on_buttonBox_accepted() 39 | { 40 | close(); 41 | } 42 | -------------------------------------------------------------------------------- /contrib/spendfrom/README: -------------------------------------------------------------------------------- 1 | Use the raw transactions API to send coins received on a particular 2 | address (or addresses). 3 | 4 | Depends on jsonrpc 5 | 6 | Usage: 7 | 8 | spendfrom.py --from=FROMADDRESS1[,FROMADDRESS2] --to=TOADDRESS --amount=amount \ 9 | --fee=fee --datadir=/path/to/.bitcoin --testnet --dry_run 10 | 11 | With no arguments, outputs a list of amounts associated with addresses. 12 | 13 | With arguments, sends coins received by the FROMADDRESS addresses to the TOADDRESS. 14 | 15 | You may explictly specify how much fee to pay (a fee more than 1% of the amount 16 | will fail, though, to prevent bitcoin-losing accidents). Spendfrom may fail if 17 | it thinks the transaction would never be confirmed (if the amount being sent is 18 | too small, or if the transaction is too many bytes for the fee). 19 | 20 | If a change output needs to be created, the change will be sent to the last 21 | FROMADDRESS (if you specify just one FROMADDRESS, change will go back to it). 22 | 23 | If --datadir is not specified, the default datadir is used. 24 | 25 | The --dry_run option will just create and sign the the transaction and print 26 | the transaction data (as hexadecimal), instead of broadcasting it. 27 | 28 | If the transaction is created and broadcast successfully, a transaction id 29 | is printed. 30 | 31 | If this was a tool for end-users and not programmers, it would have much friendlier 32 | error-handling. 33 | -------------------------------------------------------------------------------- /src/qt/askpassphrasedialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef ASKPASSPHRASEDIALOG_H 6 | #define ASKPASSPHRASEDIALOG_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class AskPassphraseDialog; 12 | } 13 | class WalletModel; 14 | 15 | /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. 16 | */ 17 | class AskPassphraseDialog : public QDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | enum Mode { 23 | Encrypt, /**< Ask passphrase twice and encrypt */ 24 | Unlock, /**< Ask passphrase and unlock */ 25 | ChangePass, /**< Ask old passphrase + new passphrase twice */ 26 | Decrypt /**< Ask passphrase and decrypt wallet */ 27 | }; 28 | 29 | explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0); 30 | ~AskPassphraseDialog(); 31 | 32 | void accept(); 33 | 34 | void setModel(WalletModel *model); 35 | 36 | private: 37 | Ui::AskPassphraseDialog *ui; 38 | Mode mode; 39 | WalletModel *model; 40 | bool fCapsLock; 41 | 42 | private slots: 43 | void textChanged(); 44 | bool event(QEvent *event); 45 | bool eventFilter(QObject *object, QEvent *event); 46 | }; 47 | 48 | #endif // ASKPASSPHRASEDIALOG_H 49 | -------------------------------------------------------------------------------- /src/leveldb/db/log_writer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_ 6 | #define STORAGE_LEVELDB_DB_LOG_WRITER_H_ 7 | 8 | #include 9 | #include "db/log_format.h" 10 | #include "leveldb/slice.h" 11 | #include "leveldb/status.h" 12 | 13 | namespace leveldb { 14 | 15 | class WritableFile; 16 | 17 | namespace log { 18 | 19 | class Writer { 20 | public: 21 | // Create a writer that will append data to "*dest". 22 | // "*dest" must be initially empty. 23 | // "*dest" must remain live while this Writer is in use. 24 | explicit Writer(WritableFile* dest); 25 | ~Writer(); 26 | 27 | Status AddRecord(const Slice& slice); 28 | 29 | private: 30 | WritableFile* dest_; 31 | int block_offset_; // Current offset in block 32 | 33 | // crc32c values for all supported record types. These are 34 | // pre-computed to reduce the overhead of computing the crc of the 35 | // record type stored in the header. 36 | uint32_t type_crc_[kMaxRecordType + 1]; 37 | 38 | Status EmitPhysicalRecord(RecordType type, const char* ptr, size_t length); 39 | 40 | // No copying allowed 41 | Writer(const Writer&); 42 | void operator=(const Writer&); 43 | }; 44 | 45 | } // namespace log 46 | } // namespace leveldb 47 | 48 | #endif // STORAGE_LEVELDB_DB_LOG_WRITER_H_ 49 | -------------------------------------------------------------------------------- /src/leveldb/util/hash.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include 6 | #include "util/coding.h" 7 | #include "util/hash.h" 8 | 9 | // The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through 10 | // between switch labels. The real definition should be provided externally. 11 | // This one is a fallback version for unsupported compilers. 12 | #ifndef FALLTHROUGH_INTENDED 13 | #define FALLTHROUGH_INTENDED do { } while (0) 14 | #endif 15 | 16 | namespace leveldb { 17 | 18 | uint32_t Hash(const char* data, size_t n, uint32_t seed) { 19 | // Similar to murmur hash 20 | const uint32_t m = 0xc6a4a793; 21 | const uint32_t r = 24; 22 | const char* limit = data + n; 23 | uint32_t h = seed ^ (n * m); 24 | 25 | // Pick up four bytes at a time 26 | while (data + 4 <= limit) { 27 | uint32_t w = DecodeFixed32(data); 28 | data += 4; 29 | h += w; 30 | h *= m; 31 | h ^= (h >> 16); 32 | } 33 | 34 | // Pick up remaining bytes 35 | switch (limit - data) { 36 | case 3: 37 | h += data[2] << 16; 38 | FALLTHROUGH_INTENDED; 39 | case 2: 40 | h += data[1] << 8; 41 | FALLTHROUGH_INTENDED; 42 | case 1: 43 | h += data[0]; 44 | h *= m; 45 | h ^= (h >> r); 46 | break; 47 | } 48 | return h; 49 | } 50 | 51 | 52 | } // namespace leveldb 53 | -------------------------------------------------------------------------------- /src/qt/signverifymessagedialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef SIGNVERIFYMESSAGEDIALOG_H 6 | #define SIGNVERIFYMESSAGEDIALOG_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class SignVerifyMessageDialog; 12 | } 13 | class WalletModel; 14 | 15 | class SignVerifyMessageDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit SignVerifyMessageDialog(QWidget *parent = 0); 21 | ~SignVerifyMessageDialog(); 22 | 23 | void setModel(WalletModel *model); 24 | void setAddress_SM(const QString &address); 25 | void setAddress_VM(const QString &address); 26 | 27 | void showTab_SM(bool fShow); 28 | void showTab_VM(bool fShow); 29 | 30 | protected: 31 | bool eventFilter(QObject *object, QEvent *event); 32 | 33 | private: 34 | Ui::SignVerifyMessageDialog *ui; 35 | WalletModel *model; 36 | 37 | private slots: 38 | /* sign message */ 39 | void on_addressBookButton_SM_clicked(); 40 | void on_pasteButton_SM_clicked(); 41 | void on_signMessageButton_SM_clicked(); 42 | void on_copySignatureButton_SM_clicked(); 43 | void on_clearButton_SM_clicked(); 44 | /* verify message */ 45 | void on_addressBookButton_VM_clicked(); 46 | void on_verifyMessageButton_VM_clicked(); 47 | void on_clearButton_VM_clicked(); 48 | }; 49 | 50 | #endif // SIGNVERIFYMESSAGEDIALOG_H 51 | -------------------------------------------------------------------------------- /src/leveldb/doc/doc.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 0.5in; 3 | margin-right: 0.5in; 4 | background: white; 5 | color: black; 6 | } 7 | 8 | h1 { 9 | margin-left: -0.2in; 10 | font-size: 14pt; 11 | } 12 | h2 { 13 | margin-left: -0in; 14 | font-size: 12pt; 15 | } 16 | h3 { 17 | margin-left: -0in; 18 | } 19 | h4 { 20 | margin-left: -0in; 21 | } 22 | hr { 23 | margin-left: -0in; 24 | } 25 | 26 | /* Definition lists: definition term bold */ 27 | dt { 28 | font-weight: bold; 29 | } 30 | 31 | address { 32 | text-align: center; 33 | } 34 | code,samp,var { 35 | color: blue; 36 | } 37 | kbd { 38 | color: #600000; 39 | } 40 | div.note p { 41 | float: right; 42 | width: 3in; 43 | margin-right: 0%; 44 | padding: 1px; 45 | border: 2px solid #6060a0; 46 | background-color: #fffff0; 47 | } 48 | 49 | ul { 50 | margin-top: -0em; 51 | margin-bottom: -0em; 52 | } 53 | 54 | ol { 55 | margin-top: -0em; 56 | margin-bottom: -0em; 57 | } 58 | 59 | UL.nobullets { 60 | list-style-type: none; 61 | list-style-image: none; 62 | margin-left: -1em; 63 | } 64 | 65 | p { 66 | margin: 1em 0 1em 0; 67 | padding: 0 0 0 0; 68 | } 69 | 70 | pre { 71 | line-height: 1.3em; 72 | padding: 0.4em 0 0.8em 0; 73 | margin: 0 0 0 0; 74 | border: 0 0 0 0; 75 | color: blue; 76 | } 77 | 78 | .datatable { 79 | margin-left: auto; 80 | margin-right: auto; 81 | margin-top: 2em; 82 | margin-bottom: 2em; 83 | border: 1px solid; 84 | } 85 | 86 | .datatable td,th { 87 | padding: 0 0.5em 0 0.5em; 88 | text-align: right; 89 | } 90 | -------------------------------------------------------------------------------- /src/leveldb/db/version_edit_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "db/version_edit.h" 6 | #include "util/testharness.h" 7 | 8 | namespace leveldb { 9 | 10 | static void TestEncodeDecode(const VersionEdit& edit) { 11 | std::string encoded, encoded2; 12 | edit.EncodeTo(&encoded); 13 | VersionEdit parsed; 14 | Status s = parsed.DecodeFrom(encoded); 15 | ASSERT_TRUE(s.ok()) << s.ToString(); 16 | parsed.EncodeTo(&encoded2); 17 | ASSERT_EQ(encoded, encoded2); 18 | } 19 | 20 | class VersionEditTest { }; 21 | 22 | TEST(VersionEditTest, EncodeDecode) { 23 | static const uint64_t kBig = 1ull << 50; 24 | 25 | VersionEdit edit; 26 | for (int i = 0; i < 4; i++) { 27 | TestEncodeDecode(edit); 28 | edit.AddFile(3, kBig + 300 + i, kBig + 400 + i, 29 | InternalKey("foo", kBig + 500 + i, kTypeValue), 30 | InternalKey("zoo", kBig + 600 + i, kTypeDeletion)); 31 | edit.DeleteFile(4, kBig + 700 + i); 32 | edit.SetCompactPointer(i, InternalKey("x", kBig + 900 + i, kTypeValue)); 33 | } 34 | 35 | edit.SetComparatorName("foo"); 36 | edit.SetLogNumber(kBig + 100); 37 | edit.SetNextFile(kBig + 200); 38 | edit.SetLastSequence(kBig + 1000); 39 | TestEncodeDecode(edit); 40 | } 41 | 42 | } // namespace leveldb 43 | 44 | int main(int argc, char** argv) { 45 | return leveldb::test::RunAllTests(); 46 | } 47 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "speedcoin" 3 | suites: 4 | - "precise" 5 | architectures: 6 | - "i386" 7 | - "amd64" 8 | packages: 9 | - "qt4-qmake" 10 | - "libqt4-dev" 11 | - "git-core" 12 | - "unzip" 13 | - "pkg-config" 14 | - "libpng12-dev" 15 | reference_datetime: "2011-01-30 00:00:00" 16 | remotes: 17 | - "url": "https://github.com/spdcoin/Speedcoin.git" 18 | "dir": "speedcoin" 19 | files: 20 | - "speedcoin-deps-linux32-gitian-r1.zip" 21 | - "speedcoin-deps-linux64-gitian-r1.zip" 22 | - "boost-linux32-1.55.0-gitian-r1.zip" 23 | - "boost-linux64-1.55.0-gitian-r1.zip" 24 | script: | 25 | INSTDIR="$HOME/install" 26 | export LIBRARY_PATH="$INSTDIR/lib" 27 | # 28 | mkdir -p $INSTDIR 29 | cd $INSTDIR 30 | unzip ../build/speedcoin-deps-linux${GBUILD_BITS}-gitian-r1.zip 31 | unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip 32 | cd .. 33 | # 34 | cd speedcoin 35 | mkdir -p $OUTDIR/src 36 | git archive HEAD | tar -x -C $OUTDIR/src 37 | cp $OUTDIR/src/doc/README.md $OUTDIR 38 | cp $OUTDIR/src/COPYING $OUTDIR 39 | cd src 40 | make -f makefile.unix STATIC=1 OPENSSL_INCLUDE_PATH="$INSTDIR/include" OPENSSL_LIB_PATH="$INSTDIR/lib" BOOST_LIB_SUFFIX="-mt" $MAKEOPTS speedcoind USE_UPNP=0 DEBUGFLAGS= USE_SSE2=1 41 | mkdir -p $OUTDIR/bin/$GBUILD_BITS 42 | install -s speedcoind $OUTDIR/bin/$GBUILD_BITS 43 | cd .. 44 | qmake INCLUDEPATH="$INSTDIR/include" LIBS="-L$INSTDIR/lib" BOOST_LIB_SUFFIX="-mt" RELEASE=1 USE_QRCODE=1 USE_SSE2=1 USE_UPNP=1 45 | make $MAKEOPTS 46 | install speedcoin-qt $OUTDIR/bin/$GBUILD_BITS 47 | -------------------------------------------------------------------------------- /src/hash.cpp: -------------------------------------------------------------------------------- 1 | #include "hash.h" 2 | 3 | inline uint32_t ROTL32 ( uint32_t x, int8_t r ) 4 | { 5 | return (x << r) | (x >> (32 - r)); 6 | } 7 | 8 | unsigned int MurmurHash3(unsigned int nHashSeed, const std::vector& vDataToHash) 9 | { 10 | // The following is MurmurHash3 (x86_32), see http://code.google.com/p/smhasher/source/browse/trunk/MurmurHash3.cpp 11 | uint32_t h1 = nHashSeed; 12 | const uint32_t c1 = 0xcc9e2d51; 13 | const uint32_t c2 = 0x1b873593; 14 | 15 | const int nblocks = vDataToHash.size() / 4; 16 | 17 | //---------- 18 | // body 19 | const uint32_t * blocks = (const uint32_t *)(&vDataToHash[0] + nblocks*4); 20 | 21 | for(int i = -nblocks; i; i++) 22 | { 23 | uint32_t k1 = blocks[i]; 24 | 25 | k1 *= c1; 26 | k1 = ROTL32(k1,15); 27 | k1 *= c2; 28 | 29 | h1 ^= k1; 30 | h1 = ROTL32(h1,13); 31 | h1 = h1*5+0xe6546b64; 32 | } 33 | 34 | //---------- 35 | // tail 36 | const uint8_t * tail = (const uint8_t*)(&vDataToHash[0] + nblocks*4); 37 | 38 | uint32_t k1 = 0; 39 | 40 | switch(vDataToHash.size() & 3) 41 | { 42 | case 3: k1 ^= tail[2] << 16; 43 | case 2: k1 ^= tail[1] << 8; 44 | case 1: k1 ^= tail[0]; 45 | k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; 46 | }; 47 | 48 | //---------- 49 | // finalization 50 | h1 ^= vDataToHash.size(); 51 | h1 ^= h1 >> 16; 52 | h1 *= 0x85ebca6b; 53 | h1 ^= h1 >> 13; 54 | h1 *= 0xc2b2ae35; 55 | h1 ^= h1 >> 16; 56 | 57 | return h1; 58 | } 59 | -------------------------------------------------------------------------------- /src/leveldb/port/thread_annotations.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 6 | 7 | // Some environments provide custom macros to aid in static thread-safety 8 | // analysis. Provide empty definitions of such macros unless they are already 9 | // defined. 10 | 11 | #ifndef EXCLUSIVE_LOCKS_REQUIRED 12 | #define EXCLUSIVE_LOCKS_REQUIRED(...) 13 | #endif 14 | 15 | #ifndef SHARED_LOCKS_REQUIRED 16 | #define SHARED_LOCKS_REQUIRED(...) 17 | #endif 18 | 19 | #ifndef LOCKS_EXCLUDED 20 | #define LOCKS_EXCLUDED(...) 21 | #endif 22 | 23 | #ifndef LOCK_RETURNED 24 | #define LOCK_RETURNED(x) 25 | #endif 26 | 27 | #ifndef LOCKABLE 28 | #define LOCKABLE 29 | #endif 30 | 31 | #ifndef SCOPED_LOCKABLE 32 | #define SCOPED_LOCKABLE 33 | #endif 34 | 35 | #ifndef EXCLUSIVE_LOCK_FUNCTION 36 | #define EXCLUSIVE_LOCK_FUNCTION(...) 37 | #endif 38 | 39 | #ifndef SHARED_LOCK_FUNCTION 40 | #define SHARED_LOCK_FUNCTION(...) 41 | #endif 42 | 43 | #ifndef EXCLUSIVE_TRYLOCK_FUNCTION 44 | #define EXCLUSIVE_TRYLOCK_FUNCTION(...) 45 | #endif 46 | 47 | #ifndef SHARED_TRYLOCK_FUNCTION 48 | #define SHARED_TRYLOCK_FUNCTION(...) 49 | #endif 50 | 51 | #ifndef UNLOCK_FUNCTION 52 | #define UNLOCK_FUNCTION(...) 53 | #endif 54 | 55 | #ifndef NO_THREAD_SAFETY_ANALYSIS 56 | #define NO_THREAD_SAFETY_ANALYSIS 57 | #endif 58 | 59 | #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 60 | -------------------------------------------------------------------------------- /src/leveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /src/qt/overviewpage.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef OVERVIEWPAGE_H 6 | #define OVERVIEWPAGE_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class OverviewPage; 12 | } 13 | class ClientModel; 14 | class WalletModel; 15 | class TxViewDelegate; 16 | class TransactionFilterProxy; 17 | 18 | QT_BEGIN_NAMESPACE 19 | class QModelIndex; 20 | QT_END_NAMESPACE 21 | 22 | /** Overview ("home") page widget */ 23 | class OverviewPage : public QWidget 24 | { 25 | Q_OBJECT 26 | 27 | public: 28 | explicit OverviewPage(QWidget *parent = 0); 29 | ~OverviewPage(); 30 | 31 | void setClientModel(ClientModel *clientModel); 32 | void setWalletModel(WalletModel *walletModel); 33 | void showOutOfSyncWarning(bool fShow); 34 | 35 | public slots: 36 | void setBalance(qint64 balance, qint64 unconfirmedBalance, qint64 immatureBalance); 37 | 38 | signals: 39 | void transactionClicked(const QModelIndex &index); 40 | 41 | private: 42 | Ui::OverviewPage *ui; 43 | ClientModel *clientModel; 44 | WalletModel *walletModel; 45 | qint64 currentBalance; 46 | qint64 currentUnconfirmedBalance; 47 | qint64 currentImmatureBalance; 48 | 49 | TxViewDelegate *txdelegate; 50 | TransactionFilterProxy *filter; 51 | 52 | private slots: 53 | void updateDisplayUnit(); 54 | void handleTransactionClicked(const QModelIndex &index); 55 | void updateAlerts(const QString &warnings); 56 | }; 57 | 58 | #endif // OVERVIEWPAGE_H 59 | -------------------------------------------------------------------------------- /contrib/tidy_datadir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -d "$1" ]; then 4 | cd "$1" 5 | else 6 | echo "Usage: $0 " >&2 7 | echo "Removes obsolete Bitcoin database files" >&2 8 | exit 1 9 | fi 10 | 11 | LEVEL=0 12 | if [ -f wallet.dat -a -f addr.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=1; fi 13 | if [ -f wallet.dat -a -f peers.dat -a -f blkindex.dat -a -f blk0001.dat ]; then LEVEL=2; fi 14 | if [ -f wallet.dat -a -f peers.dat -a -f coins/CURRENT -a -f blktree/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=3; fi 15 | if [ -f wallet.dat -a -f peers.dat -a -f chainstate/CURRENT -a -f blocks/index/CURRENT -a -f blocks/blk00000.dat ]; then LEVEL=4; fi 16 | 17 | case $LEVEL in 18 | 0) 19 | echo "Error: no Bitcoin datadir detected." 20 | exit 1 21 | ;; 22 | 1) 23 | echo "Detected old Bitcoin datadir (before 0.7)." 24 | echo "Nothing to do." 25 | exit 0 26 | ;; 27 | 2) 28 | echo "Detected Bitcoin 0.7 datadir." 29 | ;; 30 | 3) 31 | echo "Detected Bitcoin pre-0.8 datadir." 32 | ;; 33 | 4) 34 | echo "Detected Bitcoin 0.8 datadir." 35 | ;; 36 | esac 37 | 38 | FILES="" 39 | DIRS="" 40 | 41 | if [ $LEVEL -ge 3 ]; then FILES=$(echo $FILES blk????.dat blkindex.dat); fi 42 | if [ $LEVEL -ge 2 ]; then FILES=$(echo $FILES addr.dat); fi 43 | if [ $LEVEL -ge 4 ]; then DIRS=$(echo $DIRS coins blktree); fi 44 | 45 | for FILE in $FILES; do 46 | if [ -f $FILE ]; then 47 | echo "Deleting: $FILE" 48 | rm -f $FILE 49 | fi 50 | done 51 | 52 | for DIR in $DIRS; do 53 | if [ -d $DIR ]; then 54 | echo "Deleting: $DIR/" 55 | rm -rf $DIR 56 | fi 57 | done 58 | 59 | echo "Done." 60 | -------------------------------------------------------------------------------- /src/leveldb/util/crc32c.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_ 6 | #define STORAGE_LEVELDB_UTIL_CRC32C_H_ 7 | 8 | #include 9 | #include 10 | 11 | namespace leveldb { 12 | namespace crc32c { 13 | 14 | // Return the crc32c of concat(A, data[0,n-1]) where init_crc is the 15 | // crc32c of some string A. Extend() is often used to maintain the 16 | // crc32c of a stream of data. 17 | extern uint32_t Extend(uint32_t init_crc, const char* data, size_t n); 18 | 19 | // Return the crc32c of data[0,n-1] 20 | inline uint32_t Value(const char* data, size_t n) { 21 | return Extend(0, data, n); 22 | } 23 | 24 | static const uint32_t kMaskDelta = 0xa282ead8ul; 25 | 26 | // Return a masked representation of crc. 27 | // 28 | // Motivation: it is problematic to compute the CRC of a string that 29 | // contains embedded CRCs. Therefore we recommend that CRCs stored 30 | // somewhere (e.g., in files) should be masked before being stored. 31 | inline uint32_t Mask(uint32_t crc) { 32 | // Rotate right by 15 bits and add a constant. 33 | return ((crc >> 15) | (crc << 17)) + kMaskDelta; 34 | } 35 | 36 | // Return the crc whose masked representation is masked_crc. 37 | inline uint32_t Unmask(uint32_t masked_crc) { 38 | uint32_t rot = masked_crc - kMaskDelta; 39 | return ((rot >> 17) | (rot << 15)); 40 | } 41 | 42 | } // namespace crc32c 43 | } // namespace leveldb 44 | 45 | #endif // STORAGE_LEVELDB_UTIL_CRC32C_H_ 46 | -------------------------------------------------------------------------------- /src/leveldb/util/testutil.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/testutil.h" 6 | 7 | #include "util/random.h" 8 | 9 | namespace leveldb { 10 | namespace test { 11 | 12 | Slice RandomString(Random* rnd, int len, std::string* dst) { 13 | dst->resize(len); 14 | for (int i = 0; i < len; i++) { 15 | (*dst)[i] = static_cast(' ' + rnd->Uniform(95)); // ' ' .. '~' 16 | } 17 | return Slice(*dst); 18 | } 19 | 20 | std::string RandomKey(Random* rnd, int len) { 21 | // Make sure to generate a wide variety of characters so we 22 | // test the boundary conditions for short-key optimizations. 23 | static const char kTestChars[] = { 24 | '\0', '\1', 'a', 'b', 'c', 'd', 'e', '\xfd', '\xfe', '\xff' 25 | }; 26 | std::string result; 27 | for (int i = 0; i < len; i++) { 28 | result += kTestChars[rnd->Uniform(sizeof(kTestChars))]; 29 | } 30 | return result; 31 | } 32 | 33 | 34 | extern Slice CompressibleString(Random* rnd, double compressed_fraction, 35 | int len, std::string* dst) { 36 | int raw = static_cast(len * compressed_fraction); 37 | if (raw < 1) raw = 1; 38 | std::string raw_data; 39 | RandomString(rnd, raw, &raw_data); 40 | 41 | // Duplicate the random data until we have filled "len" bytes 42 | dst->clear(); 43 | while (dst->size() < len) { 44 | dst->append(raw_data); 45 | } 46 | dst->resize(len); 47 | return Slice(*dst); 48 | } 49 | 50 | } // namespace test 51 | } // namespace leveldb 52 | -------------------------------------------------------------------------------- /src/leveldb/port/port_posix.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "port/port_posix.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include "util/logging.h" 11 | 12 | namespace leveldb { 13 | namespace port { 14 | 15 | static void PthreadCall(const char* label, int result) { 16 | if (result != 0) { 17 | fprintf(stderr, "pthread %s: %s\n", label, strerror(result)); 18 | abort(); 19 | } 20 | } 21 | 22 | Mutex::Mutex() { PthreadCall("init mutex", pthread_mutex_init(&mu_, NULL)); } 23 | 24 | Mutex::~Mutex() { PthreadCall("destroy mutex", pthread_mutex_destroy(&mu_)); } 25 | 26 | void Mutex::Lock() { PthreadCall("lock", pthread_mutex_lock(&mu_)); } 27 | 28 | void Mutex::Unlock() { PthreadCall("unlock", pthread_mutex_unlock(&mu_)); } 29 | 30 | CondVar::CondVar(Mutex* mu) 31 | : mu_(mu) { 32 | PthreadCall("init cv", pthread_cond_init(&cv_, NULL)); 33 | } 34 | 35 | CondVar::~CondVar() { PthreadCall("destroy cv", pthread_cond_destroy(&cv_)); } 36 | 37 | void CondVar::Wait() { 38 | PthreadCall("wait", pthread_cond_wait(&cv_, &mu_->mu_)); 39 | } 40 | 41 | void CondVar::Signal() { 42 | PthreadCall("signal", pthread_cond_signal(&cv_)); 43 | } 44 | 45 | void CondVar::SignalAll() { 46 | PthreadCall("broadcast", pthread_cond_broadcast(&cv_)); 47 | } 48 | 49 | void InitOnce(OnceType* once, void (*initializer)()) { 50 | PthreadCall("once", pthread_once(once, initializer)); 51 | } 52 | 53 | } // namespace port 54 | } // namespace leveldb 55 | -------------------------------------------------------------------------------- /src/json/json_spirit_error_position.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_ERROR_POSITION 2 | #define JSON_SPIRIT_ERROR_POSITION 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include 14 | 15 | namespace json_spirit 16 | { 17 | // An Error_position exception is thrown by the "read_or_throw" functions below on finding an error. 18 | // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read" 19 | // functions that return a bool. 20 | // 21 | struct Error_position 22 | { 23 | Error_position(); 24 | Error_position( unsigned int line, unsigned int column, const std::string& reason ); 25 | bool operator==( const Error_position& lhs ) const; 26 | unsigned int line_; 27 | unsigned int column_; 28 | std::string reason_; 29 | }; 30 | 31 | inline Error_position::Error_position() 32 | : line_( 0 ) 33 | , column_( 0 ) 34 | { 35 | } 36 | 37 | inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason ) 38 | : line_( line ) 39 | , column_( column ) 40 | , reason_( reason ) 41 | { 42 | } 43 | 44 | inline bool Error_position::operator==( const Error_position& lhs ) const 45 | { 46 | if( this == &lhs ) return true; 47 | 48 | return ( reason_ == lhs.reason_ ) && 49 | ( line_ == lhs.line_ ) && 50 | ( column_ == lhs.column_ ); 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/noui.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "ui_interface.h" 7 | #include "init.h" 8 | #include "bitcoinrpc.h" 9 | 10 | #include 11 | 12 | static bool noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) 13 | { 14 | std::string strCaption; 15 | // Check for usage of predefined caption 16 | switch (style) { 17 | case CClientUIInterface::MSG_ERROR: 18 | strCaption += _("Error"); 19 | break; 20 | case CClientUIInterface::MSG_WARNING: 21 | strCaption += _("Warning"); 22 | break; 23 | case CClientUIInterface::MSG_INFORMATION: 24 | strCaption += _("Information"); 25 | break; 26 | default: 27 | strCaption += caption; // Use supplied caption (can be empty) 28 | } 29 | 30 | printf("%s: %s\n", strCaption.c_str(), message.c_str()); 31 | fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str()); 32 | return false; 33 | } 34 | 35 | static bool noui_ThreadSafeAskFee(int64 /*nFeeRequired*/) 36 | { 37 | return true; 38 | } 39 | 40 | static void noui_InitMessage(const std::string &message) 41 | { 42 | printf("init message: %s\n", message.c_str()); 43 | } 44 | 45 | void noui_connect() 46 | { 47 | // Connect bitcoind signal handlers 48 | uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox); 49 | uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee); 50 | uiInterface.InitMessage.connect(noui_InitMessage); 51 | } 52 | -------------------------------------------------------------------------------- /src/leveldb/db/write_batch_internal.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 6 | #define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 7 | 8 | #include "leveldb/write_batch.h" 9 | 10 | namespace leveldb { 11 | 12 | class MemTable; 13 | 14 | // WriteBatchInternal provides static methods for manipulating a 15 | // WriteBatch that we don't want in the public WriteBatch interface. 16 | class WriteBatchInternal { 17 | public: 18 | // Return the number of entries in the batch. 19 | static int Count(const WriteBatch* batch); 20 | 21 | // Set the count for the number of entries in the batch. 22 | static void SetCount(WriteBatch* batch, int n); 23 | 24 | // Return the seqeunce number for the start of this batch. 25 | static SequenceNumber Sequence(const WriteBatch* batch); 26 | 27 | // Store the specified number as the seqeunce number for the start of 28 | // this batch. 29 | static void SetSequence(WriteBatch* batch, SequenceNumber seq); 30 | 31 | static Slice Contents(const WriteBatch* batch) { 32 | return Slice(batch->rep_); 33 | } 34 | 35 | static size_t ByteSize(const WriteBatch* batch) { 36 | return batch->rep_.size(); 37 | } 38 | 39 | static void SetContents(WriteBatch* batch, const Slice& contents); 40 | 41 | static Status InsertInto(const WriteBatch* batch, MemTable* memtable); 42 | 43 | static void Append(WriteBatch* dst, const WriteBatch* src); 44 | }; 45 | 46 | } // namespace leveldb 47 | 48 | 49 | #endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 50 | -------------------------------------------------------------------------------- /src/test/scrypt_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "util.h" 4 | #include "scrypt.h" 5 | #include "main.h" 6 | 7 | BOOST_AUTO_TEST_SUITE(scrypt_tests) 8 | 9 | BOOST_AUTO_TEST_CASE(scrypt_hashtest) 10 | { 11 | // Test Scrypt hash with known inputs against expected outputs for all 12 | // supported Nfactors, only goes up to N = 1048576 due to current 32 bit 13 | // limit on nTime. Blocktime is packed in the pseudoheaders in inputhex 14 | #define HASHCOUNT 50 15 | const char* inputhex[HASHCOUNT] = { 16 | "" 17 | }; 18 | const char* expected[HASHCOUNT] = { 19 | "" 20 | }; 21 | uint256 scrypthash; 22 | std::vector inputbytes; 23 | 24 | for (int i = 0; i < HASHCOUNT; i++) { 25 | inputbytes = ParseHex(inputhex[i]); 26 | unsigned int blocktime = *(unsigned int*)(&inputbytes[68]); 27 | printf("%i\n", blocktime); 28 | unsigned char Nfactor = GetNfactor(blocktime); 29 | unsigned int scratchpad_size = 128 * (1 << (Nfactor+1)) + 512; 30 | std::vector scratchpad = std::vector(scratchpad_size); 31 | #if defined(USE_SSE2) 32 | // Test SSE2 scrypt 33 | scrypt_N_1_1_256_sp_sse2((const char*)&inputbytes[0], 34 | BEGIN(scrypthash), &scratchpad[0], 35 | Nfactor); 36 | #endif 37 | // Test generic scrypt 38 | scrypt_N_1_1_256_sp_generic((const char*)&inputbytes[0], 39 | BEGIN(scrypthash), &scratchpad[0], 40 | Nfactor); 41 | BOOST_CHECK_EQUAL(scrypthash.ToString().c_str(), expected[i]); 42 | } 43 | } 44 | 45 | BOOST_AUTO_TEST_SUITE_END() 46 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/linux-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: bitcoin 3 | urls: 4 | - http://bitcoin.org/bitcoin-latest-linux-gitian.zip 5 | rss: 6 | - url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss 7 | xpath: //item/link/text() 8 | pattern: bitcoin-\d+.\d+.\d+-linux-gitian.zip 9 | signers: 10 | 0A82509767C7D4A5D14DA2301AE1D35043E08E54: 11 | weight: 40 12 | name: BlueMatt 13 | key: bluematt 14 | BF6273FAEF7CC0BA1F562E50989F6B3048A116B5: 15 | weight: 40 16 | name: Devrandom 17 | key: devrandom 18 | E463A93F5F3117EEDE6C7316BD02942421F4889F: 19 | weight: 40 20 | name: Luke-Jr 21 | key: luke-jr 22 | D762373D24904A3E42F33B08B9A408E71DAAC974: 23 | weight: 40 24 | name: "Pieter Wuille" 25 | key: sipa 26 | 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: 27 | weight: 40 28 | name: tcatm 29 | key: tcatm 30 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8: 31 | weight: 40 32 | name: "Gavin Andresen" 33 | key: gavinandresen 34 | 71A3B16735405025D447E8F274810B012346C9A6: 35 | weight: 40 36 | name: "Wladimir J. van der Laan" 37 | key: laanwj 38 | AEC1884398647C47413C1C3FB1179EB7347DC10D: 39 | weight: 40 40 | name: "Warren Togami" 41 | key: wtogami 42 | E084FE305BDF0C476F779792657EB016521670C0: 43 | weight: 40 44 | name: "Rama McIntosh" 45 | key: face 46 | 1A2511E978239E491A096D0A828AC1F94EF26053: 47 | weight: 40 48 | name: "Charles Lee" 49 | key: coblee 50 | EFDFCBD38FFF68B49160C7D3A1596566F87BE631: 51 | weight: 40 52 | name: "Anton Yemelyanov" 53 | key: aspect 54 | 59CAF0E96F23F53747945FD4FE3348877809386C: 55 | weight: 40 56 | name: "Adrian Gallagher" 57 | key: thrasher 58 | minimum_weight: 120 59 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/win32-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: bitcoin 3 | urls: 4 | - http://bitcoin.org/bitcoin-latest-win32-gitian.zip 5 | rss: 6 | - url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss 7 | xpath: //item/link/text() 8 | pattern: bitcoin-\d+.\d+.\d+-win32-gitian.zip 9 | signers: 10 | 0A82509767C7D4A5D14DA2301AE1D35043E08E54: 11 | weight: 40 12 | name: BlueMatt 13 | key: bluematt 14 | BF6273FAEF7CC0BA1F562E50989F6B3048A116B5: 15 | weight: 40 16 | name: Devrandom 17 | key: devrandom 18 | E463A93F5F3117EEDE6C7316BD02942421F4889F: 19 | weight: 40 20 | name: Luke-Jr 21 | key: luke-jr 22 | D762373D24904A3E42F33B08B9A408E71DAAC974: 23 | weight: 40 24 | name: "Pieter Wuille" 25 | key: sipa 26 | 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: 27 | weight: 40 28 | name: tcatm 29 | key: tcatm 30 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8: 31 | weight: 40 32 | name: "Gavin Andresen" 33 | key: gavinandresen 34 | 71A3B16735405025D447E8F274810B012346C9A6: 35 | weight: 40 36 | name: "Wladimir J. van der Laan" 37 | key: laanwj 38 | AEC1884398647C47413C1C3FB1179EB7347DC10D: 39 | weight: 40 40 | name: "Warren Togami" 41 | key: wtogami 42 | E084FE305BDF0C476F779792657EB016521670C0: 43 | weight: 40 44 | name: "Rama McIntosh" 45 | key: face 46 | 1A2511E978239E491A096D0A828AC1F94EF26053: 47 | weight: 40 48 | name: "Charles Lee" 49 | key: coblee 50 | EFDFCBD38FFF68B49160C7D3A1596566F87BE631: 51 | weight: 40 52 | name: "Anton Yemelyanov" 53 | key: aspect 54 | 59CAF0E96F23F53747945FD4FE3348877809386C: 55 | weight: 40 56 | name: "Adrian Gallagher" 57 | key: thrasher 58 | minimum_weight: 120 59 | -------------------------------------------------------------------------------- /src/qt/sendcoinsentry.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef SENDCOINSENTRY_H 6 | #define SENDCOINSENTRY_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class SendCoinsEntry; 12 | } 13 | class WalletModel; 14 | class SendCoinsRecipient; 15 | 16 | /** A single entry in the dialog for sending bitcoins. */ 17 | class SendCoinsEntry : public QFrame 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | explicit SendCoinsEntry(QWidget *parent = 0); 23 | ~SendCoinsEntry(); 24 | 25 | void setModel(WalletModel *model); 26 | bool validate(); 27 | SendCoinsRecipient getValue(); 28 | 29 | /** Return whether the entry is still empty and unedited */ 30 | bool isClear(); 31 | 32 | void setValue(const SendCoinsRecipient &value); 33 | void setAddress(const QString &address); 34 | 35 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 36 | */ 37 | QWidget *setupTabChain(QWidget *prev); 38 | 39 | void setFocus(); 40 | 41 | public slots: 42 | void setRemoveEnabled(bool enabled); 43 | void clear(); 44 | 45 | signals: 46 | void removeEntry(SendCoinsEntry *entry); 47 | void payAmountChanged(); 48 | 49 | private slots: 50 | void on_deleteButton_clicked(); 51 | void on_payTo_textChanged(const QString &address); 52 | void on_addressBookButton_clicked(); 53 | void on_pasteButton_clicked(); 54 | void updateDisplayUnit(); 55 | 56 | private: 57 | Ui::SendCoinsEntry *ui; 58 | WalletModel *model; 59 | }; 60 | 61 | #endif // SENDCOINSENTRY_H 62 | -------------------------------------------------------------------------------- /src/version.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_VERSION_H 5 | #define BITCOIN_VERSION_H 6 | 7 | #include "clientversion.h" 8 | #include 9 | 10 | // 11 | // client versioning 12 | // 13 | 14 | static const int CLIENT_VERSION = 15 | 1000000 * CLIENT_VERSION_MAJOR 16 | + 10000 * CLIENT_VERSION_MINOR 17 | + 100 * CLIENT_VERSION_REVISION 18 | + 1 * CLIENT_VERSION_BUILD; 19 | 20 | extern const std::string CLIENT_NAME; 21 | extern const std::string CLIENT_BUILD; 22 | extern const std::string CLIENT_DATE; 23 | 24 | // 25 | // network protocol versioning 26 | // 27 | 28 | static const int PROTOCOL_VERSION = 70002; 29 | 30 | // intial proto version, to be increased after version/verack negotiation 31 | static const int INIT_PROTO_VERSION = 209; 32 | 33 | // disconnect from peers older than this proto version 34 | static const int MIN_PEER_PROTO_VERSION = 70002; 35 | 36 | // nTime field added to CAddress, starting with this version; 37 | // if possible, avoid requesting addresses nodes older than this 38 | static const int CADDR_TIME_VERSION = 31402; 39 | 40 | // only request blocks from nodes outside this range of versions 41 | static const int NOBLKS_VERSION_START = 32000; 42 | static const int NOBLKS_VERSION_END = 32400; 43 | 44 | // BIP 0031, pong message, is enabled for all versions AFTER this one 45 | static const int BIP0031_VERSION = 60000; 46 | 47 | // "mempool" command, enhanced "getdata" behavior starts with this version: 48 | static const int MEMPOOL_GD_VERSION = 60002; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/leveldb/util/logging.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Must not be included from any .h files to avoid polluting the namespace 6 | // with macros. 7 | 8 | #ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_ 9 | #define STORAGE_LEVELDB_UTIL_LOGGING_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include "port/port.h" 15 | 16 | namespace leveldb { 17 | 18 | class Slice; 19 | class WritableFile; 20 | 21 | // Append a human-readable printout of "num" to *str 22 | extern void AppendNumberTo(std::string* str, uint64_t num); 23 | 24 | // Append a human-readable printout of "value" to *str. 25 | // Escapes any non-printable characters found in "value". 26 | extern void AppendEscapedStringTo(std::string* str, const Slice& value); 27 | 28 | // Return a human-readable printout of "num" 29 | extern std::string NumberToString(uint64_t num); 30 | 31 | // Return a human-readable version of "value". 32 | // Escapes any non-printable characters found in "value". 33 | extern std::string EscapeString(const Slice& value); 34 | 35 | // If *in starts with "c", advances *in past the first character and 36 | // returns true. Otherwise, returns false. 37 | extern bool ConsumeChar(Slice* in, char c); 38 | 39 | // Parse a human-readable number from "*in" into *value. On success, 40 | // advances "*in" past the consumed number and sets "*val" to the 41 | // numeric value. Otherwise, returns false and leaves *in in an 42 | // unspecified state. 43 | extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val); 44 | 45 | } // namespace leveldb 46 | 47 | #endif // STORAGE_LEVELDB_UTIL_LOGGING_H_ 48 | -------------------------------------------------------------------------------- /src/json/json_spirit_utils.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_UTILS 2 | #define JSON_SPIRIT_UTILS 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include "json_spirit_value.h" 14 | #include 15 | 16 | namespace json_spirit 17 | { 18 | template< class Obj_t, class Map_t > 19 | void obj_to_map( const Obj_t& obj, Map_t& mp_obj ) 20 | { 21 | mp_obj.clear(); 22 | 23 | for( typename Obj_t::const_iterator i = obj.begin(); i != obj.end(); ++i ) 24 | { 25 | mp_obj[ i->name_ ] = i->value_; 26 | } 27 | } 28 | 29 | template< class Obj_t, class Map_t > 30 | void map_to_obj( const Map_t& mp_obj, Obj_t& obj ) 31 | { 32 | obj.clear(); 33 | 34 | for( typename Map_t::const_iterator i = mp_obj.begin(); i != mp_obj.end(); ++i ) 35 | { 36 | obj.push_back( typename Obj_t::value_type( i->first, i->second ) ); 37 | } 38 | } 39 | 40 | typedef std::map< std::string, Value > Mapped_obj; 41 | 42 | #ifndef BOOST_NO_STD_WSTRING 43 | typedef std::map< std::wstring, wValue > wMapped_obj; 44 | #endif 45 | 46 | template< class Object_type, class String_type > 47 | const typename Object_type::value_type::Value_type& find_value( const Object_type& obj, const String_type& name ) 48 | { 49 | for( typename Object_type::const_iterator i = obj.begin(); i != obj.end(); ++i ) 50 | { 51 | if( i->name_ == name ) 52 | { 53 | return i->value_; 54 | } 55 | } 56 | 57 | return Object_type::value_type::Value_type::null; 58 | } 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/laanwj-key.pgp: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP PUBLIC KEY BLOCK----- 2 | Version: SKS 1.1.0 3 | 4 | mQENBE5UtMEBCADOUz2i9l/D8xYINCmfUDnxi+DXvX5LmZ39ZdvsoE+ugO0SRRGdIHEFO2is 5 | 0xezX50wXu9aneb+tEqM0BuiLo6VxaXpxrkxHpr6c4jf37SkE/H0qsi/txEUp7337y3+4HMG 6 | lUjiuh802I72p1qusjsKBnmnnR0rwNouTcoDmGUDh7jpKCtzFv+2TR2dRthJn7vmmjq3+bG6 7 | PYfqoFY1yHrAGT1lrDBULZsQ/NBLI2+J4oo2LYv3GCq8GNnzrovqvTvui50VSROhLrOe58o2 8 | shE+sjQShAy5wYkPt1R1fQnpfx+5vf+TPnkxVwRb3h5GhCp0YL8XC/BXsd5vM4KlVH2rABEB 9 | AAG0K1dsYWRpbWlyIEouIHZhbiBkZXIgTGFhbiA8bGFhbndqQGdtYWlsLmNvbT6JATgEEwEC 10 | ACIFAk5UtMECGwMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheAAAoJEHSBCwEjRsmmy6YIAK09 11 | buNXyYQrJBsX16sXxEhx5QPKyF3uHJDFJv66SdnpvIkNoznsaPiRJkbTANop93FZmaGa6wVn 12 | zGDiz7jPA8Dpxx5aAYPhIT+zPJAdXWM3wJ/Gio9besRNzniai8Lwi5MZ9R/5yFGBobm6/AcN 13 | 4sUoqA3NSV2U3I29R0Vwlzo8GVtmyi9ENSi6Oo7AcXNTRt69cxW4nAHkB+amwwDJlcAb31ex 14 | bogYXPhScwqQZixRr+JBkKxBjkTXXnQypT4KI5SegYwQVYfyiZmDP7UHKe/u6pSKKbVphLg8 15 | xLB5spcXse8/a2+onrbNlw6y8TXiJ++Z54PE7zztWTXf2huakeG5AQ0ETlS0wQEIAMNO3OkP 16 | xoPRKWzBLcI7JRITAW+HNaLTq3uN2+4WxA57DEjbL9EDoAv+7wTkDAL40f0T+xiu6GJcLFjw 17 | GJZu/tYu7+mErHjrdo+K4suCQt7w5EXCBvOLjhW4tyYMzNx8hP+oqzOW9iEC+6VV91+DYeqt 18 | EkJuyVXOI4vzBlTw8uGow8aMMsCq8XVvKUZFTPsjGl197Q5B3A+ZOFCR8xqiqdPjuz6MglVV 19 | oFdDNu3EZn8zkGsQlovXoE9ndVeVzx/XMNmsxFaMYsReUs253RIf1FEfgExID0fg2OnyLCjS 20 | 2iFW1RgajS+/saIkKl+N1iuMzJA7wMAM0plhRueOG0MtZSsAEQEAAYkBHwQYAQIACQUCTlS0 21 | wQIbDAAKCRB0gQsBI0bJpmsDB/4waenn2CvSHXyomykfpwf5lMte1V5LvH3z5R2LY+1NopRv 22 | LSz3iC39x69XWiTbhywDfgafnGPW4pWBOff2/bu5/A6z1Hnan1vyrRRD/hx1uMJ7S6q+bIvZ 23 | iVIg1p0jH6tdIIhwX3cydhdRZHo7e9oSMgOUWsr6Ar59NRo9CENwGPE4U61HXfOnxWdrFWoA 24 | XdwZczBeLxmUy6Vo6sKqv+gE4bqrtAM0sY/MsQ9cU95x+52ox/sq44lQMwd3ZBYUP7B1qbHI 25 | hZSZuch6MLi5scLPeau0ZvCaljiaMeivP5+x0gWPRs0kI+9sZxInbqvrsJ6oOBJM3xYGhtn1 26 | zZ7qmZR7 27 | =si/k 28 | -----END PGP PUBLIC KEY BLOCK----- 29 | -------------------------------------------------------------------------------- /src/compat.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef _BITCOIN_COMPAT_H 6 | #define _BITCOIN_COMPAT_H 1 7 | 8 | #ifdef WIN32 9 | #define _WIN32_WINNT 0x0501 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #ifndef NOMINMAX 12 | #define NOMINMAX 13 | #endif 14 | #define FD_SETSIZE 1024 // max number of fds in fd_set 15 | #include 16 | #include 17 | #include 18 | #else 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #endif 28 | 29 | typedef u_int SOCKET; 30 | #ifdef WIN32 31 | #define MSG_NOSIGNAL 0 32 | #define MSG_DONTWAIT 0 33 | typedef int socklen_t; 34 | #else 35 | #include "errno.h" 36 | #define WSAGetLastError() errno 37 | #define WSAEINVAL EINVAL 38 | #define WSAEALREADY EALREADY 39 | #define WSAEWOULDBLOCK EWOULDBLOCK 40 | #define WSAEMSGSIZE EMSGSIZE 41 | #define WSAEINTR EINTR 42 | #define WSAEINPROGRESS EINPROGRESS 43 | #define WSAEADDRINUSE EADDRINUSE 44 | #define WSAENOTSOCK EBADF 45 | #define INVALID_SOCKET (SOCKET)(~0) 46 | #define SOCKET_ERROR -1 47 | #endif 48 | 49 | inline int myclosesocket(SOCKET& hSocket) 50 | { 51 | if (hSocket == INVALID_SOCKET) 52 | return WSAENOTSOCK; 53 | #ifdef WIN32 54 | int ret = closesocket(hSocket); 55 | #else 56 | int ret = close(hSocket); 57 | #endif 58 | hSocket = INVALID_SOCKET; 59 | return ret; 60 | } 61 | #define closesocket(s) myclosesocket(s) 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/json/json_spirit_writer.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_WRITER 2 | #define JSON_SPIRIT_WRITER 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include "json_spirit_value.h" 14 | #include 15 | 16 | namespace json_spirit 17 | { 18 | // functions to convert JSON Values to text, 19 | // the "formatted" versions add whitespace to format the output nicely 20 | 21 | void write ( const Value& value, std::ostream& os ); 22 | void write_formatted( const Value& value, std::ostream& os ); 23 | std::string write ( const Value& value ); 24 | std::string write_formatted( const Value& value ); 25 | 26 | #ifndef BOOST_NO_STD_WSTRING 27 | 28 | void write ( const wValue& value, std::wostream& os ); 29 | void write_formatted( const wValue& value, std::wostream& os ); 30 | std::wstring write ( const wValue& value ); 31 | std::wstring write_formatted( const wValue& value ); 32 | 33 | #endif 34 | 35 | void write ( const mValue& value, std::ostream& os ); 36 | void write_formatted( const mValue& value, std::ostream& os ); 37 | std::string write ( const mValue& value ); 38 | std::string write_formatted( const mValue& value ); 39 | 40 | #ifndef BOOST_NO_STD_WSTRING 41 | 42 | void write ( const wmValue& value, std::wostream& os ); 43 | void write_formatted( const wmValue& value, std::wostream& os ); 44 | std::wstring write ( const wmValue& value ); 45 | std::wstring write_formatted( const wmValue& value ); 46 | 47 | #endif 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/qt/transactionfilterproxy.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef TRANSACTIONFILTERPROXY_H 6 | #define TRANSACTIONFILTERPROXY_H 7 | 8 | #include 9 | #include 10 | 11 | /** Filter the transaction list according to pre-specified rules. */ 12 | class TransactionFilterProxy : public QSortFilterProxyModel 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit TransactionFilterProxy(QObject *parent = 0); 18 | 19 | /** Earliest date that can be represented (far in the past) */ 20 | static const QDateTime MIN_DATE; 21 | /** Last date that can be represented (far in the future) */ 22 | static const QDateTime MAX_DATE; 23 | /** Type filter bit field (all types) */ 24 | static const quint32 ALL_TYPES = 0xFFFFFFFF; 25 | 26 | static quint32 TYPE(int type) { return 1< 2 | #include 3 | #include 4 | 5 | #include "script.h" 6 | #include "key.h" 7 | 8 | using namespace std; 9 | 10 | // Helpers: 11 | static std::vector 12 | Serialize(const CScript& s) 13 | { 14 | std::vector sSerialized(s); 15 | return sSerialized; 16 | } 17 | 18 | BOOST_AUTO_TEST_SUITE(sigopcount_tests) 19 | 20 | BOOST_AUTO_TEST_CASE(GetSigOpCount) 21 | { 22 | // Test CScript::GetSigOpCount() 23 | CScript s1; 24 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 0U); 25 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 0U); 26 | 27 | uint160 dummy; 28 | s1 << OP_1 << dummy << dummy << OP_2 << OP_CHECKMULTISIG; 29 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 2U); 30 | s1 << OP_IF << OP_CHECKSIG << OP_ENDIF; 31 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3U); 32 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21U); 33 | 34 | CScript p2sh; 35 | p2sh.SetDestination(s1.GetID()); 36 | CScript scriptSig; 37 | scriptSig << OP_0 << Serialize(s1); 38 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig), 3U); 39 | 40 | std::vector keys; 41 | for (int i = 0; i < 3; i++) 42 | { 43 | CKey k; 44 | k.MakeNewKey(true); 45 | keys.push_back(k.GetPubKey()); 46 | } 47 | CScript s2; 48 | s2.SetMultisig(1, keys); 49 | BOOST_CHECK_EQUAL(s2.GetSigOpCount(true), 3U); 50 | BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20U); 51 | 52 | p2sh.SetDestination(s2.GetID()); 53 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0U); 54 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0U); 55 | CScript scriptSig2; 56 | scriptSig2 << OP_1 << dummy << dummy << Serialize(s2); 57 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3U); 58 | } 59 | 60 | BOOST_AUTO_TEST_SUITE_END() 61 | -------------------------------------------------------------------------------- /src/leveldb/README: -------------------------------------------------------------------------------- 1 | leveldb: A key-value store 2 | Authors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com) 3 | 4 | The code under this directory implements a system for maintaining a 5 | persistent key/value store. 6 | 7 | See doc/index.html for more explanation. 8 | See doc/impl.html for a brief overview of the implementation. 9 | 10 | The public interface is in include/*.h. Callers should not include or 11 | rely on the details of any other header files in this package. Those 12 | internal APIs may be changed without warning. 13 | 14 | Guide to header files: 15 | 16 | include/db.h 17 | Main interface to the DB: Start here 18 | 19 | include/options.h 20 | Control over the behavior of an entire database, and also 21 | control over the behavior of individual reads and writes. 22 | 23 | include/comparator.h 24 | Abstraction for user-specified comparison function. If you want 25 | just bytewise comparison of keys, you can use the default comparator, 26 | but clients can write their own comparator implementations if they 27 | want custom ordering (e.g. to handle different character 28 | encodings, etc.) 29 | 30 | include/iterator.h 31 | Interface for iterating over data. You can get an iterator 32 | from a DB object. 33 | 34 | include/write_batch.h 35 | Interface for atomically applying multiple updates to a database. 36 | 37 | include/slice.h 38 | A simple module for maintaining a pointer and a length into some 39 | other byte array. 40 | 41 | include/status.h 42 | Status is returned from many of the public interfaces and is used 43 | to report success and various kinds of errors. 44 | 45 | include/env.h 46 | Abstraction of the OS environment. A posix implementation of 47 | this interface is in util/env_posix.cc 48 | 49 | include/table.h 50 | include/table_builder.h 51 | Lower-level modules that most clients probably won't use directly 52 | -------------------------------------------------------------------------------- /src/qt/bitcoinamountfield.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOINAMOUNTFIELD_H 6 | #define BITCOINAMOUNTFIELD_H 7 | 8 | #include 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QDoubleSpinBox; 12 | class QValueComboBox; 13 | QT_END_NAMESPACE 14 | 15 | /** Widget for entering bitcoin amounts. 16 | */ 17 | class BitcoinAmountField: public QWidget 18 | { 19 | Q_OBJECT 20 | 21 | Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) 22 | 23 | public: 24 | explicit BitcoinAmountField(QWidget *parent = 0); 25 | 26 | qint64 value(bool *valid=0) const; 27 | void setValue(qint64 value); 28 | 29 | /** Mark current value as invalid in UI. */ 30 | void setValid(bool valid); 31 | /** Perform input validation, mark field as invalid if entered value is not valid. */ 32 | bool validate(); 33 | 34 | /** Change unit used to display amount. */ 35 | void setDisplayUnit(int unit); 36 | 37 | /** Make field empty and ready for new input. */ 38 | void clear(); 39 | 40 | /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), 41 | in these cases we have to set it up manually. 42 | */ 43 | QWidget *setupTabChain(QWidget *prev); 44 | 45 | signals: 46 | void textChanged(); 47 | 48 | protected: 49 | /** Intercept focus-in event and ',' key presses */ 50 | bool eventFilter(QObject *object, QEvent *event); 51 | 52 | private: 53 | QDoubleSpinBox *amount; 54 | QValueComboBox *unit; 55 | int currentUnit; 56 | 57 | void setText(const QString &text); 58 | QString text() const; 59 | 60 | private slots: 61 | void unitChanged(int idx); 62 | 63 | }; 64 | 65 | #endif // BITCOINAMOUNTFIELD_H 66 | -------------------------------------------------------------------------------- /doc/README.md: -------------------------------------------------------------------------------- 1 | Speedcoin 1.0.x 2 | ==================== 3 | 4 | Copyright (c) 2009-2013 Bitcoin Developers 5 | Copyright (c) 2011-2013 Litecoin Developers 6 | Copyright (c) 2014 Speedcoin Developers 7 | 8 | Distributed under the MIT/X11 software license, see the accompanying 9 | file COPYING or http://www.opensource.org/licenses/mit-license.php. 10 | This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes 11 | cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. 12 | 13 | 14 | Intro 15 | --------------------- 16 | Speedcoin is a free open source peer-to-peer electronic cash system that is 17 | completely decentralized, without the need for a central server or trusted 18 | parties. Users hold the crypto keys to their own money and transact directly 19 | with each other, with the help of a P2P network to check for double-spending. 20 | 21 | 22 | Setup 23 | --------------------- 24 | You need the Qt4 run-time libraries to run Speedcoin-Qt. On Debian or Ubuntu: 25 | `sudo apt-get install libqtgui4` 26 | 27 | Unpack the files into a directory and run: 28 | 29 | - bin/32/speedcoin-qt (GUI, 32-bit) 30 | - bin/32/speedcoind (headless, 32-bit) 31 | - bin/64/speedcoin-qt (GUI, 64-bit) 32 | - bin/64/speedcoind (headless, 64-bit) 33 | 34 | See the documentation at the [Speedcoin Wiki](http://speedcoin.co) 35 | for help and more information. 36 | 37 | 38 | Other Pages 39 | --------------------- 40 | - [Unix Build Notes](build-unix.md) 41 | - [OSX Build Notes](build-osx.md) 42 | - [Windows Build Notes](build-msw.md) 43 | - [Coding Guidelines](coding.md) 44 | - [Release Process](release-process.md) 45 | - [Release Notes](release-notes.md) 46 | - [Multiwallet Qt Development](multiwallet-qt.md) 47 | - [Unit Tests](unit-tests.md) 48 | - [Translation Process](translation_process.md) 49 | -------------------------------------------------------------------------------- /src/leveldb/db/snapshot.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_SNAPSHOT_H_ 6 | #define STORAGE_LEVELDB_DB_SNAPSHOT_H_ 7 | 8 | #include "leveldb/db.h" 9 | 10 | namespace leveldb { 11 | 12 | class SnapshotList; 13 | 14 | // Snapshots are kept in a doubly-linked list in the DB. 15 | // Each SnapshotImpl corresponds to a particular sequence number. 16 | class SnapshotImpl : public Snapshot { 17 | public: 18 | SequenceNumber number_; // const after creation 19 | 20 | private: 21 | friend class SnapshotList; 22 | 23 | // SnapshotImpl is kept in a doubly-linked circular list 24 | SnapshotImpl* prev_; 25 | SnapshotImpl* next_; 26 | 27 | SnapshotList* list_; // just for sanity checks 28 | }; 29 | 30 | class SnapshotList { 31 | public: 32 | SnapshotList() { 33 | list_.prev_ = &list_; 34 | list_.next_ = &list_; 35 | } 36 | 37 | bool empty() const { return list_.next_ == &list_; } 38 | SnapshotImpl* oldest() const { assert(!empty()); return list_.next_; } 39 | SnapshotImpl* newest() const { assert(!empty()); return list_.prev_; } 40 | 41 | const SnapshotImpl* New(SequenceNumber seq) { 42 | SnapshotImpl* s = new SnapshotImpl; 43 | s->number_ = seq; 44 | s->list_ = this; 45 | s->next_ = &list_; 46 | s->prev_ = list_.prev_; 47 | s->prev_->next_ = s; 48 | s->next_->prev_ = s; 49 | return s; 50 | } 51 | 52 | void Delete(const SnapshotImpl* s) { 53 | assert(s->list_ == this); 54 | s->prev_->next_ = s->next_; 55 | s->next_->prev_ = s->prev_; 56 | delete s; 57 | } 58 | 59 | private: 60 | // Dummy head of doubly-linked list of snapshots 61 | SnapshotImpl list_; 62 | }; 63 | 64 | } // namespace leveldb 65 | 66 | #endif // STORAGE_LEVELDB_DB_SNAPSHOT_H_ 67 | -------------------------------------------------------------------------------- /src/test/compress_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include "main.h" 7 | 8 | // amounts 0.00000001 .. 0.00100000 9 | #define NUM_MULTIPLES_UNIT 100000 10 | 11 | // amounts 0.01 .. 100.00 12 | #define NUM_MULTIPLES_CENT 10000 13 | 14 | // amounts 1 .. 10000 15 | #define NUM_MULTIPLES_1BTC 10000 16 | 17 | // amounts 50 .. 21000000 18 | #define NUM_MULTIPLES_50BTC 420000 19 | 20 | using namespace std; 21 | 22 | BOOST_AUTO_TEST_SUITE(compress_tests) 23 | 24 | bool static TestEncode(uint64 in) { 25 | return in == CTxOutCompressor::DecompressAmount(CTxOutCompressor::CompressAmount(in)); 26 | } 27 | 28 | bool static TestDecode(uint64 in) { 29 | return in == CTxOutCompressor::CompressAmount(CTxOutCompressor::DecompressAmount(in)); 30 | } 31 | 32 | bool static TestPair(uint64 dec, uint64 enc) { 33 | return CTxOutCompressor::CompressAmount(dec) == enc && 34 | CTxOutCompressor::DecompressAmount(enc) == dec; 35 | } 36 | 37 | BOOST_AUTO_TEST_CASE(compress_amounts) 38 | { 39 | BOOST_CHECK(TestPair( 0, 0x0)); 40 | BOOST_CHECK(TestPair( 1, 0x1)); 41 | BOOST_CHECK(TestPair( CENT, 0x7)); 42 | BOOST_CHECK(TestPair( COIN, 0x9)); 43 | BOOST_CHECK(TestPair( 50*COIN, 0x32)); 44 | BOOST_CHECK(TestPair(21000000*COIN, 0x1406f40)); 45 | 46 | for (uint64 i = 1; i <= NUM_MULTIPLES_UNIT; i++) 47 | BOOST_CHECK(TestEncode(i)); 48 | 49 | for (uint64 i = 1; i <= NUM_MULTIPLES_CENT; i++) 50 | BOOST_CHECK(TestEncode(i * CENT)); 51 | 52 | for (uint64 i = 1; i <= NUM_MULTIPLES_1BTC; i++) 53 | BOOST_CHECK(TestEncode(i * COIN)); 54 | 55 | for (uint64 i = 1; i <= NUM_MULTIPLES_50BTC; i++) 56 | BOOST_CHECK(TestEncode(i * 50 * COIN)); 57 | 58 | for (uint64 i = 0; i < 100000; i++) 59 | BOOST_CHECK(TestDecode(i)); 60 | } 61 | 62 | BOOST_AUTO_TEST_SUITE_END() 63 | -------------------------------------------------------------------------------- /src/qt/optionsdialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef OPTIONSDIALOG_H 6 | #define OPTIONSDIALOG_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class OptionsDialog; 12 | } 13 | class OptionsModel; 14 | class MonitoredDataMapper; 15 | class QValidatedLineEdit; 16 | 17 | /** Preferences dialog. */ 18 | class OptionsDialog : public QDialog 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit OptionsDialog(QWidget *parent = 0); 24 | ~OptionsDialog(); 25 | 26 | void setModel(OptionsModel *model); 27 | void setMapper(); 28 | 29 | protected: 30 | bool eventFilter(QObject *object, QEvent *event); 31 | 32 | private slots: 33 | /* enable only apply button */ 34 | void enableApplyButton(); 35 | /* disable only apply button */ 36 | void disableApplyButton(); 37 | /* enable apply button and OK button */ 38 | void enableSaveButtons(); 39 | /* disable apply button and OK button */ 40 | void disableSaveButtons(); 41 | /* set apply button and OK button state (enabled / disabled) */ 42 | void setSaveButtonState(bool fState); 43 | void on_resetButton_clicked(); 44 | void on_okButton_clicked(); 45 | void on_cancelButton_clicked(); 46 | void on_applyButton_clicked(); 47 | 48 | void showRestartWarning_Proxy(); 49 | void showRestartWarning_Lang(); 50 | void updateDisplayUnit(); 51 | void handleProxyIpValid(QValidatedLineEdit *object, bool fState); 52 | 53 | signals: 54 | void proxyIpValid(QValidatedLineEdit *object, bool fValid); 55 | 56 | private: 57 | Ui::OptionsDialog *ui; 58 | OptionsModel *model; 59 | MonitoredDataMapper *mapper; 60 | bool fRestartWarningDisplayed_Proxy; 61 | bool fRestartWarningDisplayed_Lang; 62 | bool fProxyIpValid; 63 | }; 64 | 65 | #endif // OPTIONSDIALOG_H 66 | -------------------------------------------------------------------------------- /src/qt/res/speedcoin-qt.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icons/speedcoin.ico" 2 | IDI_ICON2 ICON DISCARDABLE "icons/speedcoin_testnet.ico" 3 | 4 | #include // needed for VERSIONINFO 5 | #include "../../clientversion.h" // holds the needed client version information 6 | 7 | #define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD 8 | #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) 9 | #define VER_FILEVERSION VER_PRODUCTVERSION 10 | #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR 11 | #define COPYRIGHT_STR STRINGIZE(COPYRIGHT_YEAR) " The Speedcoin developers" 12 | 13 | VS_VERSION_INFO VERSIONINFO 14 | FILEVERSION VER_FILEVERSION 15 | PRODUCTVERSION VER_PRODUCTVERSION 16 | FILEOS VOS_NT_WINDOWS32 17 | FILETYPE VFT_APP 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "040904E4" // U.S. English - multilingual (hex) 22 | BEGIN 23 | VALUE "CompanyName", "Speedcoin" 24 | VALUE "FileDescription", "Speedcoin-Qt (OSS GUI client for Speedcoin)" 25 | VALUE "FileVersion", VER_FILEVERSION_STR 26 | VALUE "InternalName", "speedcoin-qt" 27 | VALUE "LegalCopyright", COPYRIGHT_STR 28 | VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." 29 | VALUE "OriginalFilename", "speedcoin-qt.exe" 30 | VALUE "ProductName", "Speedcoin-Qt" 31 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 32 | END 33 | END 34 | 35 | BLOCK "VarFileInfo" 36 | BEGIN 37 | VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) 38 | END 39 | END 40 | -------------------------------------------------------------------------------- /src/leveldb/util/arena_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/arena.h" 6 | 7 | #include "util/random.h" 8 | #include "util/testharness.h" 9 | 10 | namespace leveldb { 11 | 12 | class ArenaTest { }; 13 | 14 | TEST(ArenaTest, Empty) { 15 | Arena arena; 16 | } 17 | 18 | TEST(ArenaTest, Simple) { 19 | std::vector > allocated; 20 | Arena arena; 21 | const int N = 100000; 22 | size_t bytes = 0; 23 | Random rnd(301); 24 | for (int i = 0; i < N; i++) { 25 | size_t s; 26 | if (i % (N / 10) == 0) { 27 | s = i; 28 | } else { 29 | s = rnd.OneIn(4000) ? rnd.Uniform(6000) : 30 | (rnd.OneIn(10) ? rnd.Uniform(100) : rnd.Uniform(20)); 31 | } 32 | if (s == 0) { 33 | // Our arena disallows size 0 allocations. 34 | s = 1; 35 | } 36 | char* r; 37 | if (rnd.OneIn(10)) { 38 | r = arena.AllocateAligned(s); 39 | } else { 40 | r = arena.Allocate(s); 41 | } 42 | 43 | for (int b = 0; b < s; b++) { 44 | // Fill the "i"th allocation with a known bit pattern 45 | r[b] = i % 256; 46 | } 47 | bytes += s; 48 | allocated.push_back(std::make_pair(s, r)); 49 | ASSERT_GE(arena.MemoryUsage(), bytes); 50 | if (i > N/10) { 51 | ASSERT_LE(arena.MemoryUsage(), bytes * 1.10); 52 | } 53 | } 54 | for (int i = 0; i < allocated.size(); i++) { 55 | size_t num_bytes = allocated[i].first; 56 | const char* p = allocated[i].second; 57 | for (int b = 0; b < num_bytes; b++) { 58 | // Check the "i"th allocation for the known bit pattern 59 | ASSERT_EQ(int(p[b]) & 0xff, i % 256); 60 | } 61 | } 62 | } 63 | 64 | } // namespace leveldb 65 | 66 | int main(int argc, char** argv) { 67 | return leveldb::test::RunAllTests(); 68 | } 69 | -------------------------------------------------------------------------------- /src/leveldb/util/testutil.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 6 | #define STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 7 | 8 | #include "leveldb/env.h" 9 | #include "leveldb/slice.h" 10 | #include "util/random.h" 11 | 12 | namespace leveldb { 13 | namespace test { 14 | 15 | // Store in *dst a random string of length "len" and return a Slice that 16 | // references the generated data. 17 | extern Slice RandomString(Random* rnd, int len, std::string* dst); 18 | 19 | // Return a random key with the specified length that may contain interesting 20 | // characters (e.g. \x00, \xff, etc.). 21 | extern std::string RandomKey(Random* rnd, int len); 22 | 23 | // Store in *dst a string of length "len" that will compress to 24 | // "N*compressed_fraction" bytes and return a Slice that references 25 | // the generated data. 26 | extern Slice CompressibleString(Random* rnd, double compressed_fraction, 27 | int len, std::string* dst); 28 | 29 | // A wrapper that allows injection of errors. 30 | class ErrorEnv : public EnvWrapper { 31 | public: 32 | bool writable_file_error_; 33 | int num_writable_file_errors_; 34 | 35 | ErrorEnv() : EnvWrapper(Env::Default()), 36 | writable_file_error_(false), 37 | num_writable_file_errors_(0) { } 38 | 39 | virtual Status NewWritableFile(const std::string& fname, 40 | WritableFile** result) { 41 | if (writable_file_error_) { 42 | ++num_writable_file_errors_; 43 | *result = NULL; 44 | return Status::IOError(fname, "fake error"); 45 | } 46 | return target()->NewWritableFile(fname, result); 47 | } 48 | }; 49 | 50 | } // namespace test 51 | } // namespace leveldb 52 | 53 | #endif // STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 54 | -------------------------------------------------------------------------------- /src/leveldb/table/iterator.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/iterator.h" 6 | 7 | namespace leveldb { 8 | 9 | Iterator::Iterator() { 10 | cleanup_.function = NULL; 11 | cleanup_.next = NULL; 12 | } 13 | 14 | Iterator::~Iterator() { 15 | if (cleanup_.function != NULL) { 16 | (*cleanup_.function)(cleanup_.arg1, cleanup_.arg2); 17 | for (Cleanup* c = cleanup_.next; c != NULL; ) { 18 | (*c->function)(c->arg1, c->arg2); 19 | Cleanup* next = c->next; 20 | delete c; 21 | c = next; 22 | } 23 | } 24 | } 25 | 26 | void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) { 27 | assert(func != NULL); 28 | Cleanup* c; 29 | if (cleanup_.function == NULL) { 30 | c = &cleanup_; 31 | } else { 32 | c = new Cleanup; 33 | c->next = cleanup_.next; 34 | cleanup_.next = c; 35 | } 36 | c->function = func; 37 | c->arg1 = arg1; 38 | c->arg2 = arg2; 39 | } 40 | 41 | namespace { 42 | class EmptyIterator : public Iterator { 43 | public: 44 | EmptyIterator(const Status& s) : status_(s) { } 45 | virtual bool Valid() const { return false; } 46 | virtual void Seek(const Slice& target) { } 47 | virtual void SeekToFirst() { } 48 | virtual void SeekToLast() { } 49 | virtual void Next() { assert(false); } 50 | virtual void Prev() { assert(false); } 51 | Slice key() const { assert(false); return Slice(); } 52 | Slice value() const { assert(false); return Slice(); } 53 | virtual Status status() const { return status_; } 54 | private: 55 | Status status_; 56 | }; 57 | } // namespace 58 | 59 | Iterator* NewEmptyIterator() { 60 | return new EmptyIterator(Status::OK()); 61 | } 62 | 63 | Iterator* NewErrorIterator(const Status& status) { 64 | return new EmptyIterator(status); 65 | } 66 | 67 | } // namespace leveldb 68 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/boost-linux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "boost" 3 | suites: 4 | - "precise" 5 | architectures: 6 | - "i386" 7 | - "amd64" 8 | packages: 9 | - "g++" 10 | - "unzip" 11 | - "pkg-config" 12 | - "libtool" 13 | - "faketime" 14 | - "bsdmainutils" 15 | - "zip" 16 | - "libz-dev" 17 | reference_datetime: "2011-01-30 00:00:00" 18 | remotes: [] 19 | files: 20 | - "boost_1_55_0.tar.bz2" 21 | script: | 22 | STAGING="$HOME/install" 23 | TEMPDIR="$HOME/tmp" 24 | export LIBRARY_PATH="$STAGING/lib" 25 | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 26 | export FAKETIME=$REFERENCE_DATETIME 27 | export TZ=UTC 28 | # Input Integrity Check 29 | echo "fff00023dd79486d444c8e29922f4072e1d451fc5a4d2b6075852ead7f2b7b52 boost_1_55_0.tar.bz2" | shasum -c 30 | 31 | mkdir -p "$STAGING" 32 | tar --warning=no-timestamp -xjf boost_1_55_0.tar.bz2 33 | cd boost_1_55_0 34 | GCCVERSION=$(g++ -E -dM $(mktemp --suffix=.h) | grep __VERSION__ | cut -d ' ' -f 3 | cut -d '"' -f 2) 35 | # note: bjam with -d+2 reveals that -O3 is implied by default, no need to provide it in cxxflags 36 | echo "using gcc : $GCCVERSION : g++ 37 | : 38 | \"-frandom-seed=boost1 -fPIC\" 39 | ;" > user-config.jam 40 | 41 | ./bootstrap.sh --without-icu 42 | 43 | ./bjam toolset=gcc threadapi=pthread threading=multi variant=release link=static runtime-link=shared --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 --layout=tagged --build-type=complete --prefix="$STAGING" $MAKEOPTS -d+2 install 44 | 45 | # post-process all generated libraries to be deterministic 46 | # extract them to a temporary directory then re-build them deterministically 47 | for LIB in $(find $STAGING -name \*.a); do 48 | rm -rf $TEMPDIR && mkdir $TEMPDIR && cd $TEMPDIR 49 | ar xv $LIB | cut -b5- > /tmp/list.txt 50 | rm $LIB 51 | ar crsD $LIB $(cat /tmp/list.txt) 52 | done 53 | # 54 | cd "$STAGING" 55 | find | sort | zip -X@ $OUTDIR/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip 56 | 57 | -------------------------------------------------------------------------------- /src/leveldb/util/testharness.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/testharness.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace leveldb { 13 | namespace test { 14 | 15 | namespace { 16 | struct Test { 17 | const char* base; 18 | const char* name; 19 | void (*func)(); 20 | }; 21 | std::vector* tests; 22 | } 23 | 24 | bool RegisterTest(const char* base, const char* name, void (*func)()) { 25 | if (tests == NULL) { 26 | tests = new std::vector; 27 | } 28 | Test t; 29 | t.base = base; 30 | t.name = name; 31 | t.func = func; 32 | tests->push_back(t); 33 | return true; 34 | } 35 | 36 | int RunAllTests() { 37 | const char* matcher = getenv("LEVELDB_TESTS"); 38 | 39 | int num = 0; 40 | if (tests != NULL) { 41 | for (int i = 0; i < tests->size(); i++) { 42 | const Test& t = (*tests)[i]; 43 | if (matcher != NULL) { 44 | std::string name = t.base; 45 | name.push_back('.'); 46 | name.append(t.name); 47 | if (strstr(name.c_str(), matcher) == NULL) { 48 | continue; 49 | } 50 | } 51 | fprintf(stderr, "==== Test %s.%s\n", t.base, t.name); 52 | (*t.func)(); 53 | ++num; 54 | } 55 | } 56 | fprintf(stderr, "==== PASSED %d tests\n", num); 57 | return 0; 58 | } 59 | 60 | std::string TmpDir() { 61 | std::string dir; 62 | Status s = Env::Default()->GetTestDirectory(&dir); 63 | ASSERT_TRUE(s.ok()) << s.ToString(); 64 | return dir; 65 | } 66 | 67 | int RandomSeed() { 68 | const char* env = getenv("TEST_RANDOM_SEED"); 69 | int result = (env != NULL ? atoi(env) : 301); 70 | if (result <= 0) { 71 | result = 301; 72 | } 73 | return result; 74 | } 75 | 76 | } // namespace test 77 | } // namespace leveldb 78 | -------------------------------------------------------------------------------- /src/leveldb/table/block_builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 7 | 8 | #include 9 | 10 | #include 11 | #include "leveldb/slice.h" 12 | 13 | namespace leveldb { 14 | 15 | struct Options; 16 | 17 | class BlockBuilder { 18 | public: 19 | explicit BlockBuilder(const Options* options); 20 | 21 | // Reset the contents as if the BlockBuilder was just constructed. 22 | void Reset(); 23 | 24 | // REQUIRES: Finish() has not been callled since the last call to Reset(). 25 | // REQUIRES: key is larger than any previously added key 26 | void Add(const Slice& key, const Slice& value); 27 | 28 | // Finish building the block and return a slice that refers to the 29 | // block contents. The returned slice will remain valid for the 30 | // lifetime of this builder or until Reset() is called. 31 | Slice Finish(); 32 | 33 | // Returns an estimate of the current (uncompressed) size of the block 34 | // we are building. 35 | size_t CurrentSizeEstimate() const; 36 | 37 | // Return true iff no entries have been added since the last Reset() 38 | bool empty() const { 39 | return buffer_.empty(); 40 | } 41 | 42 | private: 43 | const Options* options_; 44 | std::string buffer_; // Destination buffer 45 | std::vector restarts_; // Restart points 46 | int counter_; // Number of entries emitted since restart 47 | bool finished_; // Has Finish() been called? 48 | std::string last_key_; 49 | 50 | // No copying allowed 51 | BlockBuilder(const BlockBuilder&); 52 | void operator=(const BlockBuilder&); 53 | }; 54 | 55 | } // namespace leveldb 56 | 57 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 58 | -------------------------------------------------------------------------------- /src/json/json_spirit_stream_reader.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_READ_STREAM 2 | #define JSON_SPIRIT_READ_STREAM 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include "json_spirit_reader_template.h" 14 | 15 | namespace json_spirit 16 | { 17 | // these classes allows you to read multiple top level contiguous values from a stream, 18 | // the normal stream read functions have a bug that prevent multiple top level values 19 | // from being read unless they are separated by spaces 20 | 21 | template< class Istream_type, class Value_type > 22 | class Stream_reader 23 | { 24 | public: 25 | 26 | Stream_reader( Istream_type& is ) 27 | : iters_( is ) 28 | { 29 | } 30 | 31 | bool read_next( Value_type& value ) 32 | { 33 | return read_range( iters_.begin_, iters_.end_, value ); 34 | } 35 | 36 | private: 37 | 38 | typedef Multi_pass_iters< Istream_type > Mp_iters; 39 | 40 | Mp_iters iters_; 41 | }; 42 | 43 | template< class Istream_type, class Value_type > 44 | class Stream_reader_thrower 45 | { 46 | public: 47 | 48 | Stream_reader_thrower( Istream_type& is ) 49 | : iters_( is ) 50 | , posn_begin_( iters_.begin_, iters_.end_ ) 51 | , posn_end_( iters_.end_, iters_.end_ ) 52 | { 53 | } 54 | 55 | void read_next( Value_type& value ) 56 | { 57 | posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value ); 58 | } 59 | 60 | private: 61 | 62 | typedef Multi_pass_iters< Istream_type > Mp_iters; 63 | typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t; 64 | 65 | Mp_iters iters_; 66 | Posn_iter_t posn_begin_, posn_end_; 67 | }; 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/test/test_bitcoin.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE Speedcoin Test Suite 2 | #include 3 | #include 4 | 5 | #include "db.h" 6 | #include "txdb.h" 7 | #include "main.h" 8 | #include "wallet.h" 9 | #include "util.h" 10 | 11 | CWallet* pwalletMain; 12 | CClientUIInterface uiInterface; 13 | 14 | extern bool fPrintToConsole; 15 | extern void noui_connect(); 16 | 17 | struct TestingSetup { 18 | CCoinsViewDB *pcoinsdbview; 19 | boost::filesystem::path pathTemp; 20 | boost::thread_group threadGroup; 21 | 22 | TestingSetup() { 23 | fPrintToDebugger = true; // don't want to write to debug.log file 24 | noui_connect(); 25 | bitdb.MakeMock(); 26 | pathTemp = GetTempPath() / strprintf("test_speedcoin_%lu_%i", (unsigned long)GetTime(), (int)(GetRand(100000))); 27 | boost::filesystem::create_directories(pathTemp); 28 | mapArgs["-datadir"] = pathTemp.string(); 29 | pblocktree = new CBlockTreeDB(1 << 20, true); 30 | pcoinsdbview = new CCoinsViewDB(1 << 23, true); 31 | pcoinsTip = new CCoinsViewCache(*pcoinsdbview); 32 | InitBlockIndex(); 33 | bool fFirstRun; 34 | pwalletMain = new CWallet("wallet.dat"); 35 | pwalletMain->LoadWallet(fFirstRun); 36 | RegisterWallet(pwalletMain); 37 | nScriptCheckThreads = 3; 38 | for (int i=0; i < nScriptCheckThreads-1; i++) 39 | threadGroup.create_thread(&ThreadScriptCheck); 40 | } 41 | ~TestingSetup() 42 | { 43 | threadGroup.interrupt_all(); 44 | threadGroup.join_all(); 45 | delete pwalletMain; 46 | pwalletMain = NULL; 47 | delete pcoinsTip; 48 | delete pcoinsdbview; 49 | delete pblocktree; 50 | bitdb.Flush(true); 51 | boost::filesystem::remove_all(pathTemp); 52 | } 53 | }; 54 | 55 | BOOST_GLOBAL_FIXTURE(TestingSetup); 56 | 57 | void Shutdown(void* parg) 58 | { 59 | exit(0); 60 | } 61 | 62 | void StartShutdown() 63 | { 64 | exit(0); 65 | } 66 | 67 | -------------------------------------------------------------------------------- /src/qt/rpcconsole.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef RPCCONSOLE_H 6 | #define RPCCONSOLE_H 7 | 8 | #include 9 | 10 | namespace Ui { 11 | class RPCConsole; 12 | } 13 | class ClientModel; 14 | 15 | /** Local Bitcoin RPC console. */ 16 | class RPCConsole: public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit RPCConsole(QWidget *parent = 0); 22 | ~RPCConsole(); 23 | 24 | void setClientModel(ClientModel *model); 25 | 26 | enum MessageClass { 27 | MC_ERROR, 28 | MC_DEBUG, 29 | CMD_REQUEST, 30 | CMD_REPLY, 31 | CMD_ERROR 32 | }; 33 | 34 | protected: 35 | virtual bool eventFilter(QObject* obj, QEvent *event); 36 | 37 | private slots: 38 | void on_lineEdit_returnPressed(); 39 | void on_tabWidget_currentChanged(int index); 40 | /** open the debug.log from the current datadir */ 41 | void on_openDebugLogfileButton_clicked(); 42 | /** display messagebox with program parameters (same as bitcoin-qt --help) */ 43 | void on_showCLOptionsButton_clicked(); 44 | 45 | public slots: 46 | void clear(); 47 | void message(int category, const QString &message, bool html = false); 48 | /** Set number of connections shown in the UI */ 49 | void setNumConnections(int count); 50 | /** Set number of blocks shown in the UI */ 51 | void setNumBlocks(int count, int countOfPeers); 52 | /** Go forward or back in history */ 53 | void browseHistory(int offset); 54 | /** Scroll console view to end */ 55 | void scrollToEnd(); 56 | signals: 57 | // For RPC command executor 58 | void stopExecutor(); 59 | void cmdRequest(const QString &command); 60 | 61 | private: 62 | Ui::RPCConsole *ui; 63 | ClientModel *clientModel; 64 | QStringList history; 65 | int historyPtr; 66 | 67 | void startExecutor(); 68 | }; 69 | 70 | #endif // RPCCONSOLE_H 71 | -------------------------------------------------------------------------------- /src/leveldb/util/crc32c_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/crc32c.h" 6 | #include "util/testharness.h" 7 | 8 | namespace leveldb { 9 | namespace crc32c { 10 | 11 | class CRC { }; 12 | 13 | TEST(CRC, StandardResults) { 14 | // From rfc3720 section B.4. 15 | char buf[32]; 16 | 17 | memset(buf, 0, sizeof(buf)); 18 | ASSERT_EQ(0x8a9136aa, Value(buf, sizeof(buf))); 19 | 20 | memset(buf, 0xff, sizeof(buf)); 21 | ASSERT_EQ(0x62a8ab43, Value(buf, sizeof(buf))); 22 | 23 | for (int i = 0; i < 32; i++) { 24 | buf[i] = i; 25 | } 26 | ASSERT_EQ(0x46dd794e, Value(buf, sizeof(buf))); 27 | 28 | for (int i = 0; i < 32; i++) { 29 | buf[i] = 31 - i; 30 | } 31 | ASSERT_EQ(0x113fdb5c, Value(buf, sizeof(buf))); 32 | 33 | unsigned char data[48] = { 34 | 0x01, 0xc0, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 38 | 0x14, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x04, 0x00, 40 | 0x00, 0x00, 0x00, 0x14, 41 | 0x00, 0x00, 0x00, 0x18, 42 | 0x28, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 44 | 0x02, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 46 | }; 47 | ASSERT_EQ(0xd9963a56, Value(reinterpret_cast(data), sizeof(data))); 48 | } 49 | 50 | TEST(CRC, Values) { 51 | ASSERT_NE(Value("a", 1), Value("foo", 3)); 52 | } 53 | 54 | TEST(CRC, Extend) { 55 | ASSERT_EQ(Value("hello world", 11), 56 | Extend(Value("hello ", 6), "world", 5)); 57 | } 58 | 59 | TEST(CRC, Mask) { 60 | uint32_t crc = Value("foo", 3); 61 | ASSERT_NE(crc, Mask(crc)); 62 | ASSERT_NE(crc, Mask(Mask(crc))); 63 | ASSERT_EQ(crc, Unmask(Mask(crc))); 64 | ASSERT_EQ(crc, Unmask(Unmask(Mask(Mask(crc))))); 65 | } 66 | 67 | } // namespace crc32c 68 | } // namespace leveldb 69 | 70 | int main(int argc, char** argv) { 71 | return leveldb::test::RunAllTests(); 72 | } 73 | -------------------------------------------------------------------------------- /src/qt/forms/transactiondescdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TransactionDescDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 620 10 | 250 11 | 12 | 13 | 14 | Transaction details 15 | 16 | 17 | 18 | 19 | 20 | This pane shows a detailed description of the transaction 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | Qt::Horizontal 31 | 32 | 33 | QDialogButtonBox::Close 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | buttonBox 43 | accepted() 44 | TransactionDescDialog 45 | accept() 46 | 47 | 48 | 248 49 | 254 50 | 51 | 52 | 157 53 | 274 54 | 55 | 56 | 57 | 58 | buttonBox 59 | rejected() 60 | TransactionDescDialog 61 | reject() 62 | 63 | 64 | 316 65 | 260 66 | 67 | 68 | 286 69 | 274 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/leveldb/util/arena.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_ARENA_H_ 6 | #define STORAGE_LEVELDB_UTIL_ARENA_H_ 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | class Arena { 16 | public: 17 | Arena(); 18 | ~Arena(); 19 | 20 | // Return a pointer to a newly allocated memory block of "bytes" bytes. 21 | char* Allocate(size_t bytes); 22 | 23 | // Allocate memory with the normal alignment guarantees provided by malloc 24 | char* AllocateAligned(size_t bytes); 25 | 26 | // Returns an estimate of the total memory usage of data allocated 27 | // by the arena (including space allocated but not yet used for user 28 | // allocations). 29 | size_t MemoryUsage() const { 30 | return blocks_memory_ + blocks_.capacity() * sizeof(char*); 31 | } 32 | 33 | private: 34 | char* AllocateFallback(size_t bytes); 35 | char* AllocateNewBlock(size_t block_bytes); 36 | 37 | // Allocation state 38 | char* alloc_ptr_; 39 | size_t alloc_bytes_remaining_; 40 | 41 | // Array of new[] allocated memory blocks 42 | std::vector blocks_; 43 | 44 | // Bytes of memory in blocks allocated so far 45 | size_t blocks_memory_; 46 | 47 | // No copying allowed 48 | Arena(const Arena&); 49 | void operator=(const Arena&); 50 | }; 51 | 52 | inline char* Arena::Allocate(size_t bytes) { 53 | // The semantics of what to return are a bit messy if we allow 54 | // 0-byte allocations, so we disallow them here (we don't need 55 | // them for our internal use). 56 | assert(bytes > 0); 57 | if (bytes <= alloc_bytes_remaining_) { 58 | char* result = alloc_ptr_; 59 | alloc_ptr_ += bytes; 60 | alloc_bytes_remaining_ -= bytes; 61 | return result; 62 | } 63 | return AllocateFallback(bytes); 64 | } 65 | 66 | } // namespace leveldb 67 | 68 | #endif // STORAGE_LEVELDB_UTIL_ARENA_H_ 69 | -------------------------------------------------------------------------------- /src/test/checkblock_tests.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Unit tests for block.CheckBlock() 3 | // 4 | #include 5 | 6 | #include // for 'map_list_of()' 7 | #include 8 | #include 9 | #include 10 | 11 | #include "main.h" 12 | #include "wallet.h" 13 | #include "net.h" 14 | #include "util.h" 15 | 16 | BOOST_AUTO_TEST_SUITE(CheckBlock_tests) 17 | 18 | bool 19 | read_block(const std::string& filename, CBlock& block) 20 | { 21 | namespace fs = boost::filesystem; 22 | fs::path testFile = fs::current_path() / "test" / "data" / filename; 23 | #ifdef TEST_DATA_DIR 24 | if (!fs::exists(testFile)) 25 | { 26 | testFile = fs::path(BOOST_PP_STRINGIZE(TEST_DATA_DIR)) / filename; 27 | } 28 | #endif 29 | FILE* fp = fopen(testFile.string().c_str(), "rb"); 30 | if (!fp) return false; 31 | 32 | fseek(fp, 8, SEEK_SET); // skip msgheader/size 33 | 34 | CAutoFile filein = CAutoFile(fp, SER_DISK, CLIENT_VERSION); 35 | if (!filein) return false; 36 | 37 | filein >> block; 38 | 39 | return true; 40 | } 41 | 42 | BOOST_AUTO_TEST_CASE(May15) 43 | { 44 | // Putting a 1MB binary file in the git repository is not a great 45 | // idea, so this test is only run if you manually download 46 | // test/data/Mar12Fork.dat from 47 | // http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/Mar12Fork.dat/download 48 | unsigned int tMay15 = 1368576000; 49 | SetMockTime(tMay15); // Test as if it was right at May 15 50 | 51 | CBlock forkingBlock; 52 | if (read_block("Mar12Fork.dat", forkingBlock)) 53 | { 54 | CValidationState state; 55 | forkingBlock.nTime = tMay15-1; // Invalidates PoW 56 | BOOST_CHECK(!forkingBlock.CheckBlock(state, false, false)); 57 | 58 | // After May 15'th, big blocks are OK: 59 | forkingBlock.nTime = tMay15; // Invalidates PoW 60 | BOOST_CHECK(forkingBlock.CheckBlock(state, false, false)); 61 | } 62 | 63 | SetMockTime(0); 64 | } 65 | 66 | BOOST_AUTO_TEST_SUITE_END() 67 | -------------------------------------------------------------------------------- /src/leveldb/include/leveldb/write_batch.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // WriteBatch holds a collection of updates to apply atomically to a DB. 6 | // 7 | // The updates are applied in the order in which they are added 8 | // to the WriteBatch. For example, the value of "key" will be "v3" 9 | // after the following batch is written: 10 | // 11 | // batch.Put("key", "v1"); 12 | // batch.Delete("key"); 13 | // batch.Put("key", "v2"); 14 | // batch.Put("key", "v3"); 15 | // 16 | // Multiple threads can invoke const methods on a WriteBatch without 17 | // external synchronization, but if any of the threads may call a 18 | // non-const method, all threads accessing the same WriteBatch must use 19 | // external synchronization. 20 | 21 | #ifndef STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_ 22 | #define STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_ 23 | 24 | #include 25 | #include "leveldb/status.h" 26 | 27 | namespace leveldb { 28 | 29 | class Slice; 30 | 31 | class WriteBatch { 32 | public: 33 | WriteBatch(); 34 | ~WriteBatch(); 35 | 36 | // Store the mapping "key->value" in the database. 37 | void Put(const Slice& key, const Slice& value); 38 | 39 | // If the database contains a mapping for "key", erase it. Else do nothing. 40 | void Delete(const Slice& key); 41 | 42 | // Clear all updates buffered in this batch. 43 | void Clear(); 44 | 45 | // Support for iterating over the contents of a batch. 46 | class Handler { 47 | public: 48 | virtual ~Handler(); 49 | virtual void Put(const Slice& key, const Slice& value) = 0; 50 | virtual void Delete(const Slice& key) = 0; 51 | }; 52 | Status Iterate(Handler* handler) const; 53 | 54 | private: 55 | friend class WriteBatchInternal; 56 | 57 | std::string rep_; // See comment in write_batch.cc for the format of rep_ 58 | 59 | // Intentionally copyable 60 | }; 61 | 62 | } // namespace leveldb 63 | 64 | #endif // STORAGE_LEVELDB_INCLUDE_WRITE_BATCH_H_ 65 | -------------------------------------------------------------------------------- /share/qt/extract_strings_qt.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | ''' 3 | Extract _("...") strings for translation and convert to Qt4 stringdefs so that 4 | they can be picked up by Qt linguist. 5 | ''' 6 | from subprocess import Popen, PIPE 7 | import glob 8 | import operator 9 | 10 | OUT_CPP="src/qt/bitcoinstrings.cpp" 11 | EMPTY=['""'] 12 | 13 | def parse_po(text): 14 | """ 15 | Parse 'po' format produced by xgettext. 16 | Return a list of (msgid,msgstr) tuples. 17 | """ 18 | messages = [] 19 | msgid = [] 20 | msgstr = [] 21 | in_msgid = False 22 | in_msgstr = False 23 | 24 | for line in text.split('\n'): 25 | line = line.rstrip('\r') 26 | if line.startswith('msgid '): 27 | if in_msgstr: 28 | messages.append((msgid, msgstr)) 29 | in_msgstr = False 30 | # message start 31 | in_msgid = True 32 | 33 | msgid = [line[6:]] 34 | elif line.startswith('msgstr '): 35 | in_msgid = False 36 | in_msgstr = True 37 | msgstr = [line[7:]] 38 | elif line.startswith('"'): 39 | if in_msgid: 40 | msgid.append(line) 41 | if in_msgstr: 42 | msgstr.append(line) 43 | 44 | if in_msgstr: 45 | messages.append((msgid, msgstr)) 46 | 47 | return messages 48 | 49 | files = glob.glob('src/*.cpp') + glob.glob('src/*.h') 50 | 51 | # xgettext -n --keyword=_ $FILES 52 | child = Popen(['xgettext','--output=-','-n','--keyword=_'] + files, stdout=PIPE) 53 | (out, err) = child.communicate() 54 | 55 | messages = parse_po(out) 56 | 57 | f = open(OUT_CPP, 'w') 58 | f.write("""#include 59 | // Automatically generated by extract_strings.py 60 | #ifdef __GNUC__ 61 | #define UNUSED __attribute__((unused)) 62 | #else 63 | #define UNUSED 64 | #endif 65 | """) 66 | f.write('static const char UNUSED *bitcoin_strings[] = {\n') 67 | messages.sort(key=operator.itemgetter(0)) 68 | for (msgid, msgstr) in messages: 69 | if msgid != EMPTY: 70 | f.write('QT_TRANSLATE_NOOP("bitcoin-core", %s),\n' % ('\n'.join(msgid))) 71 | f.write('};') 72 | f.close() 73 | -------------------------------------------------------------------------------- /doc/build-unix.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2013 Bitcoin Developers 2 | 3 | Distributed under the MIT/X11 software license, see the accompanying 4 | file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | This product includes software developed by the OpenSSL Project for use in the [OpenSSL Toolkit](http://www.openssl.org/). This product includes 6 | cryptographic software written by Eric Young ([eay@cryptsoft.com](mailto:eay@cryptsoft.com)), and UPnP software written by Thomas Bernard. 7 | 8 | UNIX BUILD NOTES 9 | ==================== 10 | 11 | Step-by-Step Guide. Open Linux Terminal Window and run 12 | --------------------- 13 | 14 | su - # grant root access, need enter your login password 15 | apt-get install sudo 16 | sudo -i 17 | cd ~ 18 | apt-get update 19 | apt-get upgrade 20 | apt-get install git screen make automake build-essential libboost-all-dev 21 | apt-get install yasm binutils libcurl4-openssl-dev openssl libssl-dev 22 | wget http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz 23 | tar zxf db-4.8.30.NC.tar.gz 24 | cd db-4.8.30.NC/build_unix 25 | ../dist/configure --enable-cxx 26 | make 27 | sudo make install 28 | sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb-4.8.so /usr/lib/libdb-4.8.so 29 | sudo ln -s /usr/local/BerkeleyDB.4.8/lib/libdb_cxx-4.8.so /usr/lib/libdb_cxx-4.8.so 30 | export BDB_INCLUDE_PATH="/usr/local/BerkeleyDB.4.8/include" 31 | export BDB_LIB_PATH="/usr/local/BerkeleyDB.4.8/lib" 32 | cd ~ 33 | rm -R ~/db-4.8.30.NC* 34 | git clone https://github.com/spdcoin/speedcoin 35 | cd ~/speedcoin/src/leveldb 36 | sh build_detect_platform build_config.mk ./ 37 | cd .. 38 | make -f makefile.unix USE_UPNP=- 39 | cp speedcoind .. 40 | # start daemon server 41 | ~/speedcoin/speedcoind 42 | # 43 | # GUI Wallet 44 | cd ~/speedcoin 45 | sudo apt-get install libssl-dev libdb-dev libdb++-dev libqrencode-dev qt4-qmake libqtgui4 libqt4-dev 46 | sudo apt-get install libminiupnpc-dev libboost-all-dev build-essential git 47 | sed -i 's/-mgw48-mt-s-1_55//g' speedcoin-qt.pro 48 | qmake USE_UPNP=- #(on Ubuntu 14.04: run qmake-qt4 USE_UPNP=-) 49 | make 50 | # start gui speedcoin wallet 51 | ~/speedcoin/speedcoin-qt 52 | -------------------------------------------------------------------------------- /src/qt/paymentserver.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef PAYMENTSERVER_H 6 | #define PAYMENTSERVER_H 7 | 8 | // 9 | // This class handles payment requests from clicking on 10 | // bitcoin: URIs 11 | // 12 | // This is somewhat tricky, because we have to deal with 13 | // the situation where the user clicks on a link during 14 | // startup/initialization, when the splash-screen is up 15 | // but the main window (and the Send Coins tab) is not. 16 | // 17 | // So, the strategy is: 18 | // 19 | // Create the server, and register the event handler, 20 | // when the application is created. Save any URIs 21 | // received at or during startup in a list. 22 | // 23 | // When startup is finished and the main window is 24 | // show, a signal is sent to slot uiReady(), which 25 | // emits a receivedURL() signal for any payment 26 | // requests that happened during startup. 27 | // 28 | // After startup, receivedURL() happens as usual. 29 | // 30 | // This class has one more feature: a static 31 | // method that finds URIs passed in the command line 32 | // and, if a server is running in another process, 33 | // sends them to the server. 34 | // 35 | #include 36 | #include 37 | 38 | class QApplication; 39 | class QLocalServer; 40 | 41 | class PaymentServer : public QObject 42 | { 43 | Q_OBJECT 44 | 45 | private: 46 | bool saveURIs; 47 | QLocalServer* uriServer; 48 | 49 | public: 50 | // Returns true if there were URIs on the command line 51 | // which were successfully sent to an already-running 52 | // process. 53 | static bool ipcSendCommandLine(); 54 | 55 | PaymentServer(QApplication* parent); 56 | 57 | bool eventFilter(QObject *object, QEvent *event); 58 | 59 | signals: 60 | void receivedURI(QString); 61 | 62 | public slots: 63 | // Signal this when the main window's UI is ready 64 | // to display payment requests to the user 65 | void uiReady(); 66 | 67 | private slots: 68 | void handleURIConnection(); 69 | }; 70 | 71 | #endif // PAYMENTSERVER_H 72 | -------------------------------------------------------------------------------- /src/txdb.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef BITCOIN_TXDB_LEVELDB_H 6 | #define BITCOIN_TXDB_LEVELDB_H 7 | 8 | #include "main.h" 9 | #include "leveldb.h" 10 | 11 | /** CCoinsView backed by the LevelDB coin database (chainstate/) */ 12 | class CCoinsViewDB : public CCoinsView 13 | { 14 | protected: 15 | CLevelDB db; 16 | public: 17 | CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); 18 | 19 | bool GetCoins(const uint256 &txid, CCoins &coins); 20 | bool SetCoins(const uint256 &txid, const CCoins &coins); 21 | bool HaveCoins(const uint256 &txid); 22 | CBlockIndex *GetBestBlock(); 23 | bool SetBestBlock(CBlockIndex *pindex); 24 | bool BatchWrite(const std::map &mapCoins, CBlockIndex *pindex); 25 | bool GetStats(CCoinsStats &stats); 26 | }; 27 | 28 | /** Access to the block database (blocks/index/) */ 29 | class CBlockTreeDB : public CLevelDB 30 | { 31 | public: 32 | CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); 33 | private: 34 | CBlockTreeDB(const CBlockTreeDB&); 35 | void operator=(const CBlockTreeDB&); 36 | public: 37 | bool WriteBlockIndex(const CDiskBlockIndex& blockindex); 38 | bool ReadBestInvalidWork(CBigNum& bnBestInvalidWork); 39 | bool WriteBestInvalidWork(const CBigNum& bnBestInvalidWork); 40 | bool ReadBlockFileInfo(int nFile, CBlockFileInfo &fileinfo); 41 | bool WriteBlockFileInfo(int nFile, const CBlockFileInfo &fileinfo); 42 | bool ReadLastBlockFile(int &nFile); 43 | bool WriteLastBlockFile(int nFile); 44 | bool WriteReindexing(bool fReindex); 45 | bool ReadReindexing(bool &fReindex); 46 | bool ReadTxIndex(const uint256 &txid, CDiskTxPos &pos); 47 | bool WriteTxIndex(const std::vector > &list); 48 | bool WriteFlag(const std::string &name, bool fValue); 49 | bool ReadFlag(const std::string &name, bool &fValue); 50 | bool LoadBlockIndexGuts(); 51 | }; 52 | 53 | #endif // BITCOIN_TXDB_LEVELDB_H 54 | -------------------------------------------------------------------------------- /src/leveldb/util/logging.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/logging.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include "leveldb/env.h" 12 | #include "leveldb/slice.h" 13 | 14 | namespace leveldb { 15 | 16 | void AppendNumberTo(std::string* str, uint64_t num) { 17 | char buf[30]; 18 | snprintf(buf, sizeof(buf), "%llu", (unsigned long long) num); 19 | str->append(buf); 20 | } 21 | 22 | void AppendEscapedStringTo(std::string* str, const Slice& value) { 23 | for (size_t i = 0; i < value.size(); i++) { 24 | char c = value[i]; 25 | if (c >= ' ' && c <= '~') { 26 | str->push_back(c); 27 | } else { 28 | char buf[10]; 29 | snprintf(buf, sizeof(buf), "\\x%02x", 30 | static_cast(c) & 0xff); 31 | str->append(buf); 32 | } 33 | } 34 | } 35 | 36 | std::string NumberToString(uint64_t num) { 37 | std::string r; 38 | AppendNumberTo(&r, num); 39 | return r; 40 | } 41 | 42 | std::string EscapeString(const Slice& value) { 43 | std::string r; 44 | AppendEscapedStringTo(&r, value); 45 | return r; 46 | } 47 | 48 | bool ConsumeChar(Slice* in, char c) { 49 | if (!in->empty() && (*in)[0] == c) { 50 | in->remove_prefix(1); 51 | return true; 52 | } else { 53 | return false; 54 | } 55 | } 56 | 57 | bool ConsumeDecimalNumber(Slice* in, uint64_t* val) { 58 | uint64_t v = 0; 59 | int digits = 0; 60 | while (!in->empty()) { 61 | char c = (*in)[0]; 62 | if (c >= '0' && c <= '9') { 63 | ++digits; 64 | const int delta = (c - '0'); 65 | static const uint64_t kMaxUint64 = ~static_cast(0); 66 | if (v > kMaxUint64/10 || 67 | (v == kMaxUint64/10 && delta > kMaxUint64%10)) { 68 | // Overflow 69 | return false; 70 | } 71 | v = (v * 10) + delta; 72 | in->remove_prefix(1); 73 | } else { 74 | break; 75 | } 76 | } 77 | *val = v; 78 | return (digits > 0); 79 | } 80 | 81 | } // namespace leveldb 82 | -------------------------------------------------------------------------------- /src/leveldb/util/status.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include 6 | #include "port/port.h" 7 | #include "leveldb/status.h" 8 | 9 | namespace leveldb { 10 | 11 | const char* Status::CopyState(const char* state) { 12 | uint32_t size; 13 | memcpy(&size, state, sizeof(size)); 14 | char* result = new char[size + 5]; 15 | memcpy(result, state, size + 5); 16 | return result; 17 | } 18 | 19 | Status::Status(Code code, const Slice& msg, const Slice& msg2) { 20 | assert(code != kOk); 21 | const uint32_t len1 = msg.size(); 22 | const uint32_t len2 = msg2.size(); 23 | const uint32_t size = len1 + (len2 ? (2 + len2) : 0); 24 | char* result = new char[size + 5]; 25 | memcpy(result, &size, sizeof(size)); 26 | result[4] = static_cast(code); 27 | memcpy(result + 5, msg.data(), len1); 28 | if (len2) { 29 | result[5 + len1] = ':'; 30 | result[6 + len1] = ' '; 31 | memcpy(result + 7 + len1, msg2.data(), len2); 32 | } 33 | state_ = result; 34 | } 35 | 36 | std::string Status::ToString() const { 37 | if (state_ == NULL) { 38 | return "OK"; 39 | } else { 40 | char tmp[30]; 41 | const char* type; 42 | switch (code()) { 43 | case kOk: 44 | type = "OK"; 45 | break; 46 | case kNotFound: 47 | type = "NotFound: "; 48 | break; 49 | case kCorruption: 50 | type = "Corruption: "; 51 | break; 52 | case kNotSupported: 53 | type = "Not implemented: "; 54 | break; 55 | case kInvalidArgument: 56 | type = "Invalid argument: "; 57 | break; 58 | case kIOError: 59 | type = "IO error: "; 60 | break; 61 | default: 62 | snprintf(tmp, sizeof(tmp), "Unknown code(%d): ", 63 | static_cast(code())); 64 | type = tmp; 65 | break; 66 | } 67 | std::string result(type); 68 | uint32_t length; 69 | memcpy(&length, state_, sizeof(length)); 70 | result.append(state_ + 5, length); 71 | return result; 72 | } 73 | } 74 | 75 | } // namespace leveldb 76 | -------------------------------------------------------------------------------- /src/leveldb/db/table_cache.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Thread-safe (provides internal synchronization) 6 | 7 | #ifndef STORAGE_LEVELDB_DB_TABLE_CACHE_H_ 8 | #define STORAGE_LEVELDB_DB_TABLE_CACHE_H_ 9 | 10 | #include 11 | #include 12 | #include "db/dbformat.h" 13 | #include "leveldb/cache.h" 14 | #include "leveldb/table.h" 15 | #include "port/port.h" 16 | 17 | namespace leveldb { 18 | 19 | class Env; 20 | 21 | class TableCache { 22 | public: 23 | TableCache(const std::string& dbname, const Options* options, int entries); 24 | ~TableCache(); 25 | 26 | // Return an iterator for the specified file number (the corresponding 27 | // file length must be exactly "file_size" bytes). If "tableptr" is 28 | // non-NULL, also sets "*tableptr" to point to the Table object 29 | // underlying the returned iterator, or NULL if no Table object underlies 30 | // the returned iterator. The returned "*tableptr" object is owned by 31 | // the cache and should not be deleted, and is valid for as long as the 32 | // returned iterator is live. 33 | Iterator* NewIterator(const ReadOptions& options, 34 | uint64_t file_number, 35 | uint64_t file_size, 36 | Table** tableptr = NULL); 37 | 38 | // If a seek to internal key "k" in specified file finds an entry, 39 | // call (*handle_result)(arg, found_key, found_value). 40 | Status Get(const ReadOptions& options, 41 | uint64_t file_number, 42 | uint64_t file_size, 43 | const Slice& k, 44 | void* arg, 45 | void (*handle_result)(void*, const Slice&, const Slice&)); 46 | 47 | // Evict any entry for the specified file number 48 | void Evict(uint64_t file_number); 49 | 50 | private: 51 | Env* const env_; 52 | const std::string dbname_; 53 | const Options* options_; 54 | Cache* cache_; 55 | 56 | Status FindTable(uint64_t file_number, uint64_t file_size, Cache::Handle**); 57 | }; 58 | 59 | } // namespace leveldb 60 | 61 | #endif // STORAGE_LEVELDB_DB_TABLE_CACHE_H_ 62 | -------------------------------------------------------------------------------- /src/leveldb/util/arena.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/arena.h" 6 | #include 7 | 8 | namespace leveldb { 9 | 10 | static const int kBlockSize = 4096; 11 | 12 | Arena::Arena() { 13 | blocks_memory_ = 0; 14 | alloc_ptr_ = NULL; // First allocation will allocate a block 15 | alloc_bytes_remaining_ = 0; 16 | } 17 | 18 | Arena::~Arena() { 19 | for (size_t i = 0; i < blocks_.size(); i++) { 20 | delete[] blocks_[i]; 21 | } 22 | } 23 | 24 | char* Arena::AllocateFallback(size_t bytes) { 25 | if (bytes > kBlockSize / 4) { 26 | // Object is more than a quarter of our block size. Allocate it separately 27 | // to avoid wasting too much space in leftover bytes. 28 | char* result = AllocateNewBlock(bytes); 29 | return result; 30 | } 31 | 32 | // We waste the remaining space in the current block. 33 | alloc_ptr_ = AllocateNewBlock(kBlockSize); 34 | alloc_bytes_remaining_ = kBlockSize; 35 | 36 | char* result = alloc_ptr_; 37 | alloc_ptr_ += bytes; 38 | alloc_bytes_remaining_ -= bytes; 39 | return result; 40 | } 41 | 42 | char* Arena::AllocateAligned(size_t bytes) { 43 | const int align = sizeof(void*); // We'll align to pointer size 44 | assert((align & (align-1)) == 0); // Pointer size should be a power of 2 45 | size_t current_mod = reinterpret_cast(alloc_ptr_) & (align-1); 46 | size_t slop = (current_mod == 0 ? 0 : align - current_mod); 47 | size_t needed = bytes + slop; 48 | char* result; 49 | if (needed <= alloc_bytes_remaining_) { 50 | result = alloc_ptr_ + slop; 51 | alloc_ptr_ += needed; 52 | alloc_bytes_remaining_ -= needed; 53 | } else { 54 | // AllocateFallback always returned aligned memory 55 | result = AllocateFallback(bytes); 56 | } 57 | assert((reinterpret_cast(result) & (align-1)) == 0); 58 | return result; 59 | } 60 | 61 | char* Arena::AllocateNewBlock(size_t block_bytes) { 62 | char* result = new char[block_bytes]; 63 | blocks_memory_ += block_bytes; 64 | blocks_.push_back(result); 65 | return result; 66 | } 67 | 68 | } // namespace leveldb 69 | --------------------------------------------------------------------------------