├── debian ├── compat ├── paycoin-qt.docs ├── source │ └── format ├── paycoind.install ├── paycoin-qt.install ├── watch ├── paycoin-qt.protocol ├── paycoin-qt.desktop ├── rules ├── README.md ├── changelog ├── control └── copyright ├── contrib ├── debian │ ├── compat │ ├── patches │ │ ├── series │ │ └── README │ ├── source │ │ └── format │ ├── bitcoind.examples │ ├── bitcoind.install │ ├── bitcoind.manpages │ ├── gbp.conf │ ├── bitcoin-qt.lintian-overrides │ ├── bitcoind.lintian-overrides │ ├── bitcoin-qt.protocol │ ├── bitcoin-qt.install │ ├── bin │ │ ├── bitcoin-qt │ │ └── bitcoind │ ├── bitcoin-qt.desktop │ ├── watch │ ├── rules │ ├── control │ └── examples │ │ └── bitcoin.conf ├── macdeploy │ ├── background.png │ ├── background.psd │ ├── fancy.plist │ └── notes.txt ├── gitian-downloader │ ├── sipa-key.pgp │ ├── luke-jr-key.pgp │ ├── tcatm-key.pgp │ ├── bluematt-key.pgp │ ├── devrandom-key.pgp │ ├── gavinandresen-key.pgp │ ├── linux-download-config │ ├── win32-download-config │ └── laanwj-key.pgp ├── wallettools │ ├── walletunlock.py │ └── walletchangepass.py ├── pyminer │ ├── README │ └── example-config.cfg ├── qt_translations.py ├── devtools │ ├── README.md │ └── fix-copyright-headers.py └── gitian-descriptors │ ├── README │ ├── boost-linux.yml │ └── gitian-linux.yml ├── 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 │ │ │ ├── paycoin.ico │ │ │ ├── paycoin.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 │ │ │ ├── paycoin.icns │ │ │ ├── staking_on.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 │ │ │ ├── staking_off.png │ │ │ ├── transaction0.png │ │ │ ├── transaction2.png │ │ │ ├── paycoin_testnet.png │ │ │ └── toolbar_testnet.png │ │ ├── images │ │ │ ├── about.png │ │ │ ├── splash.png │ │ │ └── splash_testnet.png │ │ ├── movies │ │ │ ├── spinner-000.png │ │ │ ├── spinner-001.png │ │ │ ├── spinner-002.png │ │ │ ├── spinner-003.png │ │ │ ├── spinner-004.png │ │ │ ├── spinner-005.png │ │ │ ├── spinner-006.png │ │ │ ├── spinner-007.png │ │ │ ├── spinner-008.png │ │ │ ├── spinner-009.png │ │ │ ├── spinner-010.png │ │ │ ├── spinner-011.png │ │ │ ├── spinner-012.png │ │ │ ├── spinner-013.png │ │ │ ├── spinner-014.png │ │ │ ├── spinner-015.png │ │ │ ├── spinner-016.png │ │ │ ├── spinner-017.png │ │ │ ├── spinner-018.png │ │ │ ├── spinner-019.png │ │ │ ├── spinner-020.png │ │ │ ├── spinner-021.png │ │ │ ├── spinner-022.png │ │ │ ├── spinner-023.png │ │ │ ├── spinner-024.png │ │ │ ├── spinner-025.png │ │ │ ├── spinner-026.png │ │ │ ├── spinner-027.png │ │ │ ├── spinner-028.png │ │ │ ├── spinner-029.png │ │ │ ├── spinner-030.png │ │ │ ├── spinner-031.png │ │ │ ├── spinner-032.png │ │ │ ├── spinner-033.png │ │ │ └── spinner-034.png │ │ └── bitcoin-qt.rc │ ├── mintingfilterproxy.cpp │ ├── qtipcserver.h │ ├── test │ │ ├── test_main.cpp │ │ └── uritests.h │ ├── mintingfilterproxy.h │ ├── splashscreen.h │ ├── coincontroltreewidget.h │ ├── aboutdialog.h │ ├── transactiondesc.h │ ├── transactiondescdialog.cpp │ ├── aboutdialog.cpp │ ├── transactiondescdialog.h │ ├── bitcoinaddressvalidator.h │ ├── qvaluecombobox.cpp │ ├── qvalidatedlineedit.h │ ├── monitoreddatamapper.h │ ├── qvaluecombobox.h │ ├── qrcodedialog.h │ ├── mintingview.h │ ├── qvalidatedlineedit.cpp │ ├── coincontroltreewidget.cpp │ ├── macdockiconhandler.h │ ├── multisigaddressentry.h │ ├── csvmodelwriter.h │ ├── optionsdialog.h │ ├── editaddressdialog.h │ ├── monitoreddatamapper.cpp │ ├── askpassphrasedialog.h │ ├── overviewpage.h │ ├── guiconstants.h │ ├── multisiginputentry.h │ ├── sendcoinsentry.h │ ├── signverifymessagedialog.h │ ├── multisigdialog.h │ ├── transactionfilterproxy.h │ ├── bitcoinamountfield.h │ ├── rpcconsole.h │ ├── clientmodel.h │ ├── mintingtablemodel.h │ ├── sendcoinsdialog.h │ ├── csvmodelwriter.cpp │ ├── forms │ │ └── transactiondescdialog.ui │ ├── bitcoinunits.h │ ├── transactionview.h │ ├── addressbookpage.h │ ├── optionsmodel.h │ ├── bitcoinaddressvalidator.cpp │ ├── coincontroldialog.h │ ├── notificator.h │ ├── transactionfilterproxy.cpp │ └── transactiontablemodel.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 │ ├── json_spirit_writer.cpp │ └── json_spirit_reader.h ├── test │ ├── uint160_tests.cpp │ ├── uint256_tests.cpp │ ├── base64_tests.cpp │ ├── data │ │ ├── script_invalid.json │ │ └── script_valid.json │ ├── miner_tests.cpp │ ├── test_paycoin.cpp │ ├── README │ ├── Checkpoints_tests.cpp │ ├── sigopcount_tests.cpp │ ├── mruset_tests.cpp │ ├── accounting_tests.cpp │ └── base58_tests.cpp ├── init.h ├── scrapesdb.h ├── noui.cpp ├── coincontrol.h ├── kernelrecord.h ├── kernel.h ├── compat.h ├── ui_interface.h ├── mruset.h ├── strlcpy.h └── primenodes.h ├── share ├── pixmaps │ ├── check.ico │ ├── bitcoin.ico │ ├── favicon.ico │ ├── paycoin.ico │ ├── send16.bmp │ ├── send20.bmp │ ├── bitcoin-bc.ico │ ├── paycoin128.png │ ├── send16mask.bmp │ ├── send20mask.bmp │ ├── addressbook16.bmp │ ├── addressbook20.bmp │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── addressbook16mask.bmp │ ├── addressbook20mask.bmp │ └── send16masknoshadow.bmp ├── qt │ ├── img │ │ ├── reload.png │ │ └── reload.xcf │ ├── make_windows_icon.sh │ ├── make_spinner.py │ └── extract_strings_qt.py ├── ui.rc └── genbuild.sh ├── doc ├── paycoin_logo_doxygen.png ├── files.md ├── build-osx.md ├── build-msw.md ├── release-notes │ ├── release-notes-0.3.0.1.md │ └── release-notes-0.3.0.2.md ├── build-osx-ports.md └── build-osx-brew.md ├── .tx └── config ├── .gitignore ├── INSTALL ├── .travis.yml ├── COPYING └── README.md /debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /contrib/debian/patches/series: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /debian/paycoin-qt.docs: -------------------------------------------------------------------------------- 1 | doc/* 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /src/obj/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /contrib/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/paycoind.install: -------------------------------------------------------------------------------- 1 | src/paycoind usr/bin 2 | -------------------------------------------------------------------------------- /src/obj-test/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /contrib/debian/bitcoind.examples: -------------------------------------------------------------------------------- 1 | debian/examples/bitcoin.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/bitcoind.install: -------------------------------------------------------------------------------- 1 | debian/bin/bitcoind usr/bin 2 | src/bitcoind usr/lib/bitcoin 3 | -------------------------------------------------------------------------------- /contrib/debian/bitcoind.manpages: -------------------------------------------------------------------------------- 1 | debian/manpages/bitcoind.1 2 | debian/manpages/bitcoin.conf.5 3 | -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/qt/img/reload.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/qt/img/reload.png -------------------------------------------------------------------------------- /share/qt/img/reload.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/qt/img/reload.xcf -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/paycoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/paycoin.ico -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/add.png -------------------------------------------------------------------------------- /src/qt/res/icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/edit.png -------------------------------------------------------------------------------- /src/qt/res/icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/key.png -------------------------------------------------------------------------------- /src/qt/res/icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/quit.png -------------------------------------------------------------------------------- /src/qt/res/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/send.png -------------------------------------------------------------------------------- /doc/paycoin_logo_doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/doc/paycoin_logo_doxygen.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/bitcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/paycoin128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/paycoin128.png -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/clock1.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/clock2.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/clock3.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/clock4.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/clock5.png -------------------------------------------------------------------------------- /src/qt/res/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/export.png -------------------------------------------------------------------------------- /src/qt/res/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/history.png -------------------------------------------------------------------------------- /src/qt/res/icons/paycoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/paycoin.ico -------------------------------------------------------------------------------- /src/qt/res/icons/paycoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/paycoin.png -------------------------------------------------------------------------------- /src/qt/res/icons/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/qrcode.png -------------------------------------------------------------------------------- /src/qt/res/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/receive.png -------------------------------------------------------------------------------- /src/qt/res/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/remove.png -------------------------------------------------------------------------------- /src/qt/res/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/synced.png -------------------------------------------------------------------------------- /src/qt/res/icons/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/toolbar.png -------------------------------------------------------------------------------- /src/qt/res/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/images/about.png -------------------------------------------------------------------------------- /src/qt/res/images/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/images/splash.png -------------------------------------------------------------------------------- /share/pixmaps/addressbook16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/configure.png -------------------------------------------------------------------------------- /src/qt/res/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/editcopy.png -------------------------------------------------------------------------------- /src/qt/res/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/editpaste.png -------------------------------------------------------------------------------- /src/qt/res/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/filesave.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/icons/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/overview.png -------------------------------------------------------------------------------- /src/qt/res/icons/paycoin.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/paycoin.icns -------------------------------------------------------------------------------- /src/qt/res/icons/staking_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/staking_on.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/tx_output.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/macdeploy/background.psd -------------------------------------------------------------------------------- /src/qt/res/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/address-book.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/debugwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/debugwindow.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/icons/staking_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/staking_off.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/transaction0.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/transaction2.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-000.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-001.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-002.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-003.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-004.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-005.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-006.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-007.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-008.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-009.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-010.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-011.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-012.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-013.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-014.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-015.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-016.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-017.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-018.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-019.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-020.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-021.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-022.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-023.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-024.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-025.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-026.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-027.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-028.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-029.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-030.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-031.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-032.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-033.png -------------------------------------------------------------------------------- /src/qt/res/movies/spinner-034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/movies/spinner-034.png -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /src/qt/res/icons/paycoin_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/paycoin_testnet.png -------------------------------------------------------------------------------- /src/qt/res/icons/toolbar_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/icons/toolbar_testnet.png -------------------------------------------------------------------------------- /src/qt/res/images/splash_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/src/qt/res/images/splash_testnet.png -------------------------------------------------------------------------------- /contrib/gitian-downloader/sipa-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/sipa-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/luke-jr-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/luke-jr-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/tcatm-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/tcatm-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/bluematt-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/bluematt-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/devrandom-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/devrandom-key.pgp -------------------------------------------------------------------------------- /contrib/debian/bitcoin-qt.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | bitcoin-qt: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/debian/bitcoind.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | bitcoind: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/gavinandresen-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PaycoinFoundation/paycoin/HEAD/contrib/gitian-downloader/gavinandresen-key.pgp -------------------------------------------------------------------------------- /debian/paycoin-qt.install: -------------------------------------------------------------------------------- 1 | paycoin-qt usr/bin 2 | debian/paycoin-qt.desktop usr/share/applications 3 | debian/paycoin-qt.protocol usr/share/kde4/services 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # Run the "uscan" command to check for upstream updates and more. 2 | version=3 3 | https://github.com/PaycoinFoundation/paycoin/tags .*/v(\d[\d\.]*)\.tar\.gz 4 | -------------------------------------------------------------------------------- /src/qt/mintingfilterproxy.cpp: -------------------------------------------------------------------------------- 1 | #include "mintingfilterproxy.h" 2 | 3 | MintingFilterProxy::MintingFilterProxy(QObject * parent) : 4 | QSortFilterProxyModel(parent) 5 | { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /contrib/wallettools/walletunlock.py: -------------------------------------------------------------------------------- 1 | from jsonrpc import ServiceProxy 2 | access = ServiceProxy("http://127.0.0.1:8332") 3 | pwd = raw_input("Enter wallet passphrase: ") 4 | access.walletpassphrase(pwd, 60) -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | 4 | [paycoin.qt-translation-03x] 5 | file_filter = src/qt/locale/paycoin_.ts 6 | source_file = src/qt/locale/paycoin_en.ts 7 | source_lang = en 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /debian/paycoin-qt.protocol: -------------------------------------------------------------------------------- 1 | [Protocol] 2 | exec=paycoin-qt '%u' 3 | protocol=paycoin 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/debian/bitcoin-qt.protocol: -------------------------------------------------------------------------------- 1 | [Protocol] 2 | exec=bitcoin-qt '%u' 3 | protocol=bitcoin 4 | input=none 5 | output=none 6 | helper=true 7 | listing= 8 | reading=false 9 | writing=false 10 | makedir=false 11 | deleting=false 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/qt/qtipcserver.h: -------------------------------------------------------------------------------- 1 | #ifndef QTIPCSERVER_H 2 | #define QTIPCSERVER_H 3 | 4 | // Define Paycoin-Qt message queue name 5 | #define BITCOINURI_QUEUE_NAME "PaycoinURI" 6 | 7 | void ipcInit(); 8 | void ipcShutdown(); 9 | 10 | #endif // QTIPCSERVER_H 11 | -------------------------------------------------------------------------------- /contrib/wallettools/walletchangepass.py: -------------------------------------------------------------------------------- 1 | from jsonrpc import ServiceProxy 2 | access = ServiceProxy("http://127.0.0.1:8332") 3 | pwd = raw_input("Enter old wallet passphrase: ") 4 | pwd2 = raw_input("Enter new wallet passphrase: ") 5 | access.walletpassphrasechange(pwd, pwd2) -------------------------------------------------------------------------------- /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 | URITests test1; 10 | QTest::qExec(&test1); 11 | } 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | src/paycoind 2 | src/test_paycoin 3 | 4 | # Ignore build dir 5 | build/ 6 | 7 | # Compilation and Qt preprocessor part 8 | *.qm 9 | Makefile 10 | paycoin-qt 11 | 12 | # Resources cpp 13 | qrc_*.cpp 14 | 15 | # Qt creator 16 | *.pro.user 17 | 18 | # Mac specific 19 | .DS_Store 20 | -------------------------------------------------------------------------------- /contrib/debian/bitcoin-qt.install: -------------------------------------------------------------------------------- 1 | debian/bin/bitcoin-qt usr/bin 2 | bitcoin-qt usr/lib/bitcoin 3 | share/pixmaps/bitcoin32.xpm usr/share/pixmaps 4 | share/pixmaps/bitcoin80.xpm usr/share/pixmaps 5 | share/pixmaps/paycoin128.png usr/share/pixmaps 6 | debian/bitcoin-qt.desktop usr/share/applications 7 | debian/bitcoin-qt.protocol usr/share/kde4/services/ 8 | -------------------------------------------------------------------------------- /src/qt/mintingfilterproxy.h: -------------------------------------------------------------------------------- 1 | #ifndef MINTINGFILTERPROXY_H 2 | #define MINTINGFILTERPROXY_H 3 | 4 | #include 5 | 6 | class MintingFilterProxy : public QSortFilterProxyModel 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit MintingFilterProxy(QObject *parent = 0); 11 | }; 12 | 13 | #endif // MINTINGFILTERPROXY_H 14 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building Paycoin 2 | 3 | See doc/readme-qt.md for instructions on building Paycoin-Qt, 4 | the intended-for-end-users, nice-graphical-interface, reference 5 | implementation of Paycoin. 6 | 7 | See doc/build-*.md for instructions on building paycoind, 8 | the intended-for-services, no-graphical-interface, reference 9 | implementation of Paycoin. 10 | -------------------------------------------------------------------------------- /contrib/debian/bin/bitcoin-qt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 077 6 | 7 | basedir=~/.bitcoin 8 | dbfile="$basedir/DB_CONFIG" 9 | cfgfile="$basedir/bitcoin.conf" 10 | 11 | [ -e "$basedir" ] || mkdir "$basedir" 12 | 13 | # Bitcoin does not cleanup DB log files by default 14 | [ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile" 15 | 16 | exec /usr/lib/bitcoin/bitcoin-qt "$@" 17 | -------------------------------------------------------------------------------- /share/qt/make_windows_icon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # create multiresolution windows icon 3 | ICON_SRC=../../src/qt/res/icons/paycoin.png 4 | ICON_DST=../../src/qt/res/icons/paycoin.ico 5 | convert ${ICON_SRC} -resize 16x16 paycoin-16.png 6 | convert ${ICON_SRC} -resize 32x32 paycoin-32.png 7 | convert ${ICON_SRC} -resize 48x48 paycoin-48.png 8 | convert paycoin-48.png paycoin-32.png paycoin-16.png ${ICON_DST} 9 | 10 | -------------------------------------------------------------------------------- /src/qt/splashscreen.h: -------------------------------------------------------------------------------- 1 | #ifndef SPLASHSCREEN_H 2 | #define SPLASHSCREEN_H 3 | 4 | #include 5 | 6 | /** class for the splashscreen with information of the running client 7 | */ 8 | class SplashScreen : public QSplashScreen 9 | { 10 | Q_OBJECT 11 | 12 | public: 13 | explicit SplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = 0); 14 | }; 15 | 16 | #endif // SPLASHSCREEN_H 17 | -------------------------------------------------------------------------------- /debian/paycoin-qt.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=Paycoin 4 | Comment=Paycoin P2P Cryptocurrency 5 | Comment[fr]=Paycoin, monnaie virtuelle cryptographique pair à pair 6 | Comment[tr]=Paycoin, eşten eşe kriptografik sanal para birimi 7 | Exec=/usr/bin/paycoin-qt %u 8 | Terminal=false 9 | Type=Application 10 | Icon=/usr/share/pixmaps/paycoin128.png 11 | MimeType=x-scheme-handler/paycoin; 12 | Categories=Office; 13 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /contrib/debian/bitcoin-qt.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=Bitcoin 4 | Comment=Bitcoin P2P Cryptocurrency 5 | Comment[fr]=Bitcoin, monnaie virtuelle cryptographique pair à pair 6 | Comment[tr]=Bitcoin, eşten eşe kriptografik sanal para birimi 7 | Exec=/usr/bin/bitcoin-qt 8 | Terminal=false 9 | Type=Application 10 | Icon=/usr/share/pixmaps/bitcoin80.xpm 11 | MimeType=x-scheme-handler/bitcoin; 12 | Categories=Office; 13 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /contrib/pyminer/example-config.cfg: -------------------------------------------------------------------------------- 1 | 2 | # 3 | # RPC login details 4 | # 5 | host=127.0.0.1 6 | port=8332 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /contrib/debian/bin/bitcoind: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 077 6 | 7 | basedir=~/.bitcoin 8 | dbfile="$basedir/DB_CONFIG" 9 | cfgfile="$basedir/bitcoin.conf" 10 | 11 | [ -e "$basedir" ] || mkdir "$basedir" 12 | 13 | [ -e "$cfgfile" ] || perl -le 'print"rpcpassword=",map{(a..z,A..Z,0..9)[rand 62]}0..9' > "$cfgfile" 14 | 15 | # Bitcoin does not cleanup DB log files by default 16 | [ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile" 17 | 18 | exec /usr/lib/bitcoin/bitcoind "$@" 19 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT 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 | void Shutdown(void* parg); 14 | bool AppInit(int argc, char* argv[]); 15 | bool AppInit2(); 16 | std::string HelpMessage(); 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | cache: apt 4 | 5 | sudo: false 6 | 7 | compiler: 8 | - gcc 9 | 10 | addons: 11 | apt: 12 | packages: 13 | - libboost-all-dev 14 | - libssl-dev 15 | - libminiupnpc-dev 16 | - libdb++-dev 17 | - qt4-qmake 18 | - libqt4-dev 19 | - libqrencode-dev 20 | 21 | script: 22 | - qmake USE_QRCODE=1 23 | - make clean 24 | - make 25 | - cd src 26 | - make -f makefile.unix clean 27 | - make -f makefile.unix 28 | - make -f makefile.unix test_paycoin 29 | - ./test_paycoin 30 | -------------------------------------------------------------------------------- /src/qt/aboutdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ABOUTDIALOG_H 2 | #define ABOUTDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AboutDialog; 8 | } 9 | class ClientModel; 10 | 11 | /** "About" dialog box */ 12 | class AboutDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit AboutDialog(QWidget *parent = 0); 18 | ~AboutDialog(); 19 | 20 | void setModel(ClientModel *model); 21 | private: 22 | Ui::AboutDialog *ui; 23 | 24 | private slots: 25 | void on_buttonBox_accepted(); 26 | }; 27 | 28 | #endif // ABOUTDIALOG_H 29 | -------------------------------------------------------------------------------- /src/qt/transactiondesc.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONDESC_H 2 | #define TRANSACTIONDESC_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class CWallet; 9 | class CWalletTx; 10 | 11 | /** Provide a human-readable extended HTML description of a transaction. 12 | */ 13 | class TransactionDesc: public QObject 14 | { 15 | Q_OBJECT 16 | public: 17 | static QString toHTML(CWallet *wallet, CWalletTx &wtx); 18 | private: 19 | TransactionDesc() {} 20 | 21 | static QString FormatTxStatus(const CWalletTx& wtx); 22 | }; 23 | 24 | #endif // TRANSACTIONDESC_H 25 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | 3 | PACKAGE ?= $(shell dpkg-parsechangelog | grep -E ^Source: | sed -e 's/Source: //') 4 | VERSION ?= $(shell cd ../$(PACKAGE).upstream; git describe --tags --always | sed -e 's/^v//') 5 | 6 | make-orig: 7 | cd ../$(PACKAGE).upstream; git archive --prefix=$(PACKAGE)_$(VERSION)/ --output=../tarballs/$(PACKAGE)_$(VERSION).orig.tar.gz HEAD 8 | 9 | override_dh_auto_build: 10 | cd src; $(MAKE) -f makefile.unix USE_UPNP=1 11 | $(MAKE) 12 | 13 | override_dh_auto_configure: 14 | qmake-qt4 -makefile paycoin-qt.pro USE_QRCODE=1 USE_UPNP=1 15 | 16 | %: 17 | dh $@ 18 | -------------------------------------------------------------------------------- /src/qt/transactiondescdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "transactiondescdialog.h" 2 | #include "ui_transactiondescdialog.h" 3 | 4 | #include "transactiontablemodel.h" 5 | 6 | #include 7 | 8 | TransactionDescDialog::TransactionDescDialog(const QModelIndex &idx, QWidget *parent) : 9 | QDialog(parent), 10 | ui(new Ui::TransactionDescDialog) 11 | { 12 | ui->setupUi(this); 13 | QString desc = idx.data(TransactionTableModel::LongDescriptionRole).toString(); 14 | ui->detailText->setHtml(desc); 15 | } 16 | 17 | TransactionDescDialog::~TransactionDescDialog() 18 | { 19 | delete ui; 20 | } 21 | -------------------------------------------------------------------------------- /src/qt/aboutdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "aboutdialog.h" 2 | #include "ui_aboutdialog.h" 3 | #include "clientmodel.h" 4 | 5 | #include "version.h" 6 | 7 | AboutDialog::AboutDialog(QWidget *parent) : 8 | QDialog(parent), 9 | ui(new Ui::AboutDialog) 10 | { 11 | ui->setupUi(this); 12 | } 13 | 14 | void AboutDialog::setModel(ClientModel *model) 15 | { 16 | if(model) 17 | { 18 | ui->versionLabel->setText( model->formatFullVersion()); 19 | } 20 | } 21 | 22 | AboutDialog::~AboutDialog() 23 | { 24 | delete ui; 25 | } 26 | 27 | void AboutDialog::on_buttonBox_accepted() 28 | { 29 | close(); 30 | } 31 | -------------------------------------------------------------------------------- /src/qt/transactiondescdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONDESCDIALOG_H 2 | #define TRANSACTIONDESCDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class TransactionDescDialog; 8 | } 9 | QT_BEGIN_NAMESPACE 10 | class QModelIndex; 11 | QT_END_NAMESPACE 12 | 13 | /** Dialog showing transaction details. */ 14 | class TransactionDescDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0); 20 | ~TransactionDescDialog(); 21 | 22 | private: 23 | Ui::TransactionDescDialog *ui; 24 | }; 25 | 26 | #endif // TRANSACTIONDESCDIALOG_H 27 | -------------------------------------------------------------------------------- /src/qt/bitcoinaddressvalidator.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOINADDRESSVALIDATOR_H 2 | #define BITCOINADDRESSVALIDATOR_H 3 | 4 | #include 5 | 6 | /** Base48 entry widget validator. 7 | Corrects near-miss characters and refuses characters that are no part of base48. 8 | */ 9 | class BitcoinAddressValidator : public QValidator 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit BitcoinAddressValidator(QObject *parent = 0); 14 | 15 | State validate(QString &input, int &pos) const; 16 | 17 | static const int MaxAddressLength = 35; 18 | signals: 19 | 20 | public slots: 21 | 22 | }; 23 | 24 | #endif // BITCOINADDRESSVALIDATOR_H 25 | -------------------------------------------------------------------------------- /debian/README.md: -------------------------------------------------------------------------------- 1 | Debian 2 | ====== 3 | This directory contains files used to package bitcoind/bitcoin-qt for Debian-based Linux systems. If you compile bitcoind/bitcoin-qt yourself, there are some useful files here. 4 | 5 | ## paycoin: URI support ## 6 | 7 | 8 | bitcoin-qt.desktop (Gnome / Open Desktop) 9 | To install: 10 | 11 | sudo desktop-file-install bitcoin-qt.desktop 12 | sudo update-desktop-database 13 | 14 | If you build yourself, you will either need to modify the paths in the .desktop file or copy or symlink your paycoin-qt binary to `/usr/bin` and the `../../share/pixmaps/paycoin128.png` to `/usr/share/pixmaps` 15 | 16 | bitcoin-qt.protocol (KDE) 17 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.cpp: -------------------------------------------------------------------------------- 1 | #include "qvaluecombobox.h" 2 | 3 | QValueComboBox::QValueComboBox(QWidget *parent) : 4 | QComboBox(parent), role(Qt::UserRole) 5 | { 6 | connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int))); 7 | } 8 | 9 | QVariant QValueComboBox::value() const 10 | { 11 | return itemData(currentIndex(), role); 12 | } 13 | 14 | void QValueComboBox::setValue(const QVariant &value) 15 | { 16 | setCurrentIndex(findData(value, role)); 17 | } 18 | 19 | void QValueComboBox::setRole(int role) 20 | { 21 | this->role = role; 22 | } 23 | 24 | void QValueComboBox::handleSelectionChanged(int idx) 25 | { 26 | emit valueChanged(); 27 | } 28 | -------------------------------------------------------------------------------- /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'paycoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'paycoin_*.qm')) ]) 20 | 21 | print ",".join(sorted(l1.intersection(l2))) 22 | 23 | -------------------------------------------------------------------------------- /src/qt/qvalidatedlineedit.h: -------------------------------------------------------------------------------- 1 | #ifndef QVALIDATEDLINEEDIT_H 2 | #define QVALIDATEDLINEEDIT_H 3 | 4 | #include 5 | 6 | /** Line edit that can be marked as "invalid" to show input validation feedback. When marked as invalid, 7 | it will get a red background until it is focused. 8 | */ 9 | class QValidatedLineEdit : public QLineEdit 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QValidatedLineEdit(QWidget *parent = 0); 14 | void clear(); 15 | 16 | protected: 17 | void focusInEvent(QFocusEvent *evt); 18 | 19 | private: 20 | bool valid; 21 | 22 | public slots: 23 | void setValid(bool valid); 24 | 25 | private slots: 26 | void markValid(); 27 | }; 28 | 29 | #endif // QVALIDATEDLINEEDIT_H 30 | -------------------------------------------------------------------------------- /src/test/base64_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 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 (int i=0; i Tue, 16 Feb 2016 09:17:00 +1000 8 | -- Nathan Bass (IngCr3at1on) Wed, 17 Feb 2016 13:16:02 -0600 9 | 10 | paycoin (0.1.2.26) stable; urgency=low 11 | 12 | * Bring package version number inline with application 13 | 14 | -- Nathan Bass (IngCr3at1on) Wed, 11 Feb 2015 12:48:31 -0600 15 | 16 | paycoin (0.1.2.25) stable; urgency=low 17 | 18 | * Initial release 19 | 20 | -- wdl1908 Sun, 28 Dec 2014 19:57:48 +0100 21 | -------------------------------------------------------------------------------- /doc/files.md: -------------------------------------------------------------------------------- 1 | 2 | * paycoin.conf: contains configuration settings for paycoind or paycoin-qt 3 | * blkindex.dat: block chain index database (BDB) 4 | * blk000?.dat: block data 5 | * database/*: BDB database environment 6 | * db.log: wallet database log file 7 | * debug.log: contains debug information and general logging generated by paycoind or paycoin-qt 8 | * peers.dat: peer IP address database (custom format); since 0.3.1.1 9 | * primenodes.dat: primenode and microprime control information database (key, primenode/microprime rate, valid starting and valid until times 10 | * scrapes.dat: scrape address database 11 | * wallet.dat: personal wallet (BDB) with keys and transactions 12 | 13 | Only used before 0.3.1.1 14 | --------------------- 15 | * addr.dat: peer IP address database (BDB); replaced by peers.dat in 0.3.1.1 16 | -------------------------------------------------------------------------------- /src/test/data/script_invalid.json: -------------------------------------------------------------------------------- 1 | [ 2 | ["", ""], 3 | ["", "NOP"], 4 | ["NOP", ""], 5 | ["NOP","NOP"], 6 | ["0 1","EQUAL"], 7 | ["1 1 ADD", "0 EQUAL"], 8 | ["11 1 ADD 12 SUB", "11 EQUAL"], 9 | 10 | ["2147483648 0 ADD", "NOP", "arithmetic operands must be in range [-2^31...2^31] "], 11 | ["-2147483648 0 ADD", "NOP", "arithmetic operands must be in range [-2^31...2^31] "], 12 | ["2147483647 DUP ADD", "4294967294 NUMEQUAL", "NUMEQUAL must be in numeric range"], 13 | ["0xaabbccddeeff NOT", "0 EQUAL", "NOT is an arithmetic operand"], 14 | 15 | ["2 DUP MUL", "4 EQUAL", "disabled"], 16 | ["2 DUP DIV", "1 EQUAL", "disabled"], 17 | ["2 2MUL", "4 EQUAL", "disabled"], 18 | ["2 2DIV", "1 EQUAL", "disabled"], 19 | ["7 3 MOD", "1 EQUAL", "disabled"], 20 | ["2 2 LSHIFT", "8 EQUAL", "disabled"], 21 | ["2 1 RSHIFT", "1 EQUAL", "disabled"], 22 | 23 | 24 | ["NOP1","NOP10"] 25 | ] 26 | -------------------------------------------------------------------------------- /src/qt/monitoreddatamapper.h: -------------------------------------------------------------------------------- 1 | #ifndef MONITOREDDATAMAPPER_H 2 | #define MONITOREDDATAMAPPER_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QWidget; 8 | QT_END_NAMESPACE 9 | 10 | /** Data to Widget mapper that watches for edits and notifies listeners when a field is edited. 11 | This can be used, for example, to enable a commit/apply button in a configuration dialog. 12 | */ 13 | class MonitoredDataMapper : public QDataWidgetMapper 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit MonitoredDataMapper(QObject *parent=0); 18 | 19 | void addMapping(QWidget *widget, int section); 20 | void addMapping(QWidget *widget, int section, const QByteArray &propertyName); 21 | private: 22 | void addChangeMonitor(QWidget *widget); 23 | 24 | signals: 25 | void viewModified(); 26 | 27 | }; 28 | 29 | 30 | 31 | #endif // MONITOREDDATAMAPPER_H 32 | -------------------------------------------------------------------------------- /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 | PPcoin-Qt.app 26 | 27 | 128 28 | 156 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.h: -------------------------------------------------------------------------------- 1 | #ifndef QVALUECOMBOBOX_H 2 | #define QVALUECOMBOBOX_H 3 | 4 | #include 5 | #include 6 | 7 | /* QComboBox that can be used with QDataWidgetMapper to select ordinal values from a model. */ 8 | class QValueComboBox : public QComboBox 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) 12 | public: 13 | explicit QValueComboBox(QWidget *parent = 0); 14 | 15 | QVariant value() const; 16 | void setValue(const QVariant &value); 17 | 18 | /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */ 19 | void setRole(int role); 20 | 21 | signals: 22 | void valueChanged(); 23 | 24 | public slots: 25 | 26 | private: 27 | int role; 28 | 29 | private slots: 30 | void handleSelectionChanged(int idx); 31 | }; 32 | 33 | #endif // QVALUECOMBOBOX_H 34 | -------------------------------------------------------------------------------- /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 | 11 | class QRCodeDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent = 0); 17 | ~QRCodeDialog(); 18 | 19 | private slots: 20 | void on_lnReqAmount_textChanged(const QString &arg1); 21 | void on_lnLabel_textChanged(const QString &arg1); 22 | void on_lnMessage_textChanged(const QString &arg1); 23 | void on_btnSaveAs_clicked(); 24 | 25 | void on_chkReqPayment_toggled(bool checked); 26 | 27 | private: 28 | Ui::QRCodeDialog *ui; 29 | QImage myImage; 30 | 31 | QString getURI(); 32 | QString address; 33 | 34 | void genCode(); 35 | }; 36 | 37 | #endif // QRCODEDIALOG_H 38 | -------------------------------------------------------------------------------- /src/qt/mintingview.h: -------------------------------------------------------------------------------- 1 | #ifndef MINTINGVIEW_H 2 | #define MINTINGVIEW_H 3 | 4 | #include 5 | #include 6 | #include "mintingfilterproxy.h" 7 | 8 | class WalletModel; 9 | 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QTableView; 13 | QT_END_NAMESPACE 14 | 15 | class MintingView : public QWidget 16 | { 17 | Q_OBJECT 18 | public: 19 | explicit MintingView(QWidget *parent = 0); 20 | void setModel(WalletModel *model); 21 | 22 | enum MintingEnum 23 | { 24 | Minting10min, 25 | Minting1day, 26 | Minting30days, 27 | Minting90days 28 | }; 29 | 30 | private: 31 | WalletModel *model; 32 | QTableView *mintingView; 33 | 34 | QComboBox *mintingCombo; 35 | 36 | MintingFilterProxy *mintingProxyModel; 37 | 38 | signals: 39 | 40 | public slots: 41 | void exportClicked(); 42 | void chooseMintingInterval(int idx); 43 | }; 44 | 45 | #endif // MINTINGVIEW_H 46 | -------------------------------------------------------------------------------- /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 --tags 2>/dev/null)" 20 | 21 | # get a string like "2012-04-10 16:27:19 +0200" 22 | TIME="$(git log -n 1 --format="%ci")" 23 | fi 24 | 25 | if [ -n "$DESC" ]; then 26 | NEWINFO="#define BUILD_DESC \"$DESC\"" 27 | else 28 | NEWINFO="// No build information available" 29 | fi 30 | 31 | # only update build.h if necessary 32 | if [ "$INFO" != "$NEWINFO" ]; then 33 | echo "$NEWINFO" >"$FILE" 34 | echo "#define BUILD_DATE \"$TIME\"" >>"$FILE" 35 | fi 36 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: paycoin 2 | Section: utils 3 | Priority: optional 4 | Maintainer: wdl1908 5 | Build-Depends: debhelper (>= 9.0.0), 6 | devscripts, 7 | libqt4-dev, 8 | qt4-qmake, 9 | libdb++-dev, 10 | libboost-system-dev, 11 | libboost-filesystem-dev, 12 | libboost-program-options-dev, 13 | libboost-thread-dev, 14 | libboost-test-dev, 15 | libssl-dev, 16 | libminiupnpc-dev, 17 | libqrencode-dev 18 | Standards-Version: 0.1.2.26 19 | Homepage: https://paycoin.com/ 20 | Vcs-Git: https://github.com/PaycoinFoundation/paycoin.git 21 | 22 | Package: paycoin-qt 23 | Architecture: any-amd64 any-i386 any-arm 24 | Depends: ${shlibs:Depends}, ${misc:Depends} 25 | Description: Paycoin wallet GUI 26 | Peer-to-Peer cryptocurrency with Proof-of-Stake. 27 | 28 | Package: paycoind 29 | Architecture: any-amd64 any-i386 any-arm 30 | Depends: ${shlibs:Depends}, ${misc:Depends} 31 | Description: Paycoin daemon 32 | Peer-to-Peer cryptocurrency with Proof-of-Stake. 33 | -------------------------------------------------------------------------------- /src/qt/qvalidatedlineedit.cpp: -------------------------------------------------------------------------------- 1 | #include "qvalidatedlineedit.h" 2 | 3 | #include "guiconstants.h" 4 | 5 | QValidatedLineEdit::QValidatedLineEdit(QWidget *parent) : 6 | QLineEdit(parent), valid(true) 7 | { 8 | connect(this, SIGNAL(textChanged(QString)), this, SLOT(markValid())); 9 | } 10 | 11 | void QValidatedLineEdit::setValid(bool valid) 12 | { 13 | if(valid == this->valid) 14 | { 15 | return; 16 | } 17 | 18 | if(valid) 19 | { 20 | setStyleSheet(""); 21 | } 22 | else 23 | { 24 | setStyleSheet(STYLE_INVALID); 25 | } 26 | this->valid = valid; 27 | } 28 | 29 | void QValidatedLineEdit::focusInEvent(QFocusEvent *evt) 30 | { 31 | // Clear invalid flag on focus 32 | setValid(true); 33 | QLineEdit::focusInEvent(evt); 34 | } 35 | 36 | void QValidatedLineEdit::markValid() 37 | { 38 | setValid(true); 39 | } 40 | 41 | void QValidatedLineEdit::clear() 42 | { 43 | setValid(true); 44 | QLineEdit::clear(); 45 | } 46 | -------------------------------------------------------------------------------- /src/test/miner_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "uint256.h" 4 | #include "util.h" 5 | 6 | extern void SHA256Transform(void* pstate, void* pinput, const void* pinit); 7 | 8 | BOOST_AUTO_TEST_SUITE(miner_tests) 9 | 10 | BOOST_AUTO_TEST_CASE(sha256transform_equality) 11 | { 12 | unsigned int pSHA256InitState[8] = {0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19}; 13 | 14 | 15 | // unsigned char pstate[32]; 16 | unsigned char pinput[64]; 17 | 18 | int i; 19 | 20 | for (i = 0; i < 32; i++) { 21 | pinput[i] = i; 22 | pinput[i+32] = 0; 23 | } 24 | 25 | uint256 hash; 26 | 27 | SHA256Transform(&hash, pinput, pSHA256InitState); 28 | 29 | BOOST_TEST_MESSAGE(hash.GetHex()); 30 | 31 | uint256 hash_reference("0x2df5e1c65ef9f8cde240d23cae2ec036d31a15ec64bc68f64be242b1da6631f3"); 32 | 33 | BOOST_CHECK(hash == hash_reference); 34 | } 35 | 36 | BOOST_AUTO_TEST_SUITE_END() 37 | -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- mode: makefile; coding: utf-8 -*- 3 | 4 | #DEB_MAKE_CHECK_TARGET = test_bitcoin 5 | #build/bitcoind:: 6 | # $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin) 7 | 8 | DEB_INSTALL_EXAMPLES_bitcoind += debian/examples/* 9 | DEB_INSTALL_MANPAGES_bitcoind += debian/manpages/* 10 | 11 | %: 12 | dh $@ 13 | 14 | override_dh_auto_build: 15 | cd src; $(MAKE) -f makefile.unix bitcoind 16 | $(MAKE) 17 | 18 | override_dh_auto_clean: 19 | if [ -f Makefile ]; then $(MAKE) clean; else rm -rf build/; rm -f bitcoin-qt; fi 20 | cd src; $(MAKE) -f makefile.unix clean 21 | 22 | override_dh_auto_configure: 23 | qmake bitcoin-qt.pro USE_QRCODE=1 24 | 25 | override_dh_auto_test: 26 | cd src; $(MAKE) -f makefile.unix test_bitcoin 27 | src/test_bitcoin 28 | 29 | # Ensure wrapper is set executable 30 | binary-post-install/bitcoind: 31 | chmod +x $(cdbs_curdestdir)usr/bin/bitcoind 32 | binary-post-install/bitcoin-qt: 33 | chmod +x $(cdbs_curdestdir)usr/bin/bitcoin-qt 34 | -------------------------------------------------------------------------------- /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 | if(this->currentItem()) 17 | this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); 18 | } 19 | else if (event->key() == Qt::Key_Escape) // press esc -> close dialog 20 | { 21 | event->ignore(); 22 | CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget(); 23 | coinControlDialog->done(QDialog::Accepted); 24 | } 25 | else 26 | { 27 | this->QTreeWidget::keyPressEvent(event); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/scrapesdb.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Paycoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef SCRAPESDB_H 5 | #define SCRAPESDB_H 6 | 7 | #include "db.h" 8 | #include "json/json_spirit_value.h" 9 | 10 | class CScrapesDB : public CDB 11 | { 12 | public: 13 | CScrapesDB(const char* pszMode="r+") : CDB("scrapes.dat", pszMode) { } 14 | private: 15 | mutable CCriticalSection(cs); 16 | 17 | CScrapesDB(const CScrapesDB&); 18 | void operator=(const CScrapesDB); 19 | public: 20 | bool WriteScrapeAddress(const std::string /*strAddress*/, const std::string /*strScrapeAddress*/); 21 | bool EraseScrapeAddress(const std::string /*strAddress*/); 22 | bool ReadScrapeAddress(const std::string /*strAddress*/, std::string &/*strScrapeAddress*/); 23 | bool DumpScrapeAddresses(json_spirit::Object &/*ScrapeAddresses*/); 24 | bool HasScrapeAddress(const std::string /*strAddress*/); 25 | }; 26 | 27 | #endif // SCRAPESDB_H 28 | -------------------------------------------------------------------------------- /share/qt/make_spinner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # W.J. van der Laan, 2011 3 | # Make spinning 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.png' 11 | TMPDIR='../../src/qt/res/movies/' 12 | TMPNAME='spinner-%03i.png' 13 | NUMFRAMES=35 14 | FRAMERATE=10.0 15 | CONVERT='convert' 16 | CLOCKWISE=True 17 | DSIZE=(16,16) 18 | 19 | im_src = Image.open(SRC) 20 | 21 | if CLOCKWISE: 22 | im_src = im_src.transpose(Image.FLIP_LEFT_RIGHT) 23 | 24 | def frame_to_filename(frame): 25 | return path.join(TMPDIR, TMPNAME % frame) 26 | 27 | frame_files = [] 28 | for frame in xrange(NUMFRAMES): 29 | rotation = (frame + 0.5) / NUMFRAMES * 360.0 30 | if CLOCKWISE: 31 | rotation = -rotation 32 | im_new = im_src.rotate(rotation, Image.BICUBIC) 33 | im_new.thumbnail(DSIZE, Image.ANTIALIAS) 34 | outfile = frame_to_filename(frame) 35 | im_new.save(outfile, 'png') 36 | frame_files.append(outfile) 37 | -------------------------------------------------------------------------------- /src/qt/macdockiconhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MACDOCKICONHANDLER_H 2 | #define MACDOCKICONHANDLER_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QMenu; 9 | class QIcon; 10 | class QWidget; 11 | QT_END_NAMESPACE 12 | 13 | #ifdef __OBJC__ 14 | @class DockIconClickEventHandler; 15 | #else 16 | class DockIconClickEventHandler; 17 | #endif 18 | 19 | /** Macintosh-specific dock icon handler. 20 | */ 21 | class MacDockIconHandler : public QObject 22 | { 23 | Q_OBJECT 24 | 25 | public: 26 | ~MacDockIconHandler(); 27 | 28 | QMenu *dockMenu(); 29 | void setIcon(const QIcon &icon); 30 | void setMainWindow(QMainWindow *window); 31 | static MacDockIconHandler *instance(); 32 | 33 | void handleDockIconClickEvent(); 34 | 35 | signals: 36 | void dockIconClicked(); 37 | 38 | private: 39 | MacDockIconHandler(); 40 | 41 | DockIconClickEventHandler *m_dockIconClickEventHandler; 42 | QWidget *m_dummyWidget; 43 | QMenu *m_dockMenu; 44 | QMainWindow *mainWindow; 45 | }; 46 | 47 | #endif // MACDOCKICONCLICKHANDLER_H 48 | -------------------------------------------------------------------------------- /src/qt/multisigaddressentry.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTISIGADDRESSENTRY_H 2 | #define MULTISIGADDRESSENTRY_H 3 | 4 | #include 5 | 6 | 7 | class WalletModel; 8 | 9 | namespace Ui 10 | { 11 | class MultisigAddressEntry; 12 | } 13 | 14 | class MultisigAddressEntry : public QFrame 15 | { 16 | Q_OBJECT; 17 | 18 | public: 19 | explicit MultisigAddressEntry(QWidget *parent = 0); 20 | ~MultisigAddressEntry(); 21 | void setModel(WalletModel *model); 22 | bool validate(); 23 | QString getPubkey(); 24 | 25 | public slots: 26 | void setRemoveEnabled(bool enabled); 27 | void clear(); 28 | 29 | signals: 30 | void removeEntry(MultisigAddressEntry *entry); 31 | 32 | private: 33 | Ui::MultisigAddressEntry *ui; 34 | WalletModel *model; 35 | 36 | private slots: 37 | void on_pubkey_textChanged(const QString &pubkey); 38 | void on_pasteButton_clicked(); 39 | void on_deleteButton_clicked(); 40 | void on_address_textChanged(const QString &address); 41 | void on_addressBookButton_clicked(); 42 | }; 43 | 44 | #endif // MULTISIGADDRESSENTRY_H 45 | -------------------------------------------------------------------------------- /src/noui.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #include "ui_interface.h" 6 | 7 | #include 8 | #include "init.h" 9 | 10 | int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style) 11 | { 12 | printf("%s: %s\n", caption.c_str(), message.c_str()); 13 | fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str()); 14 | return 4; 15 | } 16 | 17 | bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption) 18 | { 19 | return true; 20 | } 21 | 22 | void MainFrameRepaint() 23 | { 24 | } 25 | 26 | void AddressBookRepaint() 27 | { 28 | } 29 | 30 | void InitMessage(const std::string &message) 31 | { 32 | } 33 | 34 | std::string _(const char* psz) 35 | { 36 | return psz; 37 | } 38 | 39 | void QueueShutdown() 40 | { 41 | // Without UI, Shutdown can simply be started in a new thread 42 | NewThread(Shutdown, NULL); 43 | } 44 | -------------------------------------------------------------------------------- /src/test/test_paycoin.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE Paycoin Test Suite 2 | #include 3 | 4 | #include "main.h" 5 | #include "scrapesdb.h" 6 | #include "wallet.h" 7 | 8 | int MIN_PROTO_VERSION = 70002; 9 | 10 | CWallet* pwalletMain; 11 | CScrapesDB* scrapesDB; 12 | 13 | extern bool fPrintToConsole; 14 | struct TestingSetup { 15 | TestingSetup() { 16 | fPrintToConsole = true; // don't want to write to debug.log file 17 | pwalletMain = new CWallet(); 18 | bitdb.MakeMock(); 19 | LoadBlockIndex(true); 20 | bool fFirstRun; 21 | pwalletMain = new CWallet("wallet.dat"); 22 | pwalletMain->LoadWallet(fFirstRun); 23 | RegisterWallet(pwalletMain); 24 | scrapesDB = new CScrapesDB("cw"); 25 | } 26 | ~TestingSetup() 27 | { 28 | delete pwalletMain; 29 | pwalletMain = NULL; 30 | bitdb.Flush(true); 31 | } 32 | }; 33 | 34 | BOOST_GLOBAL_FIXTURE(TestingSetup); 35 | 36 | void Shutdown(void* parg) 37 | { 38 | exit(0); 39 | } 40 | 41 | void StartShutdown() 42 | { 43 | exit(0); 44 | } 45 | -------------------------------------------------------------------------------- /src/qt/res/bitcoin-qt.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icons/paycoin.ico" 2 | 3 | #include // needed for VERSIONINFO 4 | 5 | VS_VERSION_INFO VERSIONINFO 6 | FILEOS VOS_NT_WINDOWS32 7 | FILETYPE VFT_APP 8 | BEGIN 9 | BLOCK "StringFileInfo" 10 | BEGIN 11 | BLOCK "040904E4" // U.S. English - multilingual (hex) 12 | BEGIN 13 | VALUE "CompanyName", "Paycoin" 14 | VALUE "FileDescription", "Paycoin-Qt (OSS GUI client for Paycoin)" 15 | VALUE "InternalName", "paycoin-qt" 16 | VALUE "LegalCopyright", "2014-2016 The Paycoin developers" 17 | VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." 18 | VALUE "OriginalFilename", "paycoin-qt.exe" 19 | VALUE "ProductName", "Paycoin-Qt" 20 | END 21 | END 22 | 23 | BLOCK "VarFileInfo" 24 | BEGIN 25 | VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) 26 | END 27 | END 28 | -------------------------------------------------------------------------------- /src/qt/csvmodelwriter.h: -------------------------------------------------------------------------------- 1 | #ifndef CSVMODELWRITER_H 2 | #define CSVMODELWRITER_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QAbstractItemModel; 9 | QT_END_NAMESPACE 10 | 11 | /** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in 12 | a spreadsheet. 13 | */ 14 | class CSVModelWriter : public QObject 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit CSVModelWriter(const QString &filename, QObject *parent = 0); 19 | 20 | void setModel(const QAbstractItemModel *model); 21 | void addColumn(const QString &title, int column, int role=Qt::EditRole); 22 | 23 | /** Perform export of the model to CSV. 24 | @returns true on success, false otherwise 25 | */ 26 | bool write(); 27 | 28 | private: 29 | QString filename; 30 | const QAbstractItemModel *model; 31 | 32 | struct Column 33 | { 34 | QString title; 35 | int column; 36 | int role; 37 | }; 38 | QList columns; 39 | 40 | signals: 41 | 42 | public slots: 43 | 44 | }; 45 | 46 | #endif // CSVMODELWRITER_H 47 | -------------------------------------------------------------------------------- /src/qt/optionsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTIONSDIALOG_H 2 | #define OPTIONSDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QStackedWidget; 9 | class QListWidget; 10 | class QListWidgetItem; 11 | class QPushButton; 12 | QT_END_NAMESPACE 13 | class OptionsModel; 14 | class OptionsPage; 15 | class MonitoredDataMapper; 16 | 17 | /** Preferences dialog. */ 18 | class OptionsDialog : public QDialog 19 | { 20 | Q_OBJECT 21 | public: 22 | explicit OptionsDialog(QWidget *parent=0); 23 | 24 | void setModel(OptionsModel *model); 25 | 26 | signals: 27 | 28 | public slots: 29 | /** Change the current page to \a index. */ 30 | void changePage(int index); 31 | 32 | private slots: 33 | void okClicked(); 34 | void cancelClicked(); 35 | void applyClicked(); 36 | void enableApply(); 37 | void disableApply(); 38 | 39 | private: 40 | QListWidget *contents_widget; 41 | QStackedWidget *pages_widget; 42 | OptionsModel *model; 43 | MonitoredDataMapper *mapper; 44 | QPushButton *apply_button; 45 | 46 | QList pages; 47 | }; 48 | 49 | #endif // OPTIONSDIALOG_H 50 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/linux-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: bitcoin 3 | urls: 4 | - https://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 | minimum_weight: 120 39 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/win32-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: bitcoin 3 | urls: 4 | - https://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 | minimum_weight: 120 39 | -------------------------------------------------------------------------------- /src/qt/editaddressdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITADDRESSDIALOG_H 2 | #define EDITADDRESSDIALOG_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QDataWidgetMapper; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class EditAddressDialog; 12 | } 13 | class AddressTableModel; 14 | 15 | /** Dialog for editing an address and associated information. 16 | */ 17 | class EditAddressDialog : public QDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | enum Mode { 23 | NewReceivingAddress, 24 | NewSendingAddress, 25 | EditReceivingAddress, 26 | EditSendingAddress 27 | }; 28 | 29 | explicit EditAddressDialog(Mode mode, QWidget *parent = 0); 30 | ~EditAddressDialog(); 31 | 32 | void setModel(AddressTableModel *model); 33 | void loadRow(int row); 34 | 35 | void accept(); 36 | 37 | QString getAddress() const; 38 | void setAddress(const QString &address); 39 | private: 40 | bool saveCurrentRow(); 41 | 42 | Ui::EditAddressDialog *ui; 43 | QDataWidgetMapper *mapper; 44 | Mode mode; 45 | AddressTableModel *model; 46 | 47 | QString address; 48 | }; 49 | 50 | #endif // EDITADDRESSDIALOG_H 51 | -------------------------------------------------------------------------------- /src/qt/monitoreddatamapper.cpp: -------------------------------------------------------------------------------- 1 | #include "monitoreddatamapper.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | MonitoredDataMapper::MonitoredDataMapper(QObject *parent) : 8 | QDataWidgetMapper(parent) 9 | { 10 | } 11 | 12 | 13 | void MonitoredDataMapper::addMapping(QWidget *widget, int section) 14 | { 15 | QDataWidgetMapper::addMapping(widget, section); 16 | addChangeMonitor(widget); 17 | } 18 | 19 | void MonitoredDataMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName) 20 | { 21 | QDataWidgetMapper::addMapping(widget, section, propertyName); 22 | addChangeMonitor(widget); 23 | } 24 | 25 | void MonitoredDataMapper::addChangeMonitor(QWidget *widget) 26 | { 27 | // Watch user property of widget for changes, and connect 28 | // the signal to our viewModified signal. 29 | QMetaProperty prop = widget->metaObject()->userProperty(); 30 | int signal = prop.notifySignalIndex(); 31 | int method = this->metaObject()->indexOfMethod("viewModified()"); 32 | if(signal != -1 && method != -1) 33 | { 34 | QMetaObject::connect(widget, signal, this, method); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /src/qt/askpassphrasedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ASKPASSPHRASEDIALOG_H 2 | #define ASKPASSPHRASEDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AskPassphraseDialog; 8 | } 9 | 10 | class WalletModel; 11 | 12 | /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. 13 | */ 14 | class AskPassphraseDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | enum Mode { 20 | Encrypt, /**< Ask passphrase twice and encrypt */ 21 | Unlock, /**< Ask passphrase and unlock */ 22 | ChangePass, /**< Ask old passphrase + new passphrase twice */ 23 | Decrypt /**< Ask passphrase and decrypt wallet */ 24 | }; 25 | 26 | explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0); 27 | ~AskPassphraseDialog(); 28 | 29 | void accept(); 30 | 31 | void setModel(WalletModel *model); 32 | 33 | private: 34 | Ui::AskPassphraseDialog *ui; 35 | Mode mode; 36 | WalletModel *model; 37 | bool fCapsLock; 38 | 39 | private slots: 40 | void textChanged(); 41 | bool event(QEvent *event); 42 | bool eventFilter(QObject *, QEvent *event); 43 | }; 44 | 45 | #endif // ASKPASSPHRASEDIALOG_H -------------------------------------------------------------------------------- /src/qt/overviewpage.h: -------------------------------------------------------------------------------- 1 | #ifndef OVERVIEWPAGE_H 2 | #define OVERVIEWPAGE_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QModelIndex; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class OverviewPage; 12 | } 13 | class WalletModel; 14 | class TxViewDelegate; 15 | class TransactionFilterProxy; 16 | 17 | /** Overview ("home") page widget */ 18 | class OverviewPage : public QWidget 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit OverviewPage(QWidget *parent = 0); 24 | ~OverviewPage(); 25 | 26 | void setModel(WalletModel *model); 27 | void showOutOfSyncWarning(bool fShow); 28 | 29 | public slots: 30 | void setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBalance); 31 | 32 | signals: 33 | void transactionClicked(const QModelIndex &index); 34 | 35 | private: 36 | Ui::OverviewPage *ui; 37 | WalletModel *model; 38 | qint64 currentBalance; 39 | qint64 currentStake; 40 | qint64 currentUnconfirmedBalance; 41 | 42 | TxViewDelegate *txdelegate; 43 | TransactionFilterProxy *filter; 44 | 45 | private slots: 46 | void displayUnitChanged(); 47 | void handleTransactionClicked(const QModelIndex &index); 48 | }; 49 | 50 | #endif // OVERVIEWPAGE_H 51 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /contrib/devtools/README.md: -------------------------------------------------------------------------------- 1 | Contents 2 | ======== 3 | This directory contains tools for developers working on this repository. 4 | 5 | fix-copyright-headers.py 6 | ======================== 7 | 8 | Every year newly updated files need to have its copyright headers updated to reflect the current year. 9 | If you run this script from src/ it will automatically update the year on the copyright header for all 10 | .cpp and .h files if these have a git commit from the current year. 11 | 12 | For example a file changed in 2015 (with 2015 being the current year): 13 | ```// Copyright (c) 2013-2014 The Paycoin developers``` 14 | 15 | would be changed to: 16 | ```// Copyright (c) 2013-2015 The Paycoin developers``` 17 | 18 | optimize-pngs.py 19 | ================ 20 | 21 | A script to optimize png files in the paycoin 22 | repository (requires pngcrush). 23 | 24 | update-translations.py 25 | ======================= 26 | 27 | Run this script from the root of the repository to update all translations from transifex. 28 | It will do the following automatically: 29 | 30 | - fetch all translations 31 | - post-process them into valid and committable format 32 | - add missing translations to the build system (TODO) 33 | 34 | See doc/translation-process.md for more information. 35 | -------------------------------------------------------------------------------- /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 p11111 = uint256("0xf725cd1001c73e756ad4ac6632a2c0b5de64393a9ef12d087811b9616a8d3e9e"); 18 | uint256 p134444 = uint256("0x7408a53214c0eb798e2c7a777d32cabc2d42402db6bcd80f0833b3fe6df05f6a"); 19 | BOOST_CHECK(Checkpoints::CheckHardened(11111, p11111)); 20 | BOOST_CHECK(Checkpoints::CheckHardened(134444, p134444)); 21 | 22 | 23 | // Wrong hashes at checkpoints should fail: 24 | BOOST_CHECK(!Checkpoints::CheckHardened(11111, p134444)); 25 | BOOST_CHECK(!Checkpoints::CheckHardened(134444, p11111)); 26 | 27 | // ... but any hash not at a checkpoint should succeed: 28 | BOOST_CHECK(Checkpoints::CheckHardened(11111+1, p134444)); 29 | BOOST_CHECK(Checkpoints::CheckHardened(134444+1, p11111)); 30 | 31 | BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate() >= 134444); 32 | } 33 | 34 | BOOST_AUTO_TEST_SUITE_END() 35 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2009-2012 The Bitcoin developers 4 | Copyright (c) 2011-2014 The Peercoin Developers 5 | Copyright (c) 2014-2016 The Paycoin Developers 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /src/qt/guiconstants.h: -------------------------------------------------------------------------------- 1 | #ifndef GUICONSTANTS_H 2 | #define GUICONSTANTS_H 3 | 4 | /* Milliseconds between model updates */ 5 | static const int MODEL_UPDATE_DELAY = 500; 6 | 7 | /* Maximum passphrase length */ 8 | static const int MAX_PASSPHRASE_SIZE = 1024; 9 | 10 | /* Size of icons in status bar */ 11 | static const int STATUSBAR_ICONSIZE = 16; 12 | 13 | /* Invalid field background style */ 14 | #define STYLE_INVALID "background:#FF8080" 15 | 16 | /* Transaction list -- unconfirmed transaction */ 17 | #define COLOR_UNCONFIRMED QColor(128, 128, 128) 18 | /* Transaction list -- negative amount */ 19 | #define COLOR_NEGATIVE QColor(255, 0, 0) 20 | /* Transaction list -- bare address (without label) */ 21 | #define COLOR_BAREADDRESS QColor(140, 140, 140) 22 | 23 | /* Colors for minting tab for each coin age group */ 24 | #define COLOR_MINT_YOUNG QColor(127, 127, 240) 25 | #define COLOR_MINT_MATURE QColor(127, 240, 127) 26 | #define COLOR_MINT_OLD QColor(240, 127, 127) 27 | 28 | /* Tooltips longer than this (in characters) are converted into rich text, 29 | so that they can be word-wrapped. 30 | */ 31 | static const int TOOLTIP_WRAP_THRESHOLD = 80; 32 | 33 | /* Number of frames in spinner animation */ 34 | #define SPINNER_FRAMES 35 35 | 36 | #endif // GUICONSTANTS_H 37 | -------------------------------------------------------------------------------- /src/qt/multisiginputentry.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTISIGINPUTENTRY_H 2 | #define MULTISIGINPUTENTRY_H 3 | 4 | #include 5 | 6 | #include "uint256.h" 7 | 8 | 9 | class CTxIn; 10 | class WalletModel; 11 | 12 | namespace Ui 13 | { 14 | class MultisigInputEntry; 15 | } 16 | 17 | class MultisigInputEntry : public QFrame 18 | { 19 | Q_OBJECT; 20 | 21 | public: 22 | explicit MultisigInputEntry(QWidget *parent = 0); 23 | ~MultisigInputEntry(); 24 | void setModel(WalletModel *model); 25 | bool validate(); 26 | CTxIn getInput(); 27 | int64 getAmount(); 28 | QString getRedeemScript(); 29 | void setTransactionId(QString transactionId); 30 | void setTransactionOutputIndex(int index); 31 | 32 | public slots: 33 | void setRemoveEnabled(bool enabled); 34 | void clear(); 35 | 36 | signals: 37 | void removeEntry(MultisigInputEntry *entry); 38 | void updateAmount(); 39 | 40 | private: 41 | Ui::MultisigInputEntry *ui; 42 | WalletModel *model; 43 | uint256 txHash; 44 | 45 | private slots: 46 | void on_transactionId_textChanged(const QString &transactionId); 47 | void on_pasteTransactionIdButton_clicked(); 48 | void on_deleteButton_clicked(); 49 | void on_transactionOutput_currentIndexChanged(int index); 50 | void on_pasteRedeemScriptButton_clicked(); 51 | }; 52 | 53 | #endif // MULTISIGINPUTENTRY_H 54 | -------------------------------------------------------------------------------- /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 | Ths script should be invoked in the target directory like this: 9 | $source_dir/contrib/macdeploy/macdeployqtplus Bitcoin-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: Bitcoin-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/qt/sendcoinsentry.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDCOINSENTRY_H 2 | #define SENDCOINSENTRY_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class SendCoinsEntry; 8 | } 9 | class WalletModel; 10 | class SendCoinsRecipient; 11 | 12 | /** A single entry in the dialog for sending bitcoins. */ 13 | class SendCoinsEntry : public QFrame 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit SendCoinsEntry(QWidget *parent = 0); 19 | ~SendCoinsEntry(); 20 | 21 | void setModel(WalletModel *model); 22 | bool validate(); 23 | SendCoinsRecipient getValue(); 24 | 25 | /** Return whether the entry is still empty and unedited */ 26 | bool isClear(); 27 | 28 | void setValue(const SendCoinsRecipient &value); 29 | 30 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). 31 | */ 32 | QWidget *setupTabChain(QWidget *prev); 33 | 34 | void setFocus(); 35 | 36 | public slots: 37 | void setRemoveEnabled(bool enabled); 38 | void clear(); 39 | 40 | signals: 41 | void removeEntry(SendCoinsEntry *entry); 42 | void payAmountChanged(); 43 | 44 | private slots: 45 | void on_deleteButton_clicked(); 46 | void on_payTo_textChanged(const QString &address); 47 | void on_addressBookButton_clicked(); 48 | void on_pasteButton_clicked(); 49 | 50 | private: 51 | Ui::SendCoinsEntry *ui; 52 | WalletModel *model; 53 | }; 54 | 55 | #endif // SENDCOINSENTRY_H 56 | -------------------------------------------------------------------------------- /src/qt/signverifymessagedialog.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT 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 | class WalletModel; 11 | 12 | namespace Ui { 13 | class SignVerifyMessageDialog; 14 | } 15 | 16 | class SignVerifyMessageDialog : public QDialog 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit SignVerifyMessageDialog(QWidget *parent); 22 | ~SignVerifyMessageDialog(); 23 | 24 | void setModel(WalletModel *model); 25 | void setAddress_SM(const QString &address); 26 | void setAddress_VM(const QString &address); 27 | 28 | void showTab_SM(bool fShow); 29 | void showTab_VM(bool fShow); 30 | 31 | protected: 32 | bool eventFilter(QObject *object, QEvent *event); 33 | 34 | private: 35 | Ui::SignVerifyMessageDialog *ui; 36 | WalletModel *model; 37 | 38 | private slots: 39 | /* sign message */ 40 | void on_addressBookButton_SM_clicked(); 41 | void on_pasteButton_SM_clicked(); 42 | void on_signMessageButton_SM_clicked(); 43 | void on_copySignatureButton_SM_clicked(); 44 | void on_clearButton_SM_clicked(); 45 | /* verify message */ 46 | void on_addressBookButton_VM_clicked(); 47 | void on_verifyMessageButton_VM_clicked(); 48 | void on_clearButton_VM_clicked(); 49 | }; 50 | 51 | #endif // SIGNVERIFYMESSAGEDIALOG_H 52 | -------------------------------------------------------------------------------- /src/kernelrecord.h: -------------------------------------------------------------------------------- 1 | #ifndef KERNELRECORD_H 2 | #define KERNELRECORD_H 3 | 4 | #include "uint256.h" 5 | 6 | class CWallet; 7 | class CWalletTx; 8 | 9 | class KernelRecord 10 | { 11 | public: 12 | KernelRecord(): 13 | hash(), nTime(0), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0) 14 | { 15 | } 16 | 17 | KernelRecord(uint256 hash, int64 nTime): 18 | hash(hash), nTime(nTime), address(""), nValue(0), idx(0), spent(false), coinAge(0), prevMinutes(0), prevDifficulty(0), prevProbability(0) 19 | { 20 | } 21 | 22 | KernelRecord(uint256 hash, int64 nTime, 23 | const std::string &address, 24 | int64 nValue, bool spent, int64 coinAge): 25 | hash(hash), nTime(nTime), address(address), nValue(nValue), 26 | idx(0), spent(spent), coinAge(coinAge), prevMinutes(0), prevDifficulty(0), prevProbability(0) 27 | { 28 | } 29 | 30 | static bool showTransaction(const CWalletTx &wtx); 31 | static std::vector decomposeOutput(const CWallet *wallet, const CWalletTx &wtx); 32 | 33 | 34 | uint256 hash; 35 | int64 nTime; 36 | std::string address; 37 | int64 nValue; 38 | int idx; 39 | bool spent; 40 | int64 coinAge; 41 | 42 | std::string getTxID(); 43 | int64 getAge() const; 44 | double getProbToMintStake(double difficulty, int timeOffset = 0) const; 45 | double getProbToMintWithinNMinutes(double difficulty, int minutes); 46 | protected: 47 | int prevMinutes; 48 | double prevDifficulty; 49 | double prevProbability; 50 | }; 51 | 52 | #endif // KERNELRECORD_H 53 | -------------------------------------------------------------------------------- /src/qt/multisigdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef MULTISIGDIALOG_H 2 | #define MULTISIGDIALOG_H 3 | 4 | #include 5 | 6 | #include "multisigaddressentry.h" 7 | #include "multisiginputentry.h" 8 | #include "sendcoinsentry.h" 9 | #include "walletmodel.h" 10 | 11 | 12 | namespace Ui 13 | { 14 | class MultisigDialog; 15 | } 16 | 17 | class MultisigDialog : public QDialog 18 | { 19 | Q_OBJECT; 20 | 21 | public: 22 | explicit MultisigDialog(QWidget *parent); 23 | ~MultisigDialog(); 24 | void setModel(WalletModel *model); 25 | 26 | public slots: 27 | MultisigAddressEntry * addPubKey(); 28 | void clear(); 29 | void updateRemoveEnabled(); 30 | MultisigInputEntry * addInput(); 31 | SendCoinsEntry * addOutput(); 32 | 33 | private: 34 | Ui::MultisigDialog *ui; 35 | WalletModel *model; 36 | 37 | private slots: 38 | void on_createAddressButton_clicked(); 39 | void on_copyMultisigAddressButton_clicked(); 40 | void on_copyRedeemScriptButton_clicked(); 41 | void on_saveRedeemScriptButton_clicked(); 42 | void on_saveMultisigAddressButton_clicked(); 43 | void removeEntry(MultisigAddressEntry *entry); 44 | void on_createTransactionButton_clicked(); 45 | void on_transaction_textChanged(); 46 | void on_copyTransactionButton_clicked(); 47 | void on_pasteTransactionButton_clicked(); 48 | void on_signTransactionButton_clicked(); 49 | void on_copySignedTransactionButton_clicked(); 50 | void on_sendTransactionButton_clicked(); 51 | void removeEntry(MultisigInputEntry *entry); 52 | void removeEntry(SendCoinsEntry *entry); 53 | void updateAmounts(); 54 | }; 55 | 56 | #endif // MULTISIGDIALOG_H 57 | -------------------------------------------------------------------------------- /src/qt/transactionfilterproxy.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONFILTERPROXY_H 2 | #define TRANSACTIONFILTERPROXY_H 3 | 4 | #include 5 | #include 6 | 7 | /** Filter the transaction list according to pre-specified rules. */ 8 | class TransactionFilterProxy : public QSortFilterProxyModel 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit TransactionFilterProxy(QObject *parent = 0); 13 | 14 | /** Earliest date that can be represented (far in the past) */ 15 | static const QDateTime MIN_DATE; 16 | /** Last date that can be represented (far in the future) */ 17 | static const QDateTime MAX_DATE; 18 | /** Type filter bit field (all types) */ 19 | static const quint32 ALL_TYPES = 0xFFFFFFFF; 20 | 21 | static quint32 TYPE(int type) { return 1<= 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/qt/bitcoinamountfield.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOINAMOUNTFIELD_H 2 | #define BITCOINAMOUNTFIELD_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QDoubleSpinBox; 8 | class QValueComboBox; 9 | QT_END_NAMESPACE 10 | 11 | /** Widget for entering bitcoin amounts. 12 | */ 13 | class BitcoinAmountField: public QWidget 14 | { 15 | Q_OBJECT 16 | Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) 17 | public: 18 | explicit BitcoinAmountField(QWidget *parent = 0); 19 | 20 | qint64 value(bool *valid=0) const; 21 | void setValue(qint64 value); 22 | 23 | /** Mark current value as invalid in UI. */ 24 | void setValid(bool valid); 25 | /** Perform input validation, mark field as invalid if entered value is not valid. */ 26 | bool validate(); 27 | 28 | /** Change unit used to display amount. */ 29 | void setDisplayUnit(int unit); 30 | 31 | /** Make field empty and ready for new input. */ 32 | void clear(); 33 | 34 | /** Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907), 35 | in these cases we have to set it up manually. 36 | */ 37 | QWidget *setupTabChain(QWidget *prev); 38 | 39 | signals: 40 | void textChanged(); 41 | 42 | protected: 43 | /** Intercept focus-in event and ',' key presses */ 44 | bool eventFilter(QObject *object, QEvent *event); 45 | 46 | private: 47 | QDoubleSpinBox *amount; 48 | QValueComboBox *unit; 49 | int currentUnit; 50 | 51 | void setText(const QString &text); 52 | QString text() const; 53 | 54 | private slots: 55 | void unitChanged(int idx); 56 | 57 | }; 58 | 59 | 60 | #endif // BITCOINAMOUNTFIELD_H 61 | -------------------------------------------------------------------------------- /contrib/devtools/fix-copyright-headers.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | ''' 3 | Run this script inside of src/ and it will look for all the files 4 | that were changed this year that still have the last year in the 5 | copyright headers, and it will fix the headers on that file using 6 | a perl regex one liner. 7 | 8 | For example: if it finds something like this and we're in 2015 9 | 10 | // Copyright (c) 2013-2014 The Paycoin developers 11 | 12 | it will change it to 13 | 14 | // Copyright (c) 2013-2015 The Paycoin developers 15 | 16 | It will do this for all the files in the folder and its children. 17 | 18 | Author: @gubatron 19 | Modified by: @mitchellcash 20 | ''' 21 | import os 22 | import time 23 | 24 | year = time.gmtime()[0] 25 | last_year = year - 1 26 | command = "perl -pi -e 's/%s The Paycoin/%s The Paycoin/' %s" 27 | listFilesCommand = "find . | grep %s" 28 | 29 | extensions = [".cpp",".h"] 30 | 31 | def getLastGitModifiedDate(filePath): 32 | gitGetLastCommitDateCommand = "git log " + filePath +" | grep Date | head -n 1" 33 | p = os.popen(gitGetLastCommitDateCommand) 34 | result = "" 35 | for l in p: 36 | result = l 37 | break 38 | result = result.replace("\n","") 39 | return result 40 | 41 | n=1 42 | for extension in extensions: 43 | foundFiles = os.popen(listFilesCommand % extension) 44 | for filePath in foundFiles: 45 | filePath = filePath[1:-1] 46 | if filePath.endswith(extension): 47 | filePath = os.getcwd() + filePath 48 | modifiedTime = getLastGitModifiedDate(filePath) 49 | if len(modifiedTime) > 0 and str(year) in modifiedTime: 50 | print n,"Last Git Modified: ", modifiedTime, " - ", filePath 51 | os.popen(command % (last_year,year,filePath)) 52 | n = n + 1 53 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/README: -------------------------------------------------------------------------------- 1 | Setting up a Gitian build environment 2 | ===================================== 3 | 4 | You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization. 5 | 6 | You probably need to enable hardware virtualization in your machine's BIOS. 7 | 8 | You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites: 9 | sudo apt-get install apache2 git apt-cacher-ng python-vm-builder qemu-kvm ruby 10 | 11 | Sanity checks: 12 | sudo service apt-cacher-ng status # Should return apt-cacher-ng is running 13 | ls -l /dev/kvm # Should show a /dev/kvm device 14 | 15 | Once you've got the right hardware and software: 16 | 17 | git clone git://github.com/PaycoinFoundation/paycoin.git 18 | git clone git://github.com/devrandom/gitian-builder.git 19 | mkdir gitian-builder/inputs 20 | 21 | cd gitian-builder 22 | bin/make-base-vm --suite precise --arch i386 23 | bin/make-base-vm --suite precise --arch amd64 24 | cd .. 25 | 26 | To build the software: 27 | If you don't have the dependencies yet, get them and copy them to the inputs directory: 28 | wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.tar.gz' -O gitian-builder/inputs/miniupnpc-1.9.tar.gz 29 | ... 30 | See doc/release-process.md for the complete list of dependencies. 31 | 32 | cd paycoin 33 | git pull 34 | cd ../gitian-builder 35 | git pull 36 | ./bin/gbuild --commit paycoin=HEAD ../bitcoin/contrib/gitian.yml 37 | 38 | If you get a permission issue when you try to use gbuild: 39 | sudo adduser kvm 40 | Then log out, log in and retry 41 | -------------------------------------------------------------------------------- /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/qt/rpcconsole.h: -------------------------------------------------------------------------------- 1 | #ifndef RPCCONSOLE_H 2 | #define RPCCONSOLE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class RPCConsole; 8 | } 9 | class ClientModel; 10 | 11 | /** Local Paycoin RPC console. */ 12 | class RPCConsole: public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit RPCConsole(QWidget *parent = 0); 18 | ~RPCConsole(); 19 | 20 | void setClientModel(ClientModel *model); 21 | 22 | enum MessageClass { 23 | MC_ERROR, 24 | MC_DEBUG, 25 | CMD_REQUEST, 26 | CMD_REPLY, 27 | CMD_ERROR 28 | }; 29 | 30 | protected: 31 | virtual bool eventFilter(QObject* obj, QEvent *event); 32 | 33 | private slots: 34 | void on_lineEdit_returnPressed(); 35 | void on_tabWidget_currentChanged(int index); 36 | /** open the debug.log from the current datadir */ 37 | void on_openDebugLogfileButton_clicked(); 38 | /** display messagebox with program parameters (same as paycoin-qt --help) */ 39 | void on_showCLOptionsButton_clicked(); 40 | 41 | public slots: 42 | void clear(); 43 | void message(int category, const QString &message, bool html = false); 44 | /** Set number of connections shown in the UI */ 45 | void setNumConnections(int count); 46 | /** Set number of blocks shown in the UI */ 47 | void setNumBlocks(int count); 48 | /** Go forward or back in history */ 49 | void browseHistory(int offset); 50 | /** Scroll console view to end */ 51 | void scrollToEnd(); 52 | signals: 53 | // For RPC command executor 54 | void stopExecutor(); 55 | void cmdRequest(const QString &command); 56 | 57 | private: 58 | Ui::RPCConsole *ui; 59 | ClientModel *clientModel; 60 | QStringList history; 61 | int historyPtr; 62 | 63 | void startExecutor(); 64 | }; 65 | 66 | #endif // RPCCONSOLE_H 67 | -------------------------------------------------------------------------------- /src/qt/clientmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTMODEL_H 2 | #define CLIENTMODEL_H 3 | 4 | #include 5 | 6 | class OptionsModel; 7 | class AddressTableModel; 8 | class TransactionTableModel; 9 | class CWallet; 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QDateTime; 13 | QT_END_NAMESPACE 14 | 15 | /** Model for Bitcoin network client. */ 16 | class ClientModel : public QObject 17 | { 18 | Q_OBJECT 19 | public: 20 | explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0); 21 | 22 | OptionsModel *getOptionsModel(); 23 | 24 | int getNumConnections() const; 25 | int getNumBlocks() const; 26 | int getNumBlocksAtStartup(); 27 | 28 | QDateTime getLastBlockDate() const; 29 | 30 | //! Return true if client connected to testnet 31 | bool isTestNet() const; 32 | //! Return true if core is doing initial block download 33 | bool inInitialBlockDownload() const; 34 | //! Return conservative estimate of total number of blocks, or 0 if unknown 35 | int getNumBlocksOfPeers() const; 36 | //! Return warnings to be displayed in status bar 37 | QString getStatusBarWarnings() const; 38 | 39 | QString formatFullVersion() const; 40 | QString formatBuildDate() const; 41 | QString clientName() const; 42 | QString formatClientStartupTime() const; 43 | 44 | private: 45 | OptionsModel *optionsModel; 46 | 47 | int cachedNumConnections; 48 | int cachedNumBlocks; 49 | QString cachedStatusBar; 50 | 51 | int numBlocksAtStartup; 52 | 53 | signals: 54 | void numConnectionsChanged(int count); 55 | void numBlocksChanged(int count); 56 | 57 | //! Asynchronous error notification 58 | void error(const QString &title, const QString &message, bool modal); 59 | 60 | public slots: 61 | 62 | private slots: 63 | void update(); 64 | }; 65 | 66 | #endif // CLIENTMODEL_H 67 | -------------------------------------------------------------------------------- /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/test/sigopcount_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 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), 0); 25 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 0); 26 | 27 | uint160 dummy; 28 | s1 << OP_1 << dummy << dummy << OP_2 << OP_CHECKMULTISIG; 29 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 2); 30 | s1 << OP_IF << OP_CHECKSIG << OP_ENDIF; 31 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(true), 3); 32 | BOOST_CHECK_EQUAL(s1.GetSigOpCount(false), 21); 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), 3); 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), 3); 50 | BOOST_CHECK_EQUAL(s2.GetSigOpCount(false), 20); 51 | 52 | p2sh.SetDestination(s2.GetID()); 53 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(true), 0); 54 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(false), 0); 55 | CScript scriptSig2; 56 | scriptSig2 << OP_1 << dummy << dummy << Serialize(s2); 57 | BOOST_CHECK_EQUAL(p2sh.GetSigOpCount(scriptSig2), 3); 58 | } 59 | 60 | BOOST_AUTO_TEST_SUITE_END() 61 | -------------------------------------------------------------------------------- /src/qt/mintingtablemodel.h: -------------------------------------------------------------------------------- 1 | #ifndef MINTINGTABLEMODEL_H 2 | #define MINTINGTABLEMODEL_H 3 | 4 | 5 | #include 6 | #include 7 | 8 | class CWallet; 9 | class MintingTablePriv; 10 | class KernelRecord; 11 | class WalletModel; 12 | 13 | class MintingTableModel : public QAbstractTableModel 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit MintingTableModel(CWallet * wallet, WalletModel *parent = 0); 18 | ~MintingTableModel(); 19 | 20 | enum ColumnIndex { 21 | TxHash = 0, 22 | Address = 1, 23 | Age = 2, 24 | Balance = 3, 25 | CoinDay = 4, 26 | MintProbability = 5 27 | }; 28 | 29 | 30 | int rowCount(const QModelIndex &parent) const; 31 | int columnCount(const QModelIndex &parent) const; 32 | QVariant data(const QModelIndex &index, int role) const; 33 | QVariant headerData(int section, Qt::Orientation orientation, int role) const; 34 | QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; 35 | 36 | void setMintingInterval(int interval); 37 | 38 | private: 39 | CWallet* wallet; 40 | WalletModel *walletModel; 41 | QStringList columns; 42 | int mintingInterval; 43 | MintingTablePriv *priv; 44 | 45 | QString lookupAddress(const std::string &address, bool tooltip) const; 46 | 47 | double getDayToMint(KernelRecord *wtx) const; 48 | QString formatDayToMint(KernelRecord *wtx) const; 49 | QString formatTxAddress(const KernelRecord *wtx, bool tooltip) const; 50 | QString formatTxHash(const KernelRecord *wtx) const; 51 | QString formatTxAge(const KernelRecord *wtx) const; 52 | QString formatTxBalance(const KernelRecord *wtx) const; 53 | QString formatTxCoinDay(const KernelRecord *wtx) const; 54 | private slots: 55 | void update(); 56 | 57 | friend class MintingTablePriv; 58 | }; 59 | 60 | #endif // MINTINGTABLEMODEL_H 61 | -------------------------------------------------------------------------------- /src/compat.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT 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 | // Unset FD size if already set before trying to set it again. 15 | #ifdef FD_SETSIZE 16 | #undef FD_SETSIZE 17 | #endif 18 | #define FD_SETSIZE 1024 // max number of fds in fd_set 19 | #include 20 | #include 21 | #include 22 | #else 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #endif 32 | 33 | #ifndef _WIN64 34 | typedef u_int SOCKET; 35 | #endif 36 | #ifdef WIN32 37 | #define MSG_NOSIGNAL 0 38 | #define MSG_DONTWAIT 0 39 | typedef int socklen_t; 40 | #else 41 | #include "errno.h" 42 | #define WSAGetLastError() errno 43 | #define WSAEINVAL EINVAL 44 | #define WSAEALREADY EALREADY 45 | #define WSAEWOULDBLOCK EWOULDBLOCK 46 | #define WSAEMSGSIZE EMSGSIZE 47 | #define WSAEINTR EINTR 48 | #define WSAEINPROGRESS EINPROGRESS 49 | #define WSAEADDRINUSE EADDRINUSE 50 | #define WSAENOTSOCK EBADF 51 | #define INVALID_SOCKET (SOCKET)(~0) 52 | #define SOCKET_ERROR -1 53 | #endif 54 | 55 | inline int myclosesocket(SOCKET& hSocket) 56 | { 57 | if (hSocket == INVALID_SOCKET) 58 | return WSAENOTSOCK; 59 | #ifdef WIN32 60 | int ret = closesocket(hSocket); 61 | #else 62 | int ret = close(hSocket); 63 | #endif 64 | hSocket = INVALID_SOCKET; 65 | return ret; 66 | } 67 | #define closesocket(s) myclosesocket(s) 68 | 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/qt/sendcoinsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDCOINSDIALOG_H 2 | #define SENDCOINSDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class SendCoinsDialog; 9 | } 10 | class WalletModel; 11 | class SendCoinsEntry; 12 | class SendCoinsRecipient; 13 | 14 | QT_BEGIN_NAMESPACE 15 | class QUrl; 16 | QT_END_NAMESPACE 17 | 18 | /** Dialog for sending bitcoins */ 19 | class SendCoinsDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit SendCoinsDialog(QWidget *parent = 0); 25 | ~SendCoinsDialog(); 26 | 27 | void setModel(WalletModel *model); 28 | 29 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue http://bugreports.qt.nokia.com/browse/QTBUG-10907). 30 | */ 31 | QWidget *setupTabChain(QWidget *prev); 32 | 33 | void pasteEntry(const SendCoinsRecipient &rv); 34 | void handleURI(const QString &uri); 35 | 36 | public slots: 37 | void clear(); 38 | void reject(); 39 | void accept(); 40 | SendCoinsEntry *addEntry(); 41 | void updateRemoveEnabled(); 42 | void setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBalance); 43 | 44 | private: 45 | Ui::SendCoinsDialog *ui; 46 | WalletModel *model; 47 | bool fNewRecipientAllowed; 48 | 49 | private slots: 50 | void on_sendButton_clicked(); 51 | 52 | void removeEntry(SendCoinsEntry* entry); 53 | void updateDisplayUnit(); 54 | void coinControlFeatureChanged(bool); 55 | void coinControlButtonClicked(); 56 | void coinControlChangeChecked(int); 57 | void coinControlChangeEdited(const QString &); 58 | void coinControlUpdateLabels(); 59 | void coinControlClipboardQuantity(); 60 | void coinControlClipboardAmount(); 61 | void coinControlClipboardFee(); 62 | void coinControlClipboardAfterFee(); 63 | void coinControlClipboardBytes(); 64 | void coinControlClipboardPriority(); 65 | void coinControlClipboardLowOutput(); 66 | void coinControlClipboardChange(); 67 | }; 68 | 69 | #endif // SENDCOINSDIALOG_H 70 | -------------------------------------------------------------------------------- /src/qt/csvmodelwriter.cpp: -------------------------------------------------------------------------------- 1 | #include "csvmodelwriter.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | CSVModelWriter::CSVModelWriter(const QString &filename, QObject *parent) : 8 | QObject(parent), 9 | filename(filename), model(0) 10 | { 11 | } 12 | 13 | void CSVModelWriter::setModel(const QAbstractItemModel *model) 14 | { 15 | this->model = model; 16 | } 17 | 18 | void CSVModelWriter::addColumn(const QString &title, int column, int role) 19 | { 20 | Column col; 21 | col.title = title; 22 | col.column = column; 23 | col.role = role; 24 | 25 | columns.append(col); 26 | } 27 | 28 | static void writeValue(QTextStream &f, const QString &value) 29 | { 30 | QString escaped = value; 31 | escaped.replace('"', "\"\""); 32 | f << "\"" << escaped << "\""; 33 | } 34 | 35 | static void writeSep(QTextStream &f) 36 | { 37 | f << ","; 38 | } 39 | 40 | static void writeNewline(QTextStream &f) 41 | { 42 | f << "\n"; 43 | } 44 | 45 | bool CSVModelWriter::write() 46 | { 47 | QFile file(filename); 48 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text)) 49 | return false; 50 | QTextStream out(&file); 51 | 52 | int numRows = 0; 53 | if(model) 54 | { 55 | numRows = model->rowCount(); 56 | } 57 | 58 | // Header row 59 | for(int i=0; iindex(j, columns[i].column).data(columns[i].role); 79 | writeValue(out, data.toString()); 80 | } 81 | writeNewline(out); 82 | } 83 | 84 | file.close(); 85 | 86 | return file.error() == QFile::NoError; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/qt/bitcoinunits.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOINUNITS_H 2 | #define BITCOINUNITS_H 3 | 4 | #include 5 | #include 6 | 7 | /** Bitcoin unit definitions. Encapsulates parsing and formatting 8 | and serves as list model for drop-down selection boxes. 9 | */ 10 | class BitcoinUnits: public QAbstractListModel 11 | { 12 | public: 13 | explicit BitcoinUnits(QObject *parent); 14 | 15 | /** Bitcoin units. 16 | @note Source: https://en.bitcoin.it/wiki/Units . Please add only sensible ones 17 | */ 18 | enum Unit 19 | { 20 | BTC, 21 | mBTC, 22 | uBTC 23 | }; 24 | 25 | //! @name Static API 26 | //! Unit conversion and formatting 27 | ///@{ 28 | 29 | //! Get list of units, for drop-down box 30 | static QList availableUnits(); 31 | //! Is unit ID valid? 32 | static bool valid(int unit); 33 | //! Short name 34 | static QString name(int unit); 35 | //! Longer description 36 | static QString description(int unit); 37 | //! Number of Satoshis (1e-8) per unit 38 | static qint64 factor(int unit); 39 | //! Number of amount digits (to represent max number of coins) 40 | static int amountDigits(int unit); 41 | //! Number of decimals left 42 | static int decimals(int unit); 43 | //! Format as string 44 | static QString format(int unit, qint64 amount, bool plussign=false); 45 | //! Format as string (with unit) 46 | static QString formatWithUnit(int unit, qint64 amount, bool plussign=false); 47 | //! Parse string to coin amount 48 | static bool parse(int unit, const QString &value, qint64 *val_out); 49 | ///@} 50 | 51 | //! @name AbstractListModel implementation 52 | //! List model for unit drop-down selection box. 53 | ///@{ 54 | enum RoleIndex { 55 | /** Unit identifier */ 56 | UnitRole = Qt::UserRole 57 | }; 58 | int rowCount(const QModelIndex &parent) const; 59 | QVariant data(const QModelIndex &index, int role) const; 60 | ///@} 61 | private: 62 | QList unitlist; 63 | }; 64 | typedef BitcoinUnits::Unit BitcoinUnit; 65 | 66 | #endif // BITCOINUNITS_H 67 | -------------------------------------------------------------------------------- /src/qt/transactionview.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONVIEW_H 2 | #define TRANSACTIONVIEW_H 3 | 4 | #include 5 | 6 | class WalletModel; 7 | class TransactionFilterProxy; 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QTableView; 11 | class QComboBox; 12 | class QLineEdit; 13 | class QModelIndex; 14 | class QMenu; 15 | class QFrame; 16 | class QDateTimeEdit; 17 | QT_END_NAMESPACE 18 | 19 | /** Widget showing the transaction list for a wallet, including a filter row. 20 | Using the filter row, the user can view or export a subset of the transactions. 21 | */ 22 | class TransactionView : public QWidget 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit TransactionView(QWidget *parent = 0); 27 | 28 | void setModel(WalletModel *model); 29 | 30 | // Date ranges for filter 31 | enum DateEnum 32 | { 33 | All, 34 | Today, 35 | ThisWeek, 36 | ThisMonth, 37 | LastMonth, 38 | ThisYear, 39 | Range 40 | }; 41 | 42 | private: 43 | WalletModel *model; 44 | TransactionFilterProxy *transactionProxyModel; 45 | QTableView *transactionView; 46 | 47 | QComboBox *dateWidget; 48 | QComboBox *typeWidget; 49 | QLineEdit *addressWidget; 50 | QLineEdit *amountWidget; 51 | 52 | QMenu *contextMenu; 53 | 54 | QFrame *dateRangeWidget; 55 | QDateTimeEdit *dateFrom; 56 | QDateTimeEdit *dateTo; 57 | 58 | QWidget *createDateRangeWidget(); 59 | 60 | private slots: 61 | void contextualMenu(const QPoint &); 62 | void dateRangeChanged(); 63 | void showDetails(); 64 | void copyAddress(); 65 | void editLabel(); 66 | void copyLabel(); 67 | void copyAmount(); 68 | void copyTransactionId(); 69 | void openTransactionInLedger(); 70 | void clearOrphans(); 71 | 72 | signals: 73 | void doubleClicked(const QModelIndex&); 74 | 75 | public slots: 76 | void chooseDate(int idx); 77 | void chooseType(int idx); 78 | void changedPrefix(const QString &prefix); 79 | void changedAmount(const QString &amount); 80 | void exportClicked(); 81 | void focusTransaction(const QModelIndex&); 82 | 83 | }; 84 | 85 | #endif // TRANSACTIONVIEW_H 86 | -------------------------------------------------------------------------------- /src/qt/addressbookpage.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDRESSBOOKPAGE_H 2 | #define ADDRESSBOOKPAGE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AddressBookPage; 8 | } 9 | class AddressTableModel; 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QTableView; 13 | class QItemSelection; 14 | class QSortFilterProxyModel; 15 | class QMenu; 16 | QT_END_NAMESPACE 17 | 18 | /** Widget that shows a list of sending or receiving addresses. 19 | */ 20 | class AddressBookPage : public QDialog 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | enum Tabs { 26 | SendingTab = 0, 27 | ReceivingTab = 1 28 | }; 29 | 30 | enum Mode { 31 | ForSending, /**< Open address book to pick address for sending */ 32 | ForEditing /**< Open address book for editing */ 33 | }; 34 | 35 | explicit AddressBookPage(Mode mode, Tabs tab, QWidget *parent = 0); 36 | ~AddressBookPage(); 37 | 38 | void setModel(AddressTableModel *model); 39 | const QString &getReturnValue() const { return returnValue; } 40 | 41 | public slots: 42 | void done(int retval); 43 | void exportClicked(); 44 | 45 | private: 46 | Ui::AddressBookPage *ui; 47 | AddressTableModel *model; 48 | Mode mode; 49 | Tabs tab; 50 | QString returnValue; 51 | QSortFilterProxyModel *proxyModel; 52 | QMenu *contextMenu; 53 | QAction *deleteAction; 54 | 55 | private slots: 56 | void on_deleteButton_clicked(); 57 | void on_newAddressButton_clicked(); 58 | /** Copy address of currently selected address entry to clipboard */ 59 | void on_copyToClipboard_clicked(); 60 | /** Copy scrape address of currently selected address entry to clipboard */ 61 | void on_copyScrapeAddrToClipboard_clicked(); 62 | void on_signMessage_clicked(); 63 | void selectionChanged(); 64 | void on_showQRCode_clicked(); 65 | /** Spawn contextual menu (right mouse menu) for address book entry */ 66 | void contextualMenu(const QPoint &point); 67 | 68 | /** Copy label of currently selected address entry to clipboard */ 69 | void onCopyLabelAction(); 70 | /** Edit currently selected address entry */ 71 | void onEditAction(); 72 | }; 73 | 74 | #endif // ADDRESSBOOKPAGE_H 75 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-linux.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "paycoin" 3 | suites: 4 | - "precise" 5 | architectures: 6 | - "i386" 7 | - "amd64" 8 | packages: 9 | - "g++" 10 | - "git-core" 11 | - "unzip" 12 | - "pkg-config" 13 | - "faketime" 14 | - "zlib1g-dev" 15 | - "qt4-qmake" 16 | - "libqt4-dev" 17 | reference_datetime: "2011-01-30 00:00:00" 18 | remotes: 19 | - "url": "https://github.com/paycoinfoundation/paycoin.git" 20 | "dir": "paycoin" 21 | files: 22 | - "paycoin-deps-linux32-gitian-r6.zip" 23 | - "paycoin-deps-linux64-gitian-r6.zip" 24 | - "boost-linux32-1.55.0-gitian-r1.zip" 25 | - "boost-linux64-1.55.0-gitian-r1.zip" 26 | script: | 27 | STAGING="$HOME/install" 28 | OPTFLAGS='-O2' 29 | BINDIR="${OUTDIR}/bin/${GBUILD_BITS}" # 32/64 bit build specific output directory 30 | TEMPDIR="$HOME/tempdir" 31 | export TZ=UTC 32 | export LIBRARY_PATH="$STAGING/lib" 33 | export PATH="$STAGING/bin:$PATH" 34 | mkdir -p ${BINDIR} 35 | # 36 | mkdir -p $STAGING 37 | cd $STAGING 38 | unzip ../build/paycoin-deps-linux${GBUILD_BITS}-gitian-r6.zip 39 | unzip ../build/boost-linux${GBUILD_BITS}-1.55.0-gitian-r1.zip 40 | cd .. 41 | # 42 | cd $HOME/build/paycoin 43 | git archive --format=tar -o paycoin.tar HEAD 44 | cp doc/README.md $OUTDIR 45 | cp COPYING $OUTDIR 46 | DISTNAME=paycoin.tar 47 | # 48 | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 49 | export FAKETIME=$REFERENCE_DATETIME 50 | 51 | qmake INCLUDEPATH="$STAGING/include" LIBS="-L$STAGING/lib" USE_QRCODE=1 RELEASE=1 BOOST_LIB_SUFFIX=-mt QMAKE_CXXFLAGS=-frandom-seed=paycoin QMAKE_LFLAGS=-frandom-seed=paycoin 52 | make $MAKEOPTS 53 | install -s paycoin-qt $BINDIR 54 | 55 | cd src 56 | make -f makefile.unix STATIC=1 $MAKEOPTS paycoind USE_UPNP=1 BDB_INCLUDE_PATH=$STAGING/include BDB_LIB_PATH=$STAGING/lib BOOST_LIB_SUFFIX=-mt DEBUGFLAGS= 57 | install -s paycoind $BINDIR 58 | 59 | # sort distribution tar file and normalize user/group/mtime information for deterministic output 60 | mkdir -p $OUTDIR/src 61 | rm -rf $TEMPDIR 62 | mkdir -p $TEMPDIR 63 | cd $TEMPDIR 64 | tar -xvf $HOME/build/paycoin/$DISTNAME | sort | tar --no-recursion -cT /dev/stdin --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 --mtime="$REFERENCE_DATETIME" | gzip -n > $OUTDIR/src/$DISTNAME.gz 65 | -------------------------------------------------------------------------------- /src/qt/optionsmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTIONSMODEL_H 2 | #define OPTIONSMODEL_H 3 | 4 | #include 5 | 6 | /** Interface from Qt to configuration data structure for Paycoin client. 7 | To Qt, the options are presented as a list with the different options 8 | laid out vertically. 9 | This can be changed to a tree once the settings become sufficiently 10 | complex. 11 | */ 12 | class OptionsModel : public QAbstractListModel 13 | { 14 | Q_OBJECT 15 | public: 16 | explicit OptionsModel(QObject *parent = 0); 17 | 18 | enum OptionID { 19 | StartAtStartup, // bool 20 | MinimizeToTray, // bool 21 | MapPortUPnP, // bool 22 | MinimizeOnClose, // bool 23 | ProxyUse, // bool 24 | ProxySocksVersion, // int 25 | ProxyIP, // QString 26 | ProxyPort, // QString 27 | Fee, // qint64 28 | DisplayUnit, // BitcoinUnits::Unit 29 | DisplayAddresses, // bool 30 | DetachDatabases, // bool 31 | CoinControlFeatures, // bool 32 | Language, // QString 33 | OptionIDRowCount, 34 | }; 35 | 36 | void Init(); 37 | 38 | /* Migrate settings from wallet.dat after app initialization */ 39 | bool Upgrade(); /* returns true if settings upgraded */ 40 | 41 | int rowCount(const QModelIndex & parent = QModelIndex()) const; 42 | QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const; 43 | bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); 44 | 45 | /* Explicit getters */ 46 | qint64 getTransactionFee(); 47 | bool getMinimizeToTray() { return fMinimizeToTray; } 48 | bool getMinimizeOnClose() { return fMinimizeOnClose; } 49 | int getDisplayUnit() { return nDisplayUnit; } 50 | bool getDisplayAddresses() { return bDisplayAddresses; } 51 | bool getCoinControlFeatures(); 52 | QString getLanguage() { return language; } 53 | private: 54 | int nDisplayUnit; 55 | bool bDisplayAddresses; 56 | bool fMinimizeToTray; 57 | bool fMinimizeOnClose; 58 | bool fCoinControlFeatures; 59 | QString language; 60 | signals: 61 | void displayUnitChanged(int unit); 62 | void transactionFeeChanged(qint64); 63 | void coinControlFeaturesChanged(bool); 64 | }; 65 | 66 | #endif // OPTIONSMODEL_H 67 | -------------------------------------------------------------------------------- /src/ui_interface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_UI_INTERFACE_H 5 | #define BITCOIN_UI_INTERFACE_H 6 | 7 | #include 8 | #include "util.h" // for int64 9 | 10 | #define wxYES 0x00000002 11 | #define wxOK 0x00000004 12 | #define wxNO 0x00000008 13 | #define wxYES_NO (wxYES|wxNO) 14 | #define wxCANCEL 0x00000010 15 | #define wxAPPLY 0x00000020 16 | #define wxCLOSE 0x00000040 17 | #define wxOK_DEFAULT 0x00000000 18 | #define wxYES_DEFAULT 0x00000000 19 | #define wxNO_DEFAULT 0x00000080 20 | #define wxCANCEL_DEFAULT 0x80000000 21 | #define wxICON_EXCLAMATION 0x00000100 22 | #define wxICON_HAND 0x00000200 23 | #define wxICON_WARNING wxICON_EXCLAMATION 24 | #define wxICON_ERROR wxICON_HAND 25 | #define wxICON_QUESTION 0x00000400 26 | #define wxICON_INFORMATION 0x00000800 27 | #define wxICON_STOP wxICON_HAND 28 | #define wxICON_ASTERISK wxICON_INFORMATION 29 | #define wxICON_MASK (0x00000100|0x00000200|0x00000400|0x00000800) 30 | #define wxFORWARD 0x00001000 31 | #define wxBACKWARD 0x00002000 32 | #define wxRESET 0x00004000 33 | #define wxHELP 0x00008000 34 | #define wxMORE 0x00010000 35 | #define wxSETUP 0x00020000 36 | // Force blocking, modal message box dialog (not just notification) 37 | #define wxMODAL 0x00040000 38 | 39 | /* These UI communication functions are implemented in bitcoin.cpp (for ui) and noui.cpp (no ui) */ 40 | 41 | extern int ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style=wxOK); 42 | extern bool ThreadSafeAskFee(int64 nFeeRequired, const std::string& strCaption); 43 | extern void ThreadSafeHandleURI(const std::string& strURI); 44 | extern void MainFrameRepaint(); 45 | extern void AddressBookRepaint(); 46 | extern void QueueShutdown(); 47 | extern void InitMessage(const std::string &message); 48 | extern std::string _(const char* psz); 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/mruset.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Bitcoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_MRUSET_H 5 | #define BITCOIN_MRUSET_H 6 | 7 | #include 8 | #include 9 | 10 | /** STL-like set container that only keeps the most recent N elements. */ 11 | template class mruset 12 | { 13 | public: 14 | typedef T key_type; 15 | typedef T value_type; 16 | typedef typename std::set::iterator iterator; 17 | typedef typename std::set::const_iterator const_iterator; 18 | typedef typename std::set::size_type size_type; 19 | 20 | protected: 21 | std::set set; 22 | std::deque queue; 23 | size_type nMaxSize; 24 | 25 | public: 26 | mruset(size_type nMaxSizeIn = 0) { nMaxSize = nMaxSizeIn; } 27 | iterator begin() const { return set.begin(); } 28 | iterator end() const { return set.end(); } 29 | size_type size() const { return set.size(); } 30 | bool empty() const { return set.empty(); } 31 | iterator find(const key_type& k) const { return set.find(k); } 32 | size_type count(const key_type& k) const { return set.count(k); } 33 | bool inline friend operator==(const mruset& a, const mruset& b) { return a.set == b.set; } 34 | bool inline friend operator==(const mruset& a, const std::set& b) { return a.set == b; } 35 | bool inline friend operator<(const mruset& a, const mruset& b) { return a.set < b.set; } 36 | std::pair insert(const key_type& x) 37 | { 38 | std::pair ret = set.insert(x); 39 | if (ret.second) 40 | { 41 | if (nMaxSize && queue.size() == nMaxSize) 42 | { 43 | set.erase(queue.front()); 44 | queue.pop_front(); 45 | } 46 | queue.push_back(x); 47 | } 48 | return ret; 49 | } 50 | size_type max_size() const { return nMaxSize; } 51 | size_type max_size(size_type s) 52 | { 53 | if (s) 54 | while (queue.size() >= s) 55 | { 56 | set.erase(queue.front()); 57 | queue.pop_front(); 58 | } 59 | nMaxSize = s; 60 | return nMaxSize; 61 | } 62 | }; 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /src/qt/bitcoinaddressvalidator.cpp: -------------------------------------------------------------------------------- 1 | #include "bitcoinaddressvalidator.h" 2 | 3 | /* Base58 characters are: 4 | "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz" 5 | 6 | This is: 7 | - All numbers except for '0' 8 | - All uppercase letters except for 'I' and 'O' 9 | - All lowercase letters except for 'l' 10 | 11 | User friendly Base58 input can map 12 | - 'l' and 'I' to '1' 13 | - '0' and 'O' to 'o' 14 | */ 15 | 16 | BitcoinAddressValidator::BitcoinAddressValidator(QObject *parent) : 17 | QValidator(parent) 18 | { 19 | } 20 | 21 | QValidator::State BitcoinAddressValidator::validate(QString &input, int &pos) const 22 | { 23 | // Correction 24 | for(int idx=0; idx= '0' && ch<='9') || 58 | (ch >= 'a' && ch<='z') || 59 | (ch >= 'A' && ch<='Z')) && 60 | ch != 'l' && ch != 'I' && ch != '0' && ch != 'O') 61 | { 62 | // Alphanumeric and not a 'forbidden' character 63 | } 64 | else 65 | { 66 | state = QValidator::Invalid; 67 | } 68 | } 69 | 70 | // Empty address is "intermediate" input 71 | if(input.isEmpty()) 72 | { 73 | state = QValidator::Intermediate; 74 | } 75 | 76 | return state; 77 | } 78 | -------------------------------------------------------------------------------- /contrib/debian/control: -------------------------------------------------------------------------------- 1 | Source: bitcoin 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Jonas Smedegaard 5 | Uploaders: Micah Anderson 6 | Build-Depends: debhelper, 7 | devscripts, 8 | libboost-system-dev (>> 1.35) | libboost-system1.35-dev, 9 | libdb4.8++-dev, 10 | libssl-dev, 11 | pkg-config, 12 | libminiupnpc8-dev, 13 | libboost-filesystem-dev (>> 1.35) | libboost-filesystem1.35-dev, 14 | libboost-program-options-dev (>> 1.35) | libboost-program-options1.35-dev, 15 | libboost-thread-dev (>> 1.35) | libboost-thread1.35-dev, 16 | libboost-test-dev (>> 1.35) | libboost-test1.35-dev, 17 | qt4-qmake, 18 | libqt4-dev, 19 | libqrencode-dev 20 | Standards-Version: 3.9.2 21 | Homepage: https://www.bitcoin.org/ 22 | Vcs-Git: git://github.com/bitcoin/bitcoin.git 23 | Vcs-Browser: https://github.com/bitcoin/bitcoin 24 | 25 | Package: bitcoind 26 | Architecture: any 27 | Depends: ${shlibs:Depends}, ${misc:Depends} 28 | Description: peer-to-peer network based digital currency - daemon 29 | Bitcoin is a free open source peer-to-peer electronic cash system that 30 | is completely decentralized, without the need for a central server or 31 | trusted parties. Users hold the crypto keys to their own money and 32 | transact directly with each other, with the help of a P2P network to 33 | check for double-spending. 34 | . 35 | By default connects to an IRC network to discover other peers. 36 | . 37 | Full transaction history is stored locally at each client. This 38 | requires 2+ GB of space, slowly growing. 39 | . 40 | This package provides bitcoind, a combined daemon and CLI tool to 41 | interact with the daemon. 42 | 43 | Package: bitcoin-qt 44 | Architecture: any 45 | Depends: ${shlibs:Depends}, ${misc:Depends} 46 | Description: peer-to-peer network based digital currency - QT GUI 47 | Bitcoin is a free open source peer-to-peer electronic cash system that 48 | is completely decentralized, without the need for a central server or 49 | trusted parties. Users hold the crypto keys to their own money and 50 | transact directly with each other, with the help of a P2P network to 51 | check for double-spending. 52 | . 53 | By default connects to an IRC network to discover other peers. 54 | . 55 | Full transaction history is stored locally at each client. This 56 | requires 2+ GB of space, slowly growing. 57 | . 58 | This package provides bitcoin-qt, a GUI for Bitcoin based on QT. 59 | -------------------------------------------------------------------------------- /doc/build-osx.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Paycoin Developers 2 | Copyright (c) 2009-2012 Bitcoin Developers 3 | Distributed under the MIT software license, see the accompanying file 4 | COPYING or http://www.opensource.org/licenses/mit-license.php. This 5 | product includes software developed by the OpenSSL Project for use in the 6 | OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic 7 | software written by Eric Young (eay@cryptsoft.com) and UPnP software written by 8 | Thomas Bernard. 9 | 10 | 11 | Mac OS X bitcoind build instructions 12 | ==================================== 13 | Laszlo Hanyecz 14 | Douglas Huff 15 | 16 | Modified for Paycoin by Jeff Larkin 17 | Modified for Paycoin by Ben Rossi 18 | 19 | 20 | See readme-qt.md for instructions on building the Paycoin community version of Paycoin QT, the 21 | graphical user interface. 22 | 23 | Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian. 24 | 25 | All of the commands should be executed in Terminal.app.. it's in 26 | /Applications/Utilities 27 | 28 | You need to install XCode with all the options checked so that the compiler and 29 | everything is available in /usr not just /Developer I think it comes on the DVD 30 | but you can get the current version from https://developer.apple.com 31 | 32 | 33 | 1. Clone the github tree to get the source code: 34 | 35 | git clone git@github.com/PaycoinFoundation/paycoin.git paycoin 36 | 37 | 2. Download and install MacPorts from http://www.macports.org/ 38 | 39 | 2a. (for maximum compatibility with 32-bit installs) 40 | 41 | Edit /opt/local/etc/macports/macports.conf and uncomment "build_arch i386" 42 | 43 | 3. Install dependencies from MacPorts 44 | 45 | sudo port install boost db48 openssl miniupnpc 46 | 47 | Optionally install qrencode (and set USE_QRCODE=1): 48 | sudo port install qrencode 49 | 50 | 4. Now you should be able to build bitcoind: 51 | 52 | cd paycoin/src 53 | make -f makefile.osx 54 | 55 | 56 | To build 64-bit binaries: 57 | ========================= 58 | 59 | make -f makefile.osx RELEASE=true 64BIT=true 60 | 61 | Run: 62 | 63 | ./paycoind --help # for a list of command-line options. 64 | Run: 65 | 66 | ./paycoind -daemon # to start the bitcoin daemon. 67 | Run: 68 | 69 | ./paycoind help # When the daemon is running, to get a list of RPC commands -------------------------------------------------------------------------------- /src/test/mruset_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | #include "mruset.h" 6 | #include "util.h" 7 | 8 | #define NUM_TESTS 16 9 | #define MAX_SIZE 100 10 | 11 | class mrutester 12 | { 13 | private: 14 | mruset mru; 15 | std::set set; 16 | 17 | public: 18 | mrutester() { mru.max_size(MAX_SIZE); } 19 | int size() const { return set.size(); } 20 | 21 | void insert(int n) 22 | { 23 | mru.insert(n); 24 | set.insert(n); 25 | BOOST_CHECK(mru == set); 26 | } 27 | }; 28 | 29 | BOOST_AUTO_TEST_SUITE(mruset_tests) 30 | 31 | // Test that an mruset behaves like a set, as long as no more than MAX_SIZE elements are in it 32 | BOOST_AUTO_TEST_CASE(mruset_like_set) 33 | { 34 | 35 | for (int nTest=0; nTest mru(MAX_SIZE); 50 | for (int nAction=0; nAction<3*MAX_SIZE; nAction++) 51 | { 52 | int n = GetRandInt(2 * MAX_SIZE); 53 | mru.insert(n); 54 | BOOST_CHECK(mru.size() <= MAX_SIZE); 55 | } 56 | } 57 | } 58 | 59 | // 16-bit permutation function 60 | int static permute(int n) 61 | { 62 | // hexadecimals of pi; verified to be linearly independent 63 | static const int table[16] = {0x243F, 0x6A88, 0x85A3, 0x08D3, 0x1319, 0x8A2E, 0x0370, 0x7344, 64 | 0xA409, 0x3822, 0x299F, 0x31D0, 0x082E, 0xFA98, 0xEC4E, 0x6C89}; 65 | 66 | int ret = 0; 67 | for (int bit=0; bit<16; bit++) 68 | if (n & (1< mru(MAX_SIZE); 78 | for (int n=0; n<10*MAX_SIZE; n++) 79 | { 80 | mru.insert(permute(n)); 81 | 82 | set tester; 83 | for (int m=max(0,n-MAX_SIZE+1); m<=n; m++) 84 | tester.insert(permute(m)); 85 | 86 | BOOST_CHECK(mru == tester); 87 | } 88 | } 89 | 90 | BOOST_AUTO_TEST_SUITE_END() 91 | -------------------------------------------------------------------------------- /src/json/json_spirit_writer.cpp: -------------------------------------------------------------------------------- 1 | // Copyright John W. Wilkinson 2007 - 2009. 2 | // Distributed under the MIT License, see accompanying file LICENSE.txt 3 | 4 | // json spirit version 4.03 5 | 6 | #include "json_spirit_writer.h" 7 | #include "json_spirit_writer_template.h" 8 | 9 | void json_spirit::write( const Value& value, std::ostream& os ) 10 | { 11 | write_stream( value, os, false ); 12 | } 13 | 14 | void json_spirit::write_formatted( const Value& value, std::ostream& os ) 15 | { 16 | write_stream( value, os, true ); 17 | } 18 | 19 | std::string json_spirit::write( const Value& value ) 20 | { 21 | return write_string( value, false ); 22 | } 23 | 24 | std::string json_spirit::write_formatted( const Value& value ) 25 | { 26 | return write_string( value, true ); 27 | } 28 | 29 | #ifndef BOOST_NO_STD_WSTRING 30 | 31 | void json_spirit::write( const wValue& value, std::wostream& os ) 32 | { 33 | write_stream( value, os, false ); 34 | } 35 | 36 | void json_spirit::write_formatted( const wValue& value, std::wostream& os ) 37 | { 38 | write_stream( value, os, true ); 39 | } 40 | 41 | std::wstring json_spirit::write( const wValue& value ) 42 | { 43 | return write_string( value, false ); 44 | } 45 | 46 | std::wstring json_spirit::write_formatted( const wValue& value ) 47 | { 48 | return write_string( value, true ); 49 | } 50 | 51 | #endif 52 | 53 | void json_spirit::write( const mValue& value, std::ostream& os ) 54 | { 55 | write_stream( value, os, false ); 56 | } 57 | 58 | void json_spirit::write_formatted( const mValue& value, std::ostream& os ) 59 | { 60 | write_stream( value, os, true ); 61 | } 62 | 63 | std::string json_spirit::write( const mValue& value ) 64 | { 65 | return write_string( value, false ); 66 | } 67 | 68 | std::string json_spirit::write_formatted( const mValue& value ) 69 | { 70 | return write_string( value, true ); 71 | } 72 | 73 | #ifndef BOOST_NO_STD_WSTRING 74 | 75 | void json_spirit::write( const wmValue& value, std::wostream& os ) 76 | { 77 | write_stream( value, os, false ); 78 | } 79 | 80 | void json_spirit::write_formatted( const wmValue& value, std::wostream& os ) 81 | { 82 | write_stream( value, os, true ); 83 | } 84 | 85 | std::wstring json_spirit::write( const wmValue& value ) 86 | { 87 | return write_string( value, false ); 88 | } 89 | 90 | std::wstring json_spirit::write_formatted( const wmValue& value ) 91 | { 92 | return write_string( value, true ); 93 | } 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /src/test/data/script_valid.json: -------------------------------------------------------------------------------- 1 | [ 2 | ["2 -2 ADD", "0 EQUAL"], 3 | ["2147483647 -2147483647 ADD", "0 EQUAL"], 4 | ["-1 -1 ADD", "-2 EQUAL"], 5 | 6 | ["1","NOP"], 7 | ["0 0","EQUAL"], 8 | ["1 1 ADD", "2 EQUAL"], 9 | ["1 1ADD", "2 EQUAL"], 10 | ["111 1SUB", "110 EQUAL"], 11 | ["111 1 ADD 12 SUB", "100 EQUAL"], 12 | ["0 ABS", "0 EQUAL"], 13 | ["16 ABS", "16 EQUAL"], 14 | ["-16 ABS", "-16 NEGATE EQUAL"], 15 | ["0 NOT", "NOP"], 16 | ["1 NOT", "0 EQUAL"], 17 | ["11 NOT", "0 EQUAL"], 18 | ["0 0NOTEQUAL", "0 EQUAL"], 19 | ["1 0NOTEQUAL", "1 EQUAL"], 20 | ["111 0NOTEQUAL", "1 EQUAL"], 21 | ["-111 0NOTEQUAL", "1 EQUAL"], 22 | ["1 1 BOOLAND", "NOP"], 23 | ["1 0 BOOLAND", "NOT"], 24 | ["0 1 BOOLAND", "NOT"], 25 | ["0 0 BOOLAND", "NOT"], 26 | ["16 17 BOOLAND", "NOP"], 27 | ["1 1 BOOLOR", "NOP"], 28 | ["1 0 BOOLOR", "NOP"], 29 | ["0 1 BOOLOR", "NOP"], 30 | ["0 0 BOOLOR", "NOT"], 31 | ["16 17 BOOLOR", "NOP"], 32 | ["11 10 1 ADD", "NUMEQUAL"], 33 | ["11 10 1 ADD", "NUMEQUALVERIFY 1"], 34 | ["11 10 1 ADD", "NUMNOTEQUAL NOT"], 35 | ["111 10 1 ADD", "NUMNOTEQUAL"], 36 | ["11 10", "LESSTHAN NOT"], 37 | ["4 4", "LESSTHAN NOT"], 38 | ["10 11", "LESSTHAN"], 39 | ["-11 11", "LESSTHAN"], 40 | ["-11 -10", "LESSTHAN"], 41 | ["11 10", "GREATERTHAN"], 42 | ["4 4", "GREATERTHAN NOT"], 43 | ["10 11", "GREATERTHAN NOT"], 44 | ["-11 11", "GREATERTHAN NOT"], 45 | ["-11 -10", "GREATERTHAN NOT"], 46 | ["11 10", "LESSTHANOREQUAL NOT"], 47 | ["4 4", "LESSTHANOREQUAL"], 48 | ["10 11", "LESSTHANOREQUAL"], 49 | ["-11 11", "LESSTHANOREQUAL"], 50 | ["-11 -10", "LESSTHANOREQUAL"], 51 | ["11 10", "GREATERTHANOREQUAL"], 52 | ["4 4", "GREATERTHANOREQUAL"], 53 | ["10 11", "GREATERTHANOREQUAL NOT"], 54 | ["-11 11", "GREATERTHANOREQUAL NOT"], 55 | ["-11 -10", "GREATERTHANOREQUAL NOT"], 56 | ["1 0 MIN", "0 NUMEQUAL"], 57 | ["0 1 MIN", "0 NUMEQUAL"], 58 | ["-1 0 MIN", "-1 NUMEQUAL"], 59 | ["0 -2147483647 MIN", "-2147483647 NUMEQUAL"], 60 | ["2147483647 0 MAX", "2147483647 NUMEQUAL"], 61 | ["0 100 MAX", "100 NUMEQUAL"], 62 | ["-100 0 MAX", "0 NUMEQUAL"], 63 | ["0 -2147483647 MAX", "0 NUMEQUAL"], 64 | ["0 0 1", "WITHIN"], 65 | ["1 0 1", "WITHIN NOT"], 66 | ["0 -2147483647 2147483647", "WITHIN"], 67 | ["-1 -100 100", "WITHIN"], 68 | ["11 -100 100", "WITHIN"], 69 | ["-2147483647 -100 100", "WITHIN NOT"], 70 | ["2147483647 -100 100", "WITHIN NOT"], 71 | 72 | ["2147483647 2147483647 SUB", "0 EQUAL"], 73 | ["2147483647 DUP ADD", "4294967294 EQUAL", ">32 bit EQUAL is valid"], 74 | ["2147483647 NEGATE DUP ADD", "-4294967294 EQUAL"], 75 | 76 | 77 | ["NOP","1"] 78 | ] 79 | -------------------------------------------------------------------------------- /src/json/json_spirit_reader.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_READER 2 | #define JSON_SPIRIT_READER 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_error_position.h" 15 | #include 16 | 17 | namespace json_spirit 18 | { 19 | // functions to reads a JSON values 20 | 21 | bool read( const std::string& s, Value& value ); 22 | bool read( std::istream& is, Value& value ); 23 | bool read( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); 24 | 25 | void read_or_throw( const std::string& s, Value& value ); 26 | void read_or_throw( std::istream& is, Value& value ); 27 | void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, Value& value ); 28 | 29 | #ifndef BOOST_NO_STD_WSTRING 30 | 31 | bool read( const std::wstring& s, wValue& value ); 32 | bool read( std::wistream& is, wValue& value ); 33 | bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); 34 | 35 | void read_or_throw( const std::wstring& s, wValue& value ); 36 | void read_or_throw( std::wistream& is, wValue& value ); 37 | void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wValue& value ); 38 | 39 | #endif 40 | 41 | bool read( const std::string& s, mValue& value ); 42 | bool read( std::istream& is, mValue& value ); 43 | bool read( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); 44 | 45 | void read_or_throw( const std::string& s, mValue& value ); 46 | void read_or_throw( std::istream& is, mValue& value ); 47 | void read_or_throw( std::string::const_iterator& begin, std::string::const_iterator end, mValue& value ); 48 | 49 | #ifndef BOOST_NO_STD_WSTRING 50 | 51 | bool read( const std::wstring& s, wmValue& value ); 52 | bool read( std::wistream& is, wmValue& value ); 53 | bool read( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); 54 | 55 | void read_or_throw( const std::wstring& s, wmValue& value ); 56 | void read_or_throw( std::wistream& is, wmValue& value ); 57 | void read_or_throw( std::wstring::const_iterator& begin, std::wstring::const_iterator end, wmValue& value ); 58 | 59 | #endif 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/qt/coincontroldialog.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROLDIALOG_H 2 | #define COINCONTROLDIALOG_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | namespace Ui { 14 | class CoinControlDialog; 15 | } 16 | class WalletModel; 17 | class CCoinControl; 18 | 19 | class CoinControlDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit CoinControlDialog(QWidget *parent = 0); 25 | ~CoinControlDialog(); 26 | 27 | void setModel(WalletModel *model); 28 | 29 | // static because also called from sendcoinsdialog 30 | static void updateLabels(WalletModel*, QDialog*); 31 | static QString getPriorityLabel(double); 32 | 33 | static QList > payAddresses; 34 | static CCoinControl *coinControl; 35 | 36 | private: 37 | Ui::CoinControlDialog *ui; 38 | WalletModel *model; 39 | int sortColumn; 40 | Qt::SortOrder sortOrder; 41 | 42 | QMenu *contextMenu; 43 | QTreeWidgetItem *contextMenuItem; 44 | QAction *copyTransactionHashAction; 45 | //QAction *lockAction; 46 | //QAction *unlockAction; 47 | 48 | QString strPad(QString, int, QString); 49 | void sortView(int, Qt::SortOrder); 50 | void updateView(); 51 | void unselectSpent(); 52 | 53 | enum 54 | { 55 | COLUMN_CHECKBOX, 56 | COLUMN_AMOUNT, 57 | COLUMN_LABEL, 58 | COLUMN_ADDRESS, 59 | COLUMN_DATE, 60 | COLUMN_CONFIRMATIONS, 61 | COLUMN_COINAGE, 62 | COLUMN_PRIORITY, 63 | COLUMN_TXHASH, 64 | COLUMN_VOUT_INDEX, 65 | COLUMN_AMOUNT_INT64, 66 | COLUMN_PRIORITY_INT64 67 | }; 68 | 69 | private slots: 70 | void showMenu(const QPoint &); 71 | void copyAmount(); 72 | void copyLabel(); 73 | void copyAddress(); 74 | void copyTransactionHash(); 75 | //void lockCoin(); 76 | //void unlockCoin(); 77 | void clipboardQuantity(); 78 | void clipboardAmount(); 79 | void clipboardFee(); 80 | void clipboardAfterFee(); 81 | void clipboardBytes(); 82 | void clipboardPriority(); 83 | void clipboardLowOutput(); 84 | void clipboardChange(); 85 | void radioTreeMode(bool); 86 | void radioListMode(bool); 87 | void viewItemChanged(QTreeWidgetItem*, int); 88 | void headerSectionClicked(int); 89 | void buttonBoxClicked(QAbstractButton*); 90 | void buttonSelectAllClicked(); 91 | //void updateLabelLocked(); 92 | }; 93 | 94 | #endif // COINCONTROLDIALOG_H 95 | -------------------------------------------------------------------------------- /src/qt/notificator.h: -------------------------------------------------------------------------------- 1 | #ifndef NOTIFICATOR_H 2 | #define NOTIFICATOR_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QSystemTrayIcon; 9 | #ifdef USE_DBUS 10 | class QDBusInterface; 11 | #endif 12 | QT_END_NAMESPACE 13 | 14 | /** Cross-platform desktop notification client. */ 15 | class Notificator: public QObject 16 | { 17 | Q_OBJECT 18 | public: 19 | /** Create a new notificator. 20 | @note Ownership of trayIcon is not transferred to this object. 21 | */ 22 | Notificator(const QString &programName=QString(), QSystemTrayIcon *trayIcon=0, QWidget *parent=0); 23 | ~Notificator(); 24 | 25 | // Message class 26 | enum Class 27 | { 28 | Information, /**< Informational message */ 29 | Warning, /**< Notify user of potential problem */ 30 | Critical /**< An error occurred */ 31 | }; 32 | 33 | public slots: 34 | 35 | /** Show notification message. 36 | @param[in] cls general message class 37 | @param[in] title title shown with message 38 | @param[in] text message content 39 | @param[in] icon optional icon to show with message 40 | @param[in] millisTimeout notification timeout in milliseconds (defaults to 10 seconds) 41 | @note Platform implementations are free to ignore any of the provided fields except for \a text. 42 | */ 43 | void notify(Class cls, const QString &title, const QString &text, 44 | const QIcon &icon = QIcon(), int millisTimeout = 10000); 45 | 46 | private: 47 | QWidget *parent; 48 | enum Mode { 49 | None, /**< Ignore informational notifications, and show a modal pop-up dialog for Critical notifications. */ 50 | Freedesktop, /**< Use DBus org.freedesktop.Notifications */ 51 | QSystemTray, /**< Use QSystemTray::showMessage */ 52 | Growl12, /**< Use the Growl 1.2 notification system (Mac only) */ 53 | Growl13 /**< Use the Growl 1.3 notification system (Mac only) */ 54 | }; 55 | QString programName; 56 | Mode mode; 57 | QSystemTrayIcon *trayIcon; 58 | #ifdef USE_DBUS 59 | QDBusInterface *interface; 60 | 61 | void notifyDBus(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout); 62 | #endif 63 | void notifySystray(Class cls, const QString &title, const QString &text, const QIcon &icon, int millisTimeout); 64 | #ifdef Q_OS_MAC 65 | void notifyGrowl(Class cls, const QString &title, const QString &text, const QIcon &icon); 66 | #endif 67 | }; 68 | 69 | #endif // NOTIFICATOR_H 70 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: paycoin 3 | Source: https://github.com/PaycoinFoundation/paycoin.git 4 | 5 | Files: * 6 | Copyright: Copyright (c) 2014 Paycoin (Paycoin) Developers 7 | Copyright (c) 2011-2014 PPCoin Developers 8 | Copyright (c) 2009-2012 Bitcoin Developers 9 | License: MIT 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | . 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | . 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. 27 | 28 | Files: debian/* 29 | Copyright: 2014 wdl1908 30 | License: GPL-2+ 31 | This package is free software; you can redistribute it and/or modify 32 | it under the terms of the GNU General Public License as published by 33 | the Free Software Foundation; either version 2 of the License, or 34 | (at your option) any later version. 35 | . 36 | This package is distributed in the hope that it will be useful, 37 | but WITHOUT ANY WARRANTY; without even the implied warranty of 38 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 39 | GNU General Public License for more details. 40 | . 41 | You should have received a copy of the GNU General Public License 42 | along with this program. If not, see 43 | . 44 | On Debian systems, the complete text of the GNU General 45 | Public License version 2 can be found in "/usr/share/common-licenses/GPL-2". 46 | 47 | Files: share/qt/img/reload.xcf, src/qt/res/movies/*.png 48 | Copyright: Everaldo (Everaldo Coelho) 49 | License: GPL-3+ 50 | Comment: Icon Pack: Kids 51 | Site: http://findicons.com/icon/17102/reload?id=17102 52 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Paycoin Core integration/staging tree 2 | ===================================== 3 | 4 | [![Build Status](https://travis-ci.org/PaycoinFoundation/paycoin.svg?branch=master)](https://travis-ci.org/PaycoinFoundation/paycoin) 5 | 6 | https://www.paycoin.com 7 | 8 | What is Paycoin? 9 | ---------------- 10 | 11 | Paycoin is an experimental new digital currency that enables instant payments to 12 | anyone, anywhere in the world. Paycoin uses a proof-of-stake method in order for 13 | the Paycoin blockchain network to achieve distributed consensus. Paycoin Core is 14 | the name of open source software which enables the use of this currency. 15 | 16 | For more information, as well as an immediately useable, binary version of the 17 | Paycoin Core software, see https://www.paycoin.com/#wallet. 18 | 19 | License 20 | ------- 21 | 22 | Paycoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more 23 | information or see http://opensource.org/licenses/MIT. 24 | 25 | Development process 26 | ------------------- 27 | 28 | Developers work in their own trees, then submit pull requests when they think 29 | their feature or bug fix is ready. 30 | 31 | If it is a simple/trivial/non-controversial change, then one of the Paycoin 32 | development team members simply pulls it. 33 | 34 | If it is a *more complicated or potentially controversial* change, then the patch 35 | submitter will be asked to start a discussion (if they haven't already) on the 36 | [TalkXPY forum](https://www.talkxpy.com/category/8/paycoin-coincode) 37 | 38 | The patch will be accepted if there is broad consensus that it is a good thing. 39 | Developers should expect to rework and resubmit patches if the code doesn't 40 | match the project's coding conventions (see [doc/coding.md](doc/coding.md)) or are 41 | controversial. 42 | 43 | The `master` branch is regularly built and tested, but is not guaranteed to be 44 | completely stable. [Tags](https://github.com/PaycoinFoundation/paycoin/tags) are created 45 | regularly to indicate new official, stable release versions of Paycoin. 46 | 47 | Translations 48 | ------------ 49 | 50 | Changes to translations as well as new translations can be submitted to 51 | [Paycoin Core's Transifex page](https://www.transifex.com/projects/p/paycoin/). 52 | 53 | Translations are periodically pulled from Transifex and merged into the git repository. See the 54 | [translation process](doc/translation_process.md) for details on how this works. 55 | 56 | **Important**: We do not accept translation changes as GitHub pull requests because the next 57 | pull from Transifex would automatically overwrite them again. 58 | -------------------------------------------------------------------------------- /src/test/accounting_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "init.h" 4 | #include "util.h" 5 | #include "walletdb.h" 6 | 7 | using namespace std; 8 | 9 | BOOST_AUTO_TEST_SUITE(accounting_tests) 10 | 11 | BOOST_AUTO_TEST_CASE(acc_basics) 12 | { 13 | CWalletDB walletdb(pwalletMain->strWalletFile); 14 | vector vpwtx; 15 | CWalletTx wtx; 16 | CAccountingEntry ae; 17 | list aes; 18 | 19 | int64 nTimeStart = 1443808862; 20 | int64 nTime = nTimeStart; 21 | 22 | ae.strAccount = ""; 23 | ae.nCreditDebit = 1; 24 | ae.nTime = nTime; 25 | ae.strOtherAccount = "b"; 26 | ae.strComment = ""; 27 | 28 | BOOST_CHECK_EQUAL(walletdb.GetAccountCreditDebit(""), (int64)0); 29 | BOOST_CHECK(walletdb.GetAccountCreditDebit("") != (int64)1); 30 | 31 | walletdb.ListAccountCreditDebit("", aes); 32 | 33 | BOOST_CHECK_EQUAL(aes.size(), 0); 34 | BOOST_CHECK(aes.size() != 1); 35 | 36 | walletdb.WriteAccountingEntry(ae); 37 | 38 | BOOST_CHECK(walletdb.GetAccountCreditDebit("") != (int64)0); 39 | BOOST_CHECK_EQUAL(walletdb.GetAccountCreditDebit(""), (int64)1); 40 | 41 | nTime = nTime + (24 * 60 * 60); 42 | ae.nTime = nTime; 43 | walletdb.WriteAccountingEntry(ae); 44 | 45 | BOOST_CHECK_EQUAL(walletdb.GetAccountCreditDebit(""), (int64)2); 46 | BOOST_CHECK(walletdb.GetAccountCreditDebit("") != (int64)9); 47 | 48 | aes.clear(); 49 | walletdb.ListAccountCreditDebit("", aes); 50 | BOOST_CHECK_EQUAL(aes.size(), 2); 51 | 52 | nTime = nTime + (24 * 60 * 60); 53 | for (int i = 0; i < 8; i++) { 54 | nTime = nTime + (24 * 60 * 60 * i); 55 | ae.nTime = nTime; 56 | walletdb.WriteAccountingEntry(ae); 57 | } 58 | 59 | BOOST_CHECK_EQUAL(walletdb.GetAccountCreditDebit(""), (int64)10); 60 | 61 | aes.clear(); 62 | walletdb.ListAccountCreditDebit("", aes); 63 | BOOST_CHECK_EQUAL(aes.size(), 10); 64 | 65 | ae.nCreditDebit = 10; 66 | walletdb.WriteAccountingEntry(ae); 67 | 68 | BOOST_CHECK_EQUAL(walletdb.GetAccountCreditDebit(""), (int64)20); 69 | 70 | aes.clear(); 71 | walletdb.ListAccountCreditDebit("", aes); 72 | BOOST_CHECK_EQUAL(aes.size(), 11); 73 | 74 | map entries; 75 | int i = 0; 76 | BOOST_FOREACH(CAccountingEntry &ae, aes) { 77 | entries[i] = ae; 78 | i++; 79 | } 80 | 81 | BOOST_CHECK_EQUAL(entries[0].nTime, 1443808862); 82 | BOOST_CHECK_EQUAL(entries[4].nTime, 1444240862); 83 | BOOST_CHECK_EQUAL(entries[10].nTime, 1446400862); 84 | } 85 | 86 | BOOST_AUTO_TEST_SUITE_END() 87 | -------------------------------------------------------------------------------- /doc/build-msw.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2012 Bitcoin Developers 2 | Distributed under the MIT software license, see the accompanying 3 | file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | This product includes software developed by the OpenSSL Project for use in 5 | the OpenSSL Toolkit (https://www.openssl.org/). This product includes 6 | cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP 7 | software written by Thomas Bernard. 8 | 9 | 10 | See readme-qt.md for instructions on building Bitcoin QT, the 11 | graphical user interface. 12 | 13 | WINDOWS BUILD NOTES 14 | =================== 15 | 16 | Compilers Supported 17 | ------------------- 18 | TODO: What works? 19 | Note: releases are cross-compiled using mingw running on Linux. 20 | 21 | 22 | Dependencies 23 | ------------ 24 | Libraries you need to download separately and build: 25 | 26 | default path download 27 | OpenSSL \openssl-1.0.1h-mgw https://www.openssl.org/source/ 28 | Berkeley DB \db-4.8.30.NC-mgw https://www.oracle.com/technology/software/products/berkeley-db/index.html 29 | Boost \boost-1.47.0-mgw http://www.boost.org/users/download/ 30 | miniupnpc \miniupnpc-1.6-mgw http://miniupnp.tuxfamily.org/files/ 31 | 32 | Their licenses: 33 | OpenSSL Old BSD license with the problematic advertising requirement 34 | Berkeley DB New BSD license with additional requirement that linked software must be free open source 35 | Boost MIT-like license 36 | miniupnpc New (3-clause) BSD license 37 | 38 | Versions used in this release: 39 | OpenSSL 1.0.1h 40 | Berkeley DB 4.8.30.NC 41 | Boost 1.47.0 42 | miniupnpc 1.6 43 | 44 | 45 | OpenSSL 46 | ------- 47 | MSYS shell: 48 | un-tar sources with MSYS 'tar xfz' to avoid issue with symlinks (OpenSSL ticket 2377) 49 | change 'MAKE' env. variable from 'C:\MinGW32\bin\mingw32-make.exe' to '/c/MinGW32/bin/mingw32-make.exe' 50 | 51 | cd /c/openssl-1.0.1h-mgw 52 | ./config 53 | make 54 | 55 | Berkeley DB 56 | ----------- 57 | MSYS shell: 58 | cd /c/db-4.8.30.NC-mgw/build_unix 59 | sh ../dist/configure --enable-mingw --enable-cxx 60 | make 61 | 62 | Boost 63 | ----- 64 | DOS prompt: 65 | downloaded boost jam 3.1.18 66 | cd \boost-1.47.0-mgw 67 | bjam toolset=gcc --build-type=complete stage 68 | 69 | MiniUPnPc 70 | --------- 71 | UPnP support is optional, make with USE_UPNP= to disable it. 72 | 73 | MSYS shell: 74 | cd /c/miniupnpc-1.6-mgw 75 | make -f Makefile.mingw 76 | mkdir miniupnpc 77 | cp *.h miniupnpc/ 78 | 79 | Bitcoin 80 | ------- 81 | DOS prompt: 82 | cd \bitcoin\src 83 | mingw32-make -f makefile.mingw 84 | strip bitcoind.exe 85 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-0.3.0.1.md: -------------------------------------------------------------------------------- 1 | Paycoin version 0.3.0.1 is now available from: 2 | 3 | https://github.com/PaycoinFoundation/paycoin/releases 4 | 5 | This is a mandatory update, including a modification to the primenode stake 6 | rate and many bug fixes. 7 | 8 | Please report bugs using the issue tracker at github: 9 | 10 | https://github.com/PaycoinFoundation/paycoin/issues 11 | 12 | Upgrading and downgrading 13 | ========================= 14 | 15 | How to Upgrade 16 | -------------- 17 | 18 | If you are running an older version, shut it down. Wait until it has completely 19 | shut down (this could take a few minutes), then run the installer (on Windows) 20 | or just copy over /Applications/Paycoin-Qt (on Mac) or paycoind/paycoin-qt (on Linux). 21 | 22 | If you encounter any issues starting the new wallet it is recommended that you delete and resync the blockchain. To delete the blockchain look in the 23 | Paycoin data directory (listed below) and delete everything except the wallet.dat and paycoin.conf 24 | 25 | Linux : ~/.paycoin/ 26 | 27 | Windows : %appdata%\Paycoin 28 | 29 | Mac : ~/Library/Application Support/Paycoin 30 | 31 | It is highly recommended that if you do not have a backup of your wallet.dat 32 | to go ahead and make one before deleting the blockchain. 33 | 34 | The listed directories are the defaults, if using the datadir flag make sure to 35 | look in the assigned directory. 36 | 37 | If after the blockchain is synced you find your balance is incorrect please run: 38 | 39 | repairwallet 40 | 41 | If using the daemon this can be done the same as any other command, for QT users 42 | please proceed to help > debug window > console and enter the command from there 43 | (you may press escape to close out of the console). 44 | 45 | Downgrading warning 46 | --------------------- 47 | 48 | This release resolves an issue with staking in 0.3.0.0 so downgrading to it is 49 | not recommended. Downgrading to a version older then 0.3.0.0 will cause a node 50 | to not connect properly. Downgrading is from 0.3.0.1 is not recommended. 51 | 52 | Notable changes 53 | =============== 54 | 55 | Corrected an issue with staking 56 | --------------------- 57 | 58 | Staking in version 0.3.0.1 was broken do to an issue with the GetProofOfStakeReward code, it has been corrected. 59 | 60 | 0.3.0.1 Change log 61 | =================== 62 | 63 | Detailed release notes follow. 64 | 65 | Validation / Staking: 66 | - `358b20a` Make sure we pass nTime to GetProofOfStakeReward 67 | 68 | Credits 69 | ======= 70 | 71 | Thanks to everyone who contributed to this release: 72 | 73 | - Evan Lucas 74 | 75 | The following were instrumental in planning and release preparation: 76 | 77 | - Nathan Bass 78 | - Jason Sponaugle 79 | - Matthew Eden 80 | -------------------------------------------------------------------------------- /contrib/debian/examples/bitcoin.conf: -------------------------------------------------------------------------------- 1 | # bitcoin.conf configuration file. Lines beginning with # are comments. 2 | 3 | 4 | # Network-related settings: 5 | 6 | # Run on the test network instead of the real bitcoin network. 7 | #testnet=1 8 | 9 | # Connect via a socks4 proxy 10 | #proxy=127.0.0.1:9050 11 | 12 | # Use as many addnode= settings as you like to connect to specific peers 13 | #addnode=69.164.218.197 14 | #addnode=10.0.0.2:8333 15 | 16 | # ... or use as many connect= settings as you like to connect ONLY 17 | # to specific peers: 18 | #connect=69.164.218.197 19 | #connect=10.0.0.1:8333 20 | 21 | # Do not use Internet Relay Chat (irc.lfnet.org #bitcoin channel) to 22 | # find other peers. 23 | #noirc=1 24 | 25 | # Maximum number of inbound+outbound connections. 26 | #maxconnections= 27 | 28 | 29 | # JSON-RPC options (for controlling a running Bitcoin/bitcoind process) 30 | 31 | # server=1 tells Bitcoin to accept JSON-RPC commands. 32 | #server=1 33 | 34 | # You must set rpcuser and rpcpassword to secure the JSON-RPC api 35 | #rpcuser=Ulysseys 36 | #rpcpassword=YourSuperGreatPasswordNumber_385593 37 | 38 | # By default, only RPC connections from localhost are allowed. Specify 39 | # as many rpcallowip= settings as you like to allow connections from 40 | # other hosts (and you may use * as a wildcard character): 41 | #rpcallowip=10.1.1.34 42 | #rpcallowip=192.168.1.* 43 | 44 | # Listen for RPC connections on this TCP port: 45 | rpcport=8332 46 | 47 | # You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind 48 | # running on another host using this option: 49 | rpcconnect=127.0.0.1 50 | 51 | # Use Secure Sockets Layer (also known as TLS or HTTPS) to communicate 52 | # with Bitcoin -server or bitcoind 53 | #rpcssl=1 54 | 55 | # OpenSSL settings used when rpcssl=1 56 | rpcsslciphers=TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH 57 | rpcsslcertificatechainfile=server.cert 58 | rpcsslprivatekeyfile=server.pem 59 | 60 | 61 | # Miscellaneous options 62 | 63 | # Set gen=1 to attempt to generate bitcoins 64 | gen=0 65 | 66 | # Use SSE instructions to try to generate bitcoins faster. 67 | #4way=1 68 | 69 | # Pre-generate this many public/private key pairs, so wallet backups will be valid for 70 | # both prior transactions and several dozen future transactions. 71 | keypool=100 72 | 73 | # Pay an optional transaction fee every time you send bitcoins. Transactions with fees 74 | # are more likely than free transactions to be included in generated blocks, so may 75 | # be validated sooner. 76 | paytxfee=0.00 77 | 78 | # Allow direct connections for the 'pay via IP address' feature. 79 | #allowreceivebyip=1 80 | 81 | 82 | # User interface options 83 | 84 | # Start Bitcoin minimized 85 | #min=1 86 | 87 | # Minimize to the system tray 88 | #minimizetotray=1 89 | -------------------------------------------------------------------------------- /src/qt/transactionfilterproxy.cpp: -------------------------------------------------------------------------------- 1 | #include "transactionfilterproxy.h" 2 | #include "transactiontablemodel.h" 3 | 4 | #include 5 | 6 | #include 7 | 8 | // Earliest date that can be represented (far in the past) 9 | const QDateTime TransactionFilterProxy::MIN_DATE = QDateTime::fromTime_t(0); 10 | // Last date that can be represented (far in the future) 11 | const QDateTime TransactionFilterProxy::MAX_DATE = QDateTime::fromTime_t(0xFFFFFFFF); 12 | 13 | TransactionFilterProxy::TransactionFilterProxy(QObject *parent) : 14 | QSortFilterProxyModel(parent), 15 | dateFrom(MIN_DATE), 16 | dateTo(MAX_DATE), 17 | addrPrefix(), 18 | typeFilter(ALL_TYPES), 19 | minAmount(0), 20 | limitRows(-1) 21 | { 22 | } 23 | 24 | bool TransactionFilterProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const 25 | { 26 | QModelIndex index = sourceModel()->index(sourceRow, 0, sourceParent); 27 | 28 | int type = index.data(TransactionTableModel::TypeRole).toInt(); 29 | QDateTime datetime = index.data(TransactionTableModel::DateRole).toDateTime(); 30 | QString address = index.data(TransactionTableModel::AddressRole).toString(); 31 | QString label = index.data(TransactionTableModel::LabelRole).toString(); 32 | qint64 amount = llabs(index.data(TransactionTableModel::AmountRole).toLongLong()); 33 | 34 | if(!(TYPE(type) & typeFilter)) 35 | return false; 36 | if(datetime < dateFrom || datetime > dateTo) 37 | return false; 38 | if (!address.contains(addrPrefix, Qt::CaseInsensitive) && !label.contains(addrPrefix, Qt::CaseInsensitive)) 39 | return false; 40 | if(amount < minAmount) 41 | return false; 42 | 43 | return true; 44 | } 45 | 46 | void TransactionFilterProxy::setDateRange(const QDateTime &from, const QDateTime &to) 47 | { 48 | this->dateFrom = from; 49 | this->dateTo = to; 50 | invalidateFilter(); 51 | } 52 | 53 | void TransactionFilterProxy::setAddressPrefix(const QString &addrPrefix) 54 | { 55 | this->addrPrefix = addrPrefix; 56 | invalidateFilter(); 57 | } 58 | 59 | void TransactionFilterProxy::setTypeFilter(quint32 modes) 60 | { 61 | this->typeFilter = modes; 62 | invalidateFilter(); 63 | } 64 | 65 | void TransactionFilterProxy::setMinAmount(qint64 minimum) 66 | { 67 | this->minAmount = minimum; 68 | invalidateFilter(); 69 | } 70 | 71 | void TransactionFilterProxy::setLimit(int limit) 72 | { 73 | this->limitRows = limit; 74 | } 75 | 76 | int TransactionFilterProxy::rowCount(const QModelIndex &parent) const 77 | { 78 | if(limitRows != -1) 79 | { 80 | return std::min(QSortFilterProxyModel::rowCount(parent), limitRows); 81 | } 82 | else 83 | { 84 | return QSortFilterProxyModel::rowCount(parent); 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-0.3.0.2.md: -------------------------------------------------------------------------------- 1 | Paycoin version 0.3.0.2 is now available from: 2 | 3 | https://github.com/PaycoinFoundation/paycoin/releases 4 | 5 | This is a mandatory update, including a modification to the primenode stake 6 | rate and many bug fixes. 7 | 8 | Please report bugs using the issue tracker at github: 9 | 10 | https://github.com/PaycoinFoundation/paycoin/issues 11 | 12 | Upgrading and downgrading 13 | ========================= 14 | 15 | How to Upgrade 16 | -------------- 17 | 18 | If you are running an older version, shut it down. Wait until it has completely 19 | shut down (this could take a few minutes), then run the installer (on Windows) 20 | or just copy over /Applications/Paycoin-Qt (on Mac) or paycoind/paycoin-qt (on Linux). 21 | 22 | If you encounter any issues starting the new wallet it is recommended that you delete and resync the blockchain. To delete the blockchain look in the 23 | Paycoin data directory (listed below) and delete everything except the wallet.dat and paycoin.conf 24 | 25 | Linux : ~/.paycoin/ 26 | 27 | Windows : %appdata%\Paycoin 28 | 29 | Mac : ~/Library/Application Support/Paycoin 30 | 31 | It is highly recommended that if you do not have a backup of your wallet.dat 32 | to go ahead and make one before deleting the blockchain. 33 | 34 | The listed directories are the defaults, if using the datadir flag make sure to 35 | look in the assigned directory. 36 | 37 | If after the blockchain is synced you find your balance is incorrect please run: 38 | 39 | repairwallet 40 | 41 | If using the daemon this can be done the same as any other command, for QT users 42 | please proceed to help > debug window > console and enter the command from there 43 | (you may press escape to close out of the console). 44 | 45 | Downgrading warning 46 | --------------------- 47 | 48 | Non-primenodes can safely be downgraded to version 0.3.0.1 without issues. 49 | Downgrading a primenode will cause it to fail to stake. 50 | 51 | Notable changes 52 | =============== 53 | 54 | Resolved staking on primenodes. 55 | --------------------- 56 | 57 | Removed reserve on primenodes as this causes coins that are part of the same 58 | transaction as the reserve to fail to stake. 59 | 60 | 0.3.0.2 Change log 61 | =================== 62 | 63 | Detailed release notes follow. 64 | 65 | GUI: 66 | - `e857686` Minor Splashscreen Fix 67 | - `f9b2fc4` XPY Icon Size Fix 68 | 69 | Validation / Staking: 70 | - `d4e1e00` Revert "Disable compound staking on primenodes." 71 | 72 | Miscellaneous: 73 | - `63445fd` Fix some misspellings 74 | 75 | Credits 76 | ======= 77 | 78 | Thanks to everyone who contributed to this release: 79 | 80 | - Nathan Bass 81 | - Mitchell Cash 82 | - Victor Vargas 83 | 84 | The following were instrumental in planning and release preparation: 85 | 86 | - Jason Sponaugle 87 | - Matthew Eden 88 | -------------------------------------------------------------------------------- /src/strlcpy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 1998 Todd C. Miller 3 | * 4 | * Permission to use, copy, modify, and distribute this software for any 5 | * purpose with or without fee is hereby granted, provided that the above 6 | * copyright notice and this permission notice appear in all copies. 7 | * 8 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 9 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 10 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 11 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 12 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 13 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15 | */ 16 | #ifndef BITCOIN_STRLCPY_H 17 | #define BITCOIN_STRLCPY_H 18 | 19 | #include 20 | #include 21 | 22 | /* 23 | * Copy src to string dst of size siz. At most siz-1 characters 24 | * will be copied. Always NUL terminates (unless siz == 0). 25 | * Returns strlen(src); if retval >= siz, truncation occurred. 26 | */ 27 | inline size_t strlcpy(char *dst, const char *src, size_t siz) 28 | { 29 | char *d = dst; 30 | const char *s = src; 31 | size_t n = siz; 32 | 33 | /* Copy as many bytes as will fit */ 34 | if (n != 0) 35 | { 36 | while (--n != 0) 37 | { 38 | if ((*d++ = *s++) == '\0') 39 | break; 40 | } 41 | } 42 | 43 | /* Not enough room in dst, add NUL and traverse rest of src */ 44 | if (n == 0) 45 | { 46 | if (siz != 0) 47 | *d = '\0'; /* NUL-terminate dst */ 48 | while (*s++) 49 | ; 50 | } 51 | 52 | return(s - src - 1); /* count does not include NUL */ 53 | } 54 | 55 | /* 56 | * Appends src to string dst of size siz (unlike strncat, siz is the 57 | * full size of dst, not space left). At most siz-1 characters 58 | * will be copied. Always NUL terminates (unless siz <= strlen(dst)). 59 | * Returns strlen(src) + MIN(siz, strlen(initial dst)). 60 | * If retval >= siz, truncation occurred. 61 | */ 62 | inline size_t strlcat(char *dst, const char *src, size_t siz) 63 | { 64 | char *d = dst; 65 | const char *s = src; 66 | size_t n = siz; 67 | size_t dlen; 68 | 69 | /* Find the end of dst and adjust bytes left but don't go past end */ 70 | while (n-- != 0 && *d != '\0') 71 | d++; 72 | dlen = d - dst; 73 | n = siz - dlen; 74 | 75 | if (n == 0) 76 | return(dlen + strlen(s)); 77 | while (*s != '\0') 78 | { 79 | if (n != 1) 80 | { 81 | *d++ = *s; 82 | n--; 83 | } 84 | s++; 85 | } 86 | *d = '\0'; 87 | 88 | return(dlen + (s - src)); /* count does not include NUL */ 89 | } 90 | #endif 91 | -------------------------------------------------------------------------------- /src/test/base58_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "base58.h" 4 | 5 | BOOST_AUTO_TEST_SUITE(base58_tests) 6 | 7 | // TODO: 8 | // EncodeBase58Check 9 | // DecodeBase58Check 10 | // CBase58Data 11 | // bool SetString(const char* psz) 12 | // bool SetString(const std::string& str) 13 | // std::string ToString() const 14 | // int CompareTo(const CBase58Data& b58) const 15 | // bool operator==(const CBase58Data& b58) const 16 | // bool operator<=(const CBase58Data& b58) const 17 | // bool operator>=(const CBase58Data& b58) const 18 | // bool operator< (const CBase58Data& b58) const 19 | // bool operator> (const CBase58Data& b58) const 20 | 21 | // CBitcoinAddress 22 | // bool SetHash160(const uint160& hash160) 23 | // bool SetPubKey(const std::vector& vchPubKey) 24 | // bool IsValid() const 25 | // CBitcoinAddress() 26 | // CBitcoinAddress(uint160 hash160In) 27 | // CBitcoinAddress(const std::vector& vchPubKey) 28 | // CBitcoinAddress(const std::string& strAddress) 29 | // CBitcoinAddress(const char* pszAddress) 30 | // uint160 GetHash160() const 31 | 32 | #define U(x) (reinterpret_cast(x)) 33 | static struct { 34 | const unsigned char *data; 35 | int size; 36 | } vstrIn[] = { 37 | {U(""), 0}, 38 | {U("\x61"), 1}, 39 | {U("\x62\x62\x62"), 3}, 40 | {U("\x63\x63\x63"), 3}, 41 | {U("\x73\x69\x6d\x70\x6c\x79\x20\x61\x20\x6c\x6f\x6e\x67\x20\x73\x74\x72\x69\x6e\x67"), 20}, 42 | {U("\x00\xeb\x15\x23\x1d\xfc\xeb\x60\x92\x58\x86\xb6\x7d\x06\x52\x99\x92\x59\x15\xae\xb1\x72\xc0\x66\x47"), 25}, 43 | {U("\x51\x6b\x6f\xcd\x0f"), 5}, 44 | {U("\xbf\x4f\x89\x00\x1e\x67\x02\x74\xdd"), 9}, 45 | {U("\x57\x2e\x47\x94"), 4}, 46 | {U("\xec\xac\x89\xca\xd9\x39\x23\xc0\x23\x21"), 10}, 47 | {U("\x10\xc8\x51\x1e"), 4}, 48 | {U("\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"), 10}, 49 | }; 50 | 51 | const char *vstrOut[] = { 52 | "", 53 | "2g", 54 | "a3gV", 55 | "aPEr", 56 | "2cFupjhnEsSn59qHXstmK2ffpLv2", 57 | "1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L", 58 | "ABnLTmg", 59 | "3SEo3LWLoPntC", 60 | "3EFU7m", 61 | "EJDM8drfXA6uyA", 62 | "Rt5zm", 63 | "1111111111" 64 | }; 65 | 66 | BOOST_AUTO_TEST_CASE(base58_EncodeBase58) 67 | { 68 | for (int i=0; i result; 77 | for (int i=0; i expected(vstrIn[i].data, vstrIn[i].data + vstrIn[i].size); 80 | BOOST_CHECK(DecodeBase58(vstrOut[i], result)); 81 | BOOST_CHECK_EQUAL_COLLECTIONS(result.begin(), result.end(), expected.begin(), expected.end()); 82 | } 83 | BOOST_CHECK(!DecodeBase58("invalid", result)); 84 | } 85 | 86 | BOOST_AUTO_TEST_SUITE_END() 87 | 88 | -------------------------------------------------------------------------------- /src/qt/transactiontablemodel.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONTABLEMODEL_H 2 | #define TRANSACTIONTABLEMODEL_H 3 | 4 | #include 5 | #include 6 | 7 | class CWallet; 8 | class TransactionTablePriv; 9 | class TransactionRecord; 10 | class WalletModel; 11 | 12 | /** UI model for the transaction table of a wallet. 13 | */ 14 | class TransactionTableModel : public QAbstractTableModel 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit TransactionTableModel(CWallet* wallet, WalletModel *parent = 0); 19 | ~TransactionTableModel(); 20 | 21 | enum ColumnIndex { 22 | Status = 0, 23 | Date = 1, 24 | Type = 2, 25 | ToAddress = 3, 26 | Amount = 4 27 | }; 28 | 29 | /** Roles to get specific information from a transaction row. 30 | These are independent of column. 31 | */ 32 | enum RoleIndex { 33 | /** Type of transaction */ 34 | TypeRole = Qt::UserRole, 35 | /** Date and time this transaction was created */ 36 | DateRole, 37 | /** Long description (HTML format) */ 38 | LongDescriptionRole, 39 | /** Address of transaction */ 40 | AddressRole, 41 | /** Label of address related to transaction */ 42 | LabelRole, 43 | /** Net amount of transaction */ 44 | AmountRole, 45 | /** Unique identifier */ 46 | TxIDRole, 47 | /** Is transaction confirmed? */ 48 | ConfirmedRole, 49 | /** Formatted amount, without brackets when unconfirmed */ 50 | FormattedAmountRole 51 | }; 52 | 53 | int rowCount(const QModelIndex &parent) const; 54 | int columnCount(const QModelIndex &parent) const; 55 | QVariant data(const QModelIndex &index, int role) const; 56 | QVariant headerData(int section, Qt::Orientation orientation, int role) const; 57 | QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const; 58 | void refresh(); 59 | private: 60 | CWallet* wallet; 61 | WalletModel *walletModel; 62 | QStringList columns; 63 | TransactionTablePriv *priv; 64 | 65 | QString lookupAddress(const std::string &address, bool tooltip) const; 66 | QVariant addressColor(const TransactionRecord *wtx) const; 67 | QString formatTxStatus(const TransactionRecord *wtx) const; 68 | QString formatTxDate(const TransactionRecord *wtx) const; 69 | QString formatTxType(const TransactionRecord *wtx) const; 70 | QString formatTxToAddress(const TransactionRecord *wtx, bool tooltip) const; 71 | QString formatTxAmount(const TransactionRecord *wtx, bool showUnconfirmed=true) const; 72 | QString formatTooltip(const TransactionRecord *rec) const; 73 | QVariant txStatusDecoration(const TransactionRecord *wtx) const; 74 | QVariant txAddressDecoration(const TransactionRecord *wtx) const; 75 | 76 | private slots: 77 | void update(); 78 | 79 | friend class TransactionTablePriv; 80 | }; 81 | 82 | #endif // TRANSACTIONTABLEMODEL_H 83 | -------------------------------------------------------------------------------- /src/primenodes.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Paycoin developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef PRIMENODES_H 5 | #define PRIMENODES_H 6 | 7 | #include "db.h" 8 | #include "script.h" 9 | 10 | // Used for stake confirmation 11 | static const int64 MINIMUM_FOR_PRIMENODE_PHASE1 = 125000 * COIN; 12 | static const int64 MINIMUM_FOR_PRIMENODE_PHASE2 = 160000 * COIN; 13 | /* Used ONLY in wallet.cpp for stake generation checks (should always be set 14 | * to the CURRENT MINIMUM_FOR_PRIMENODE) */ 15 | static const int64 MINIMUM_FOR_PRIMENODE = MINIMUM_FOR_PRIMENODE_PHASE2; 16 | 17 | static const unsigned int END_PRIME_PHASE_ONE = 1435752000; // Wed, 01 Jul 2015 12:00:00 GMT 18 | 19 | static const int PRIME_NODE_RATE = 25; 20 | 21 | bool initPrimeNodes(std::string &/*ret*/); 22 | 23 | bool NewScriptPrimeID(CScript &/*scriptPrimeID*/, std::vector /*vchPrivKey*/, unsigned int /*nTime*/); 24 | 25 | /* This is used to unseralize a database entry retaining all of the 26 | * primenode information */ 27 | class CPrimeNodeDBEntry 28 | { 29 | public: 30 | std::string key; 31 | unsigned int valid_starting; 32 | unsigned int valid_until; 33 | 34 | CPrimeNodeDBEntry() 35 | { 36 | SetNull(); 37 | } 38 | 39 | void SetNull() 40 | { 41 | key.clear(); 42 | valid_starting = 0; 43 | valid_until = 0; 44 | } 45 | 46 | IMPLEMENT_SERIALIZE 47 | ( 48 | READWRITE(valid_starting); 49 | READWRITE(valid_until); 50 | ) 51 | }; 52 | 53 | class CPrimeNodeDB : public CDB 54 | { 55 | public: 56 | enum dbtype { 57 | nodb, 58 | primedb, 59 | microdb, 60 | fulldb 61 | }; 62 | 63 | CPrimeNodeDB(const char* pszMode="r+") : CDB("primenodes.dat", pszMode) { } 64 | private: 65 | mutable CCriticalSection cs; 66 | 67 | CPrimeNodeDB(const CPrimeNodeDB&); 68 | void operator=(const CPrimeNodeDB); 69 | 70 | bool WritePrimeNodeKey(const std::string /*key*/, unsigned int /*valid_starting*/, unsigned int /*valid_until*/); 71 | bool WriteMicroPrimeAddr(const std::string /*address*/, int64 /*group*/); 72 | bool WritePrimeNodeDBVersion(int /*version*/); 73 | public: 74 | void WritePrimeNodeDB(); 75 | void WriteMicroPrimeDB(); 76 | void WriteTestMicroPrimeDB(); 77 | 78 | bool CheckPrimeNodeDBVersion(int &/*version*/); 79 | 80 | bool IsPrimeNodeKey(CScript /*scriptPubKeyType*/, unsigned int /*nTime*/, CPrimeNodeDBEntry &/*entry*/); 81 | bool IsMicroPrime(CScript /*scriptPubKeyAddress*/, int &/*primeNodeRate*/, int64 &/*group*/, unsigned int /*nTime*/); 82 | bool CheckPrimeNodeKey(const std::string /*key*/); 83 | bool CheckMicroPrime(const std::string /*address*/); 84 | bool CheckMicroPrime(CScript /*scriptPubKeyAddress*/); 85 | }; 86 | 87 | void InflatePrimeNodeDB(CPrimeNodeDB::dbtype /*db*/); 88 | 89 | extern CPrimeNodeDB* primeNodeDB; 90 | 91 | #endif // PRIMENODES_H 92 | -------------------------------------------------------------------------------- /doc/build-osx-ports.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Paycoin Developers 2 | Copyright (c) 2009-2012 Bitcoin Developers 3 | Distributed under the MIT software license, see the accompanying file 4 | COPYING or http://www.opensource.org/licenses/mit-license.php. This 5 | product includes software developed by the OpenSSL Project for use in the 6 | OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic 7 | software written by Eric Young (eay@cryptsoft.com) and UPnP software written by 8 | Thomas Bernard. 9 | 10 | 11 | Mac OS X Mountain Lion build instructions 12 | ========================================= 13 | How to build paycoind and Paycoin-Qt on 10.8 14 | 15 | 16 | Prerequisites 17 | ============= 18 | Install Xcode from the App Store and launch it 19 | 20 | All of the commands should be executed in Terminal.app 21 | 22 | 1. Install the Command Line Tools from the Xcode Preferences under Downloads 23 | 24 | 2. Download and install MacPorts from http://www.macports.org/install.php 25 | 26 | 3. Install dependencies from MacPorts 27 | 28 | sudo port selfupdate 29 | sudo port install boost db48@+no_java openssl miniupnpc 30 | 31 | 4. Clone the github tree to get the source code 32 | 33 | git clone https://github.com/PaycoinFoundation/paycoin.git 34 | 35 | 36 | Building paycoind 37 | ================= 38 | 39 | 1. Run the makefile 40 | 41 | cd Paycoin/src/ 42 | make -f makefile.osx RELEASE=true 64BIT=true CXX=g++ 43 | 44 | 45 | Building Paycoin-Qt.app 46 | ======================= 47 | You cannot use Qt 4.8.6 if you want to deploy to other systems 48 | http://qt-project.org/forums/viewthread/41925 49 | 50 | 1. Download and install Qt 4.8.5 from 51 | 52 | http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-mac-opensource-4.8.5.dmg 53 | 54 | 2. Download and install Qt Creator from 55 | 56 | http://qt-project.org/downloads 57 | 58 | 3. Use Qt Creator to build the project 59 | 60 | Double-click Paycoin/bitcoin-qt.pro to open Qt-Creator 61 | Click the Configure Project button 62 | Click on the monitor icon on the left bar above Debug and change it to Release 63 | On the top menu, click Build and Build Project "bitcoin-qt" 64 | 65 | 66 | Deploying Paycoin-Qt.app 67 | ======================== 68 | Deploying your app is needed to run it on non-development systems 69 | 70 | 1. Sym-link some shit 71 | 72 | sudo ln -s /opt/local/lib /opt/local/lib/lib 73 | sudo ln -s /opt/local/lib/db48/libdb_cxx-4.8.dylib /opt/local/lib/libdb_cxx-4.8.dylib 74 | 75 | 2. Copy Paycoin-Qt.app and run macdeployqt to bundle required libraries 76 | 77 | mkdir deploy 78 | cp -r build-bitcoin-qt-Desktop-Release/Paycoin-Qt.app/ deploy/Paycoin-Qt.app/ 79 | sudo macdeployqt deploy/Paycoin-Qt.app/ 80 | 81 | 3. Fix a dependency path 82 | 83 | install_name_tool -change "/opt/local/lib/db48/libdb_cxx-4.8.dylib" "@executable_path/../Frameworks/libdb_cxx-4.8.dylib" deploy/Paycoin-Qt.app/Contents/MacOS/Paycoin-Qt 84 | 85 | 4. Compress Paycoin-Qt.app into a zip 86 | 87 | Right-click on Paycoin-Qt.app and click Compress -------------------------------------------------------------------------------- /doc/build-osx-brew.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012-2013 Paycoin Developers 2 | Copyright (c) 2009-2012 Bitcoin Developers 3 | Distributed under the MIT software license, see the accompanying file 4 | COPYING or http://www.opensource.org/licenses/mit-license.php. This 5 | product includes software developed by the OpenSSL Project for use in the 6 | OpenSSL Toolkit (https://www.openssl.org/). This product includes cryptographic 7 | software written by Eric Young (eay@cryptsoft.com) and UPnP software written by 8 | Thomas Bernard. 9 | 10 | 11 | Mac OS X Mountain Lion build instructions 12 | ========================================= 13 | How to build paycoind and Paycoin-Qt on 10.8 14 | 15 | 16 | Prerequisites 17 | ============= 18 | Install Xcode from the App Store and launch it 19 | 20 | All of the commands should be executed in Terminal.app 21 | 22 | 1. Install the Command Line Tools from the Xcode Preferences under Downloads 23 | 24 | 2. Install Homebrew from http://brew.sh 25 | 26 | 3. Install dependencies from Homebrew 27 | 28 | brew doctor 29 | brew install boost berkeley-db4 openssl miniupnpc 30 | brew link berkeley-db4 --force 31 | brew link openssl --force 32 | sudo mkdir -p /opt/local/lib 33 | sudo ln -s /usr/local/lib /opt/local/lib/db48 34 | 35 | 4. Clone the github tree to get the source code 36 | 37 | git clone https://github.com/PaycoinFoundation/paycoin.git 38 | 39 | 40 | Building paycoind 41 | ================= 42 | 43 | 1. Run the makefile 44 | 45 | cd Paycoin/src/ 46 | make -f makefile.osx RELEASE=true 64BIT=true CXX=g++ 47 | 48 | 49 | Building Paycoin-Qt.app 50 | ======================= 51 | You cannot use Qt 4.8.6 if you want to deploy to other systems 52 | http://qt-project.org/forums/viewthread/41925 53 | 54 | 1. Download and install Qt 4.8.5 from 55 | 56 | http://download.qt-project.org/archive/qt/4.8/4.8.5/qt-mac-opensource-4.8.5.dmg 57 | 58 | 2. Download and install Qt Creator from 59 | 60 | http://qt-project.org/downloads 61 | 62 | 3. Use Qt Creator to build the project 63 | 64 | Double-click Paycoin/bitcoin-qt.pro to open Qt-Creator 65 | Click the Configure Project button 66 | Click on the monitor icon on the left bar above Debug and change it to Release 67 | On the top menu, click Build and Build Project "bitcoin-qt" 68 | 69 | 70 | Deploying Paycoin-Qt.app 71 | ======================== 72 | Deploying your app is needed to run it on non-development systems 73 | 74 | 1. Sym-link some shit 75 | 76 | sudo ln -s /opt/local/lib /opt/local/lib/lib 77 | sudo ln -s /opt/local/lib/db48/libdb_cxx-4.8.dylib /opt/local/lib/libdb_cxx-4.8.dylib 78 | 79 | 2. Copy Paycoin-Qt.app and run macdeployqt to bundle required libraries 80 | 81 | mkdir deploy 82 | cp -r build-bitcoin-qt-Desktop-Release/Paycoin-Qt.app/ deploy/Paycoin-Qt.app/ 83 | sudo macdeployqt deploy/Paycoin-Qt.app/ 84 | 85 | 3. Fix a dependency path 86 | 87 | install_name_tool -change "/opt/local/lib/db48/libdb_cxx-4.8.dylib" "@executable_path/../Frameworks/libdb_cxx-4.8.dylib" deploy/Paycoin-Qt.app/Contents/MacOS/Paycoin-Qt 88 | 89 | 4. Compress Paycoin-Qt.app into a zip 90 | 91 | Right-click on Paycoin-Qt.app and click Compress --------------------------------------------------------------------------------