├── .DS_Store ├── .gitignore ├── .travis.yml ├── CHANGELOG ├── COPYING ├── INSTALL ├── README ├── README.md ├── contrib ├── bitrpc │ └── bitrpc.py ├── devtools │ └── generate-seeds.py ├── gitian-descriptors │ ├── README │ ├── deps-linux.yml │ ├── deps-osx.yml │ ├── deps-win.yml │ ├── gitian-linux.yml │ ├── gitian-osx.yml │ ├── gitian-win.yml │ ├── osxcross.yml │ ├── qt-osx.yml │ └── qt-win.yml ├── gitian-downloader │ ├── bluematt-key.pgp │ ├── devrandom-key.pgp │ ├── gavinandresen-key.pgp │ ├── laanwj-key.pgp │ ├── linux-download-config │ ├── luke-jr-key.pgp │ ├── richardsmith-key.gpg │ ├── scottnadal-key.gpg │ ├── sipa-key.pgp │ ├── sunnyking-key.gpg │ ├── tcatm-key.pgp │ └── win32-download-config ├── linearize │ ├── README.md │ ├── example-linearize.cfg │ ├── linearize-data.py │ └── linearize-hashes.py ├── macdeploy │ ├── LICENSE │ ├── background.png │ ├── background.psd │ ├── fancy.plist │ ├── macdeployqtplus │ └── notes.txt ├── qt_translations.py └── wallettools │ ├── walletchangepass.py │ └── walletunlock.py ├── doc ├── Doxyfile ├── README ├── assets-attribution.txt ├── bitcoin_logo_doxygen.png ├── build-msw.md ├── build-osx.md ├── build-unix.md ├── coding.txt ├── readme-qt.rst ├── release-process.txt ├── ssl.md ├── tor.md └── translation_process.md ├── exclusivecoin-w32.pro ├── exclusivecoin-w64.pro ├── exclusivecoin.pro ├── releases └── .DS_Store ├── share ├── genbuild.sh ├── pixmaps │ ├── addressbook16.bmp │ ├── addressbook16mask.bmp │ ├── addressbook20.bmp │ ├── addressbook20mask.bmp │ ├── bitcoin-bc.ico │ ├── bitcoin.ico │ ├── bitcoin32.xpm │ ├── bitcoin80.xpm │ ├── check.ico │ ├── favicon.ico │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── send16.bmp │ ├── send16mask.bmp │ ├── send16masknoshadow.bmp │ ├── send20.bmp │ └── send20mask.bmp ├── qt │ ├── Info.plist │ ├── extract_strings_qt.py │ ├── img │ │ └── reload.xcf │ ├── make_spinner.py │ └── make_windows_icon.sh ├── seeds │ ├── generate-seeds.py │ ├── nodes_main.txt │ └── nodes_test.txt ├── setup.nsi └── ui.rc └── src ├── activemasternode.cpp ├── activemasternode.h ├── addrman.cpp ├── addrman.h ├── aes_helper.c ├── alert.cpp ├── alert.h ├── allocators.cpp ├── allocators.h ├── base58.cpp ├── base58.h ├── bignum.h ├── bitcoind.cpp ├── blake.c ├── bmw.c ├── chainparams.cpp ├── chainparams.h ├── chainparamsseeds.h ├── checkpoints.cpp ├── checkpoints.h ├── clientversion.h ├── coincontrol.h ├── compat.h ├── core.cpp ├── core.h ├── crypter.cpp ├── crypter.h ├── crypto ├── common.h ├── hmac_sha256.cpp ├── hmac_sha256.h ├── hmac_sha512.cpp ├── hmac_sha512.h ├── ripemd160.cpp ├── ripemd160.h ├── sha1.cpp ├── sha1.h ├── sha256.cpp ├── sha256.h ├── sha512.cpp └── sha512.h ├── cubehash.c ├── darksend-relay.cpp ├── darksend-relay.h ├── darksend.cpp ├── darksend.h ├── db.cpp ├── db.h ├── echo.c ├── ecwrapper.cpp ├── ecwrapper.h ├── groestl.c ├── hash.cpp ├── hash.h ├── hashblock.h ├── init.cpp ├── init.h ├── instantx.cpp ├── instantx.h ├── jh.c ├── json ├── LICENSE.txt ├── json_spirit.h ├── json_spirit_error_position.h ├── json_spirit_reader.cpp ├── json_spirit_reader.h ├── json_spirit_reader_template.h ├── json_spirit_stream_reader.h ├── json_spirit_utils.h ├── json_spirit_value.cpp ├── json_spirit_value.h ├── json_spirit_writer.cpp ├── json_spirit_writer.h └── json_spirit_writer_template.h ├── keccak.c ├── kernel.cpp ├── kernel.h ├── key.cpp ├── key.h ├── keystore.cpp ├── keystore.h ├── leveldb ├── .gitignore ├── AUTHORS ├── LICENSE ├── Makefile ├── NEWS ├── README ├── TODO ├── WINDOWS.md ├── build_detect_platform ├── db │ ├── autocompact_test.cc │ ├── builder.cc │ ├── builder.h │ ├── c.cc │ ├── c_test.c │ ├── corruption_test.cc │ ├── db_bench.cc │ ├── db_impl.cc │ ├── db_impl.h │ ├── db_iter.cc │ ├── db_iter.h │ ├── db_test.cc │ ├── dbformat.cc │ ├── dbformat.h │ ├── dbformat_test.cc │ ├── filename.cc │ ├── filename.h │ ├── filename_test.cc │ ├── leveldb_main.cc │ ├── log_format.h │ ├── log_reader.cc │ ├── log_reader.h │ ├── log_test.cc │ ├── log_writer.cc │ ├── log_writer.h │ ├── memtable.cc │ ├── memtable.h │ ├── repair.cc │ ├── skiplist.h │ ├── skiplist_test.cc │ ├── snapshot.h │ ├── table_cache.cc │ ├── table_cache.h │ ├── version_edit.cc │ ├── version_edit.h │ ├── version_edit_test.cc │ ├── version_set.cc │ ├── version_set.h │ ├── version_set_test.cc │ ├── write_batch.cc │ ├── write_batch_internal.h │ └── write_batch_test.cc ├── doc │ ├── bench │ │ ├── db_bench_sqlite3.cc │ │ └── db_bench_tree_db.cc │ ├── benchmark.html │ ├── doc.css │ ├── impl.html │ ├── index.html │ ├── log_format.txt │ └── table_format.txt ├── helpers │ └── memenv │ │ ├── memenv.cc │ │ ├── memenv.h │ │ └── memenv_test.cc ├── include │ └── leveldb │ │ ├── c.h │ │ ├── cache.h │ │ ├── comparator.h │ │ ├── db.h │ │ ├── env.h │ │ ├── filter_policy.h │ │ ├── iterator.h │ │ ├── options.h │ │ ├── slice.h │ │ ├── status.h │ │ ├── table.h │ │ ├── table_builder.h │ │ └── write_batch.h ├── issues │ ├── issue178_test.cc │ └── issue200_test.cc ├── port │ ├── README │ ├── atomic_pointer.h │ ├── port.h │ ├── port_example.h │ ├── port_posix.cc │ ├── port_posix.h │ ├── port_win.cc │ ├── port_win.h │ ├── thread_annotations.h │ └── win │ │ └── stdint.h ├── table │ ├── block.cc │ ├── block.h │ ├── block_builder.cc │ ├── block_builder.h │ ├── filter_block.cc │ ├── filter_block.h │ ├── filter_block_test.cc │ ├── format.cc │ ├── format.h │ ├── iterator.cc │ ├── iterator_wrapper.h │ ├── merger.cc │ ├── merger.h │ ├── table.cc │ ├── table_builder.cc │ ├── table_test.cc │ ├── two_level_iterator.cc │ └── two_level_iterator.h └── util │ ├── arena.cc │ ├── arena.h │ ├── arena_test.cc │ ├── bloom.cc │ ├── bloom_test.cc │ ├── cache.cc │ ├── cache_test.cc │ ├── coding.cc │ ├── coding.h │ ├── coding_test.cc │ ├── comparator.cc │ ├── crc32c.cc │ ├── crc32c.h │ ├── crc32c_test.cc │ ├── env.cc │ ├── env_posix.cc │ ├── env_test.cc │ ├── env_win.cc │ ├── filter_policy.cc │ ├── hash.cc │ ├── hash.h │ ├── histogram.cc │ ├── histogram.h │ ├── logging.cc │ ├── logging.h │ ├── mutexlock.h │ ├── options.cc │ ├── posix_logger.h │ ├── random.h │ ├── status.cc │ ├── testharness.cc │ ├── testharness.h │ ├── testutil.cc │ └── testutil.h ├── limitedmap.h ├── luffa.c ├── lz4 ├── LICENSE ├── lz4.c └── lz4.h ├── main.cpp ├── main.h ├── makefile.bsd ├── makefile.linux-mingw ├── makefile.mingw ├── makefile.osx ├── makefile.unix ├── masternode-payments.cpp ├── masternode-payments.h ├── masternode-pos.cpp ├── masternode-pos.h ├── masternode.cpp ├── masternode.h ├── masternodeconfig.cpp ├── masternodeconfig.h ├── masternodeman.cpp ├── masternodeman.h ├── miner.cpp ├── miner.h ├── mruset.h ├── net.cpp ├── net.h ├── netbase.cpp ├── netbase.h ├── noui.cpp ├── obj-test └── .gitignore ├── obj ├── .gitignore ├── crypto │ └── .gitignore └── support │ └── .gitignore ├── pbkdf2.cpp ├── pbkdf2.h ├── protocol.cpp ├── protocol.h ├── pubkey.cpp ├── pubkey.h ├── qt ├── aboutdialog.cpp ├── aboutdialog.h ├── addeditadrenalinenode.cpp ├── addeditadrenalinenode.h ├── addressbookpage.cpp ├── addressbookpage.h ├── addresstablemodel.cpp ├── addresstablemodel.h ├── adrenalinenodeconfigdialog.cpp ├── adrenalinenodeconfigdialog.h ├── askpassphrasedialog.cpp ├── askpassphrasedialog.h ├── bitcoin.cpp ├── bitcoin.qrc ├── bitcoinaddressvalidator.cpp ├── bitcoinaddressvalidator.h ├── bitcoinamountfield.cpp ├── bitcoinamountfield.h ├── bitcoingui.cpp ├── bitcoingui.h ├── bitcoinstrings.cpp ├── bitcoinunits.cpp ├── bitcoinunits.h ├── blockbrowser.cpp ├── blockbrowser.h ├── clientmodel.cpp ├── clientmodel.h ├── coincontroldialog.cpp ├── coincontroldialog.h ├── coincontroltreewidget.cpp ├── coincontroltreewidget.h ├── csvmodelwriter.cpp ├── csvmodelwriter.h ├── darksendconfig.cpp ├── darksendconfig.h ├── editaddressdialog.cpp ├── editaddressdialog.h ├── flowlayout.cpp ├── flowlayout.h ├── forms │ ├── aboutdialog.ui │ ├── addeditadrenalinenode.ui │ ├── addressbookpage.ui │ ├── adrenalinenodeconfigdialog.ui │ ├── askpassphrasedialog.ui │ ├── blockbrowser.ui │ ├── coincontroldialog.ui │ ├── darksendconfig.ui │ ├── editaddressdialog.ui │ ├── masternodemanager.ui │ ├── messagepage.ui │ ├── optionsdialog.ui │ ├── overviewpage.ui │ ├── qrcodedialog.ui │ ├── rpcconsole.ui │ ├── sendcoinsdialog.ui │ ├── sendcoinsentry.ui │ ├── sendmessagesdialog.ui │ ├── sendmessagesentry.ui │ ├── signverifymessagedialog.ui │ ├── tradingdialog.ui │ └── transactiondescdialog.ui ├── guiconstants.h ├── guiutil.cpp ├── guiutil.h ├── locale │ ├── bitcoin_af_ZA.ts │ ├── bitcoin_ar.ts │ ├── bitcoin_be_BY.ts │ ├── bitcoin_bg.ts │ ├── bitcoin_bs.ts │ ├── bitcoin_ca.ts │ ├── bitcoin_ca@valencia.ts │ ├── bitcoin_ca_ES.ts │ ├── bitcoin_cs.ts │ ├── bitcoin_cy.ts │ ├── bitcoin_da.ts │ ├── bitcoin_de.ts │ ├── bitcoin_el_GR.ts │ ├── bitcoin_en.ts │ ├── bitcoin_eo.ts │ ├── bitcoin_es.ts │ ├── bitcoin_es_CL.ts │ ├── bitcoin_es_DO.ts │ ├── bitcoin_es_MX.ts │ ├── bitcoin_es_UY.ts │ ├── bitcoin_et.ts │ ├── bitcoin_eu_ES.ts │ ├── bitcoin_fa.ts │ ├── bitcoin_fa_IR.ts │ ├── bitcoin_fi.ts │ ├── bitcoin_fr.ts │ ├── bitcoin_fr_CA.ts │ ├── bitcoin_gl.ts │ ├── bitcoin_he.ts │ ├── bitcoin_hi_IN.ts │ ├── bitcoin_hr.ts │ ├── bitcoin_hu.ts │ ├── bitcoin_id_ID.ts │ ├── bitcoin_it.ts │ ├── bitcoin_ja.ts │ ├── bitcoin_ka.ts │ ├── bitcoin_kk_KZ.ts │ ├── bitcoin_ko_KR.ts │ ├── bitcoin_ky.ts │ ├── bitcoin_la.ts │ ├── bitcoin_lt.ts │ ├── bitcoin_lv_LV.ts │ ├── bitcoin_ms_MY.ts │ ├── bitcoin_nb.ts │ ├── bitcoin_nl.ts │ ├── bitcoin_pam.ts │ ├── bitcoin_pl.ts │ ├── bitcoin_pt_BR.ts │ ├── bitcoin_pt_PT.ts │ ├── bitcoin_ro_RO.ts │ ├── bitcoin_ru.ts │ ├── bitcoin_sah.ts │ ├── bitcoin_sk.ts │ ├── bitcoin_sl_SI.ts │ ├── bitcoin_sq.ts │ ├── bitcoin_sr.ts │ ├── bitcoin_sv.ts │ ├── bitcoin_th_TH.ts │ ├── bitcoin_tr.ts │ ├── bitcoin_uk.ts │ ├── bitcoin_ur_PK.ts │ ├── bitcoin_vi.ts │ ├── bitcoin_vi_VN.ts │ ├── bitcoin_zh_CN.ts │ └── bitcoin_zh_TW.ts ├── macdockiconhandler.h ├── macdockiconhandler.mm ├── macnotificationhandler.h ├── macnotificationhandler.mm ├── masternodemanager.cpp ├── masternodemanager.h ├── messagemodel.cpp ├── messagemodel.h ├── messagepage.cpp ├── messagepage.h ├── monitoreddatamapper.cpp ├── monitoreddatamapper.h ├── notificator.cpp ├── notificator.h ├── optionsdialog.cpp ├── optionsdialog.h ├── optionsmodel.cpp ├── optionsmodel.h ├── overviewpage.cpp ├── overviewpage.h ├── paymentserver.cpp ├── paymentserver.h ├── plugins │ └── mrichtexteditor │ │ ├── LGPL_EXCEPTION.txt │ │ ├── LICENSE.LGPL │ │ ├── README.md │ │ ├── example.png │ │ ├── mrichtextedit.cpp │ │ ├── mrichtextedit.h │ │ └── mrichtextedit.ui ├── qcustomplot.cpp ├── qcustomplot.h ├── qrcodedialog.cpp ├── qrcodedialog.h ├── qvalidatedlineedit.cpp ├── qvalidatedlineedit.h ├── qvalidatedtextedit.cpp ├── qvalidatedtextedit.h ├── qvaluecombobox.cpp ├── qvaluecombobox.h ├── res │ ├── bitcoin-qt.rc │ ├── icons │ │ ├── ExclusiveCoin-128.png │ │ ├── ExclusiveCoin-16.png │ │ ├── ExclusiveCoin-256.png │ │ ├── ExclusiveCoin.icns │ │ ├── ExclusiveCoin.ico │ │ ├── ExclusiveCoin.png │ │ ├── Thumbs.db │ │ ├── add.png │ │ ├── address-book.png │ │ ├── bitcoin_testnet.png │ │ ├── black │ │ │ ├── Thumbs.db │ │ │ ├── connect0_16.png │ │ │ ├── connect1_16.png │ │ │ ├── connect2_16.png │ │ │ ├── connect3_16.png │ │ │ ├── connect4_16.png │ │ │ ├── lock_closed.png │ │ │ ├── lock_open.png │ │ │ ├── notsynced.png │ │ │ ├── staking_off.png │ │ │ ├── staking_on.png │ │ │ ├── synced.png │ │ │ ├── tx_inout.png │ │ │ ├── tx_input.png │ │ │ ├── tx_mined.png │ │ │ └── tx_output.png │ │ ├── block.png │ │ ├── browse.png │ │ ├── clock1.png │ │ ├── clock2.png │ │ ├── clock3.png │ │ ├── clock4.png │ │ ├── clock5.png │ │ ├── configure.png │ │ ├── connect0_16.png │ │ ├── connect1_16.png │ │ ├── connect2_16.png │ │ ├── connect3_16.png │ │ ├── connect4_16.png │ │ ├── debugwindow.png │ │ ├── edit.png │ │ ├── editcopy.png │ │ ├── editpaste.png │ │ ├── exclusivecoin-16.png │ │ ├── exclusivecoin-80.png │ │ ├── export.png │ │ ├── eye.png │ │ ├── eye_minus.png │ │ ├── eye_plus.png │ │ ├── filesave.png │ │ ├── history.png │ │ ├── key.png │ │ ├── lock_closed.png │ │ ├── lock_open.png │ │ ├── notsynced.png │ │ ├── onion-black.png │ │ ├── onion.png │ │ ├── overview.png │ │ ├── qrcode.png │ │ ├── quit.png │ │ ├── receive.png │ │ ├── remove.png │ │ ├── send.png │ │ ├── staking_off.png │ │ ├── staking_on.png │ │ ├── synced.png │ │ ├── trade.png │ │ ├── transaction0.png │ │ ├── transaction2.png │ │ ├── transaction_conflicted.png │ │ ├── tx_inout.png │ │ ├── tx_input.png │ │ ├── tx_mined.png │ │ └── tx_output.png │ ├── images │ │ ├── about.png │ │ ├── header.png │ │ ├── splash2.jpg │ │ ├── splash2.png │ │ └── splash3.png │ ├── movies │ │ ├── update_spinner.mng │ │ └── update_spinner_black.mng │ ├── orig.res │ │ ├── bitcoin-qt.rc │ │ ├── icons │ │ │ ├── add.png │ │ │ ├── address-book.png │ │ │ ├── clock1.png │ │ │ ├── clock2.png │ │ │ ├── clock3.png │ │ │ ├── clock4.png │ │ │ ├── clock5.png │ │ │ ├── configure.png │ │ │ ├── connect0_16.png │ │ │ ├── connect1_16.png │ │ │ ├── connect2_16.png │ │ │ ├── connect3_16.png │ │ │ ├── connect4_16.png │ │ │ ├── debugwindow.png │ │ │ ├── edit.png │ │ │ ├── editcopy.png │ │ │ ├── editpaste.png │ │ │ ├── exclusivecoin_512x512.png │ │ │ ├── export.png │ │ │ ├── filesave.png │ │ │ ├── history.png │ │ │ ├── key.png │ │ │ ├── lock_closed.png │ │ │ ├── lock_open.png │ │ │ ├── mining.png │ │ │ ├── mining_active.png │ │ │ ├── mining_inactive.png │ │ │ ├── notsynced.png │ │ │ ├── overview.png │ │ │ ├── photothumb.db │ │ │ ├── qrcode.png │ │ │ ├── quit.png │ │ │ ├── receive.png │ │ │ ├── remove.png │ │ │ ├── send.png │ │ │ ├── staking_off.png │ │ │ ├── staking_on.png │ │ │ ├── synced.png │ │ │ ├── transaction0.png │ │ │ ├── transaction2.png │ │ │ ├── transaction_conflicted.png │ │ │ ├── tx_inout.png │ │ │ ├── tx_input.png │ │ │ ├── tx_mined.png │ │ │ └── tx_output.png │ │ ├── movies │ │ │ └── update_spinner.mng │ │ └── src │ │ │ ├── bitcoin.svg │ │ │ ├── clock1.svg │ │ │ ├── clock2.svg │ │ │ ├── clock3.svg │ │ │ ├── clock4.svg │ │ │ ├── clock5.svg │ │ │ ├── clock_green.svg │ │ │ ├── inout.svg │ │ │ └── questionmark.svg │ └── src │ │ ├── bitcoin.svg │ │ ├── clock1.svg │ │ ├── clock2.svg │ │ ├── clock3.svg │ │ ├── clock4.svg │ │ ├── clock5.svg │ │ ├── clock_green.svg │ │ ├── inout.svg │ │ └── questionmark.svg ├── rpcconsole.cpp ├── rpcconsole.h ├── sendcoinsdialog.cpp ├── sendcoinsdialog.h ├── sendcoinsentry.cpp ├── sendcoinsentry.h ├── sendmessagesdialog.cpp ├── sendmessagesdialog.h ├── sendmessagesentry.cpp ├── sendmessagesentry.h ├── signverifymessagedialog.cpp ├── signverifymessagedialog.h ├── test │ ├── test_main.cpp │ ├── uritests.cpp │ └── uritests.h ├── tradingdialog.cpp ├── tradingdialog.h ├── trafficgraphwidget.cpp ├── trafficgraphwidget.h ├── transactiondesc.cpp ├── transactiondesc.h ├── transactiondescdialog.cpp ├── transactiondescdialog.h ├── transactionfilterproxy.cpp ├── transactionfilterproxy.h ├── transactionrecord.cpp ├── transactionrecord.h ├── transactiontablemodel.cpp ├── transactiontablemodel.h ├── transactionview.cpp ├── transactionview.h ├── walletmodel.cpp ├── walletmodel.h ├── walletmodeltransaction.cpp └── walletmodeltransaction.h ├── rpcblockchain.cpp ├── rpcclient.cpp ├── rpcclient.h ├── rpcdarksend.cpp ├── rpcdump.cpp ├── rpcmining.cpp ├── rpcmisc.cpp ├── rpcnet.cpp ├── rpcprotocol.cpp ├── rpcprotocol.h ├── rpcrawtransaction.cpp ├── rpcserver.cpp ├── rpcserver.h ├── rpcsmessage.cpp ├── rpcwallet.cpp ├── script.cpp ├── script.h ├── scrypt.cpp ├── scrypt.h ├── secp256k1 ├── .gitignore ├── .travis.yml ├── COPYING ├── Makefile.am ├── README.md ├── TODO ├── autogen.sh ├── build-aux │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── depcomp │ ├── install-sh │ ├── ltmain.sh │ ├── m4 │ │ ├── ax_prog_cc_for_build.m4 │ │ ├── bitcoin_secp.m4 │ │ ├── libtool.m4 │ │ ├── ltoptions.m4 │ │ ├── ltsugar.m4 │ │ ├── ltversion.m4 │ │ └── lt~obsolete.m4 │ ├── missing │ └── test-driver ├── configure.ac ├── contrib │ ├── lax_der_parsing.c │ ├── lax_der_parsing.h │ ├── lax_der_privatekey_parsing.c │ └── lax_der_privatekey_parsing.h ├── include │ ├── secp256k1.h │ ├── secp256k1_ecdh.h │ ├── secp256k1_recovery.h │ └── secp256k1_schnorr.h ├── libsecp256k1.pc.in ├── obj │ └── .gitignore ├── sage │ ├── group_prover.sage │ ├── secp256k1.sage │ └── weierstrass_prover.sage └── src │ ├── basic-config.h │ ├── bench.h │ ├── bench_ecdh.c │ ├── bench_internal.c │ ├── bench_recover.c │ ├── bench_schnorr_verify.c │ ├── bench_sign.c │ ├── bench_verify.c │ ├── ecdsa.h │ ├── ecdsa_impl.h │ ├── eckey.h │ ├── eckey_impl.h │ ├── ecmult.h │ ├── ecmult_const.h │ ├── ecmult_const_impl.h │ ├── ecmult_gen.h │ ├── ecmult_gen_impl.h │ ├── ecmult_impl.h │ ├── field.h │ ├── field_10x26.h │ ├── field_10x26_impl.h │ ├── field_5x52.h │ ├── field_5x52_asm_impl.h │ ├── field_5x52_impl.h │ ├── field_5x52_int128_impl.h │ ├── field_impl.h │ ├── gen_context.c │ ├── group.h │ ├── group_impl.h │ ├── hash.h │ ├── hash_impl.h │ ├── java │ ├── org │ │ └── bitcoin │ │ │ └── NativeSecp256k1.java │ ├── org_bitcoin_NativeSecp256k1.c │ └── org_bitcoin_NativeSecp256k1.h │ ├── modules │ ├── ecdh │ │ ├── Makefile.am.include │ │ ├── main_impl.h │ │ └── tests_impl.h │ ├── recovery │ │ ├── Makefile.am.include │ │ ├── main_impl.h │ │ └── tests_impl.h │ └── schnorr │ │ ├── Makefile.am.include │ │ ├── main_impl.h │ │ ├── schnorr.h │ │ ├── schnorr_impl.h │ │ └── tests_impl.h │ ├── num.h │ ├── num_gmp.h │ ├── num_gmp_impl.h │ ├── num_impl.h │ ├── scalar.h │ ├── scalar_4x64.h │ ├── scalar_4x64_impl.h │ ├── scalar_8x32.h │ ├── scalar_8x32_impl.h │ ├── scalar_impl.h │ ├── secp256k1.c │ ├── testrand.h │ ├── testrand_impl.h │ ├── tests.c │ └── util.h ├── serialize.h ├── shavite.c ├── simd.c ├── skein.c ├── smessage.cpp ├── smessage.h ├── sph_blake.h ├── sph_bmw.h ├── sph_cubehash.h ├── sph_echo.h ├── sph_groestl.h ├── sph_jh.h ├── sph_keccak.h ├── sph_luffa.h ├── sph_shavite.h ├── sph_simd.h ├── sph_skein.h ├── sph_types.h ├── spork.cpp ├── spork.h ├── stealth.cpp ├── stealth.h ├── strlcpy.h ├── support ├── cleanse.cpp └── cleanse.h ├── sync.cpp ├── sync.h ├── test ├── Checkpoints_tests.cpp ├── README ├── accounting_tests.cpp ├── allocator_tests.cpp ├── base32_tests.cpp ├── base58_tests.cpp ├── base64_tests.cpp ├── bignum_tests.cpp ├── data │ ├── base58_encode_decode.json │ ├── base58_keys_invalid.json │ └── base58_keys_valid.json ├── getarg_tests.cpp ├── hmac_tests.cpp ├── key_tests.cpp ├── mruset_tests.cpp ├── netbase_tests.cpp ├── serialize_tests.cpp ├── sigopcount_tests.cpp ├── uint160_tests.cpp ├── uint256_tests.cpp └── wallet_tests.cpp ├── threadsafety.h ├── tinyformat.h ├── txdb-leveldb.cpp ├── txdb-leveldb.h ├── txdb.h ├── txmempool.cpp ├── txmempool.h ├── ui_interface.h ├── uint256.h ├── util.cpp ├── util.h ├── utilstrencodings.cpp ├── utilstrencodings.h ├── version.cpp ├── version.h ├── wallet.cpp ├── wallet.h ├── walletdb.cpp ├── walletdb.h └── xxhash ├── xxhash.c └── xxhash.h /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Compiled Dynamic libraries 8 | *.so 9 | *.dylib 10 | *.dll 11 | 12 | #compilation and Qt preprocessor part 13 | src/qt/locale/*.qm 14 | *.user 15 | Makefile* 16 | .qmake.stash 17 | exclusivecoin-qt 18 | 19 | 20 | src/*.exe 21 | src/exclusivecoind 22 | src/build.h 23 | .*.swp 24 | *.*~* 25 | *.bak 26 | *.rej 27 | *.orig 28 | *.o 29 | *.patch 30 | 31 | qrc_*.cpp 32 | 33 | 34 | #mac specific 35 | .DS_Store 36 | build 37 | *.plist 38 | *.xcodeproj 39 | PortIndex* 40 | dist 41 | *.app 42 | *.dmg 43 | .idea 44 | *.iml -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | os: 3 | - linux 4 | cache: 5 | apt: true 6 | directories: 7 | - $HOME/transferdev/Transfercoin/src/leveldb 8 | - $HOME/transferdev/Transfercoin/src/secp256k1 9 | - $HOME/Infernoman/Transfercoin/src/leveldb 10 | - $HOME/Infernoman/Transfercoin/src/secp256k1 11 | addons: 12 | apt: 13 | sources: 14 | - boost-latest 15 | - ubuntu-sdk-team 16 | packages: 17 | - build-essential 18 | - libdb++-dev 19 | - libboost1.55-all-dev 20 | - autoconf 21 | - protobuf-compiler 22 | - libtool 23 | - libminiupnpc-dev 24 | - libqrencode-dev 25 | - libprotobuf-dev 26 | - libssl-dev 27 | - libgmp3-dev 28 | - libqt5gui5 29 | - qtbase5-dev 30 | - libqt5dbus5 31 | - qttools5-dev 32 | - qttools5-dev-tools 33 | before_install: 34 | - chmod 755 src/leveldb/build_detect_platform 35 | script: 36 | - qmake -qt=qt5 USE_UPNP=- 37 | - make 38 | - cd src 39 | - make -f makefile.unix 40 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 ExclusiveCoin Developers 2 | Copyright (c) 2014-2015 ExclusiveCoin Developers 3 | Copyright (c) 2013-2014 NovaCoin Developers 4 | Copyright (c) 2011-2012 PPCoin Developers 5 | Copyright (c) 2009-2015 Bitcoin 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 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building ExclusiveCoin 2 | 3 | See doc/readme-qt.rst for instructions on building ExclusiveCoin QT, 4 | the intended-for-end-users, nice-graphical-interface, reference 5 | implementation of ExclusiveCoin. 6 | 7 | See doc/build-*.txt for instructions on building exclusivecoind, 8 | the intended-for-services, no-graphical-interface, reference 9 | implementation of ExclusiveCoin. 10 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | ExclusiveCoin is a PoS-based cryptocurrency. 3 | 4 | ExclusiveCoin uses libsecp256k1, 5 | libgmp, 6 | Boost1.55, 7 | OR Boost1.57, 8 | Openssl1.01p, 9 | Berkeley DB 4.8, 10 | QT5 to compile 11 | 12 | 13 | Block Spacing: 60 Seconds 14 | Stake Minimum Age: 24 Hours 15 | 16 | Port: 23230 17 | RPC Port: 23231 18 | 19 | 20 | BUILD LINUX 21 | ----------- 22 | 1) git clone https://github.com/exclusivecoin/ExclusiveCoin 23 | 24 | 2) cd ExclusiveCoin/src 25 | 26 | 3) sudo make -f makefile.unix # Headless 27 | 28 | (optional) 29 | 30 | 4) strip exclusivecoind 31 | 32 | 5) sudo cp exclusivecoind /usr/local/bin 33 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/bluematt-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/bluematt-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/devrandom-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/devrandom-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/gavinandresen-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/gavinandresen-key.pgp -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/linux-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: exclusivecoin 3 | urls: 4 | - http://exclusivecoin.org/exclusivecoin-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: exclusivecoin-\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/luke-jr-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/luke-jr-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/sipa-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/sipa-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/tcatm-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/gitian-downloader/tcatm-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/win32-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: exclusivecoin 3 | urls: 4 | - http://exclusivecoin.org/exclusivecoin-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: exclusivecoin-\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 | -------------------------------------------------------------------------------- /contrib/linearize/README.md: -------------------------------------------------------------------------------- 1 | # Linearize 2 | Construct a linear, no-fork, best version of the blockchain. 3 | 4 | ## Step 1: Download hash list 5 | 6 | $ ./linearize-hashes.py linearize.cfg > hashlist.txt 7 | 8 | Required configuration file settings for linearize-hashes: 9 | * RPC: rpcuser, rpcpassword 10 | 11 | Optional config file setting for linearize-hashes: 12 | * RPC: host, port 13 | * Block chain: min_height, max_height 14 | 15 | ## Step 2: Copy local block data 16 | 17 | $ ./linearize-data.py linearize.cfg 18 | 19 | Required configuration file settings: 20 | * "input": exclusivecoind blocks/ directory containing blkNNNNN.dat 21 | * "hashlist": text file containing list of block hashes, linearized-hashes.py 22 | output. 23 | * "output_file": bootstrap.dat 24 | or 25 | * "output": output directory for linearized blocks/blkNNNNN.dat output 26 | 27 | Optional config file setting for linearize-data: 28 | * "netmagic": network magic number 29 | * "max_out_sz": maximum output file size (default 1000*1000*1000) 30 | * "split_timestamp": Split files when a new month is first seen, in addition to 31 | reaching a maximum file size. 32 | * "file_timestamp": Set each file's last-modified time to that of the 33 | most recent block in that file. 34 | -------------------------------------------------------------------------------- /contrib/linearize/example-linearize.cfg: -------------------------------------------------------------------------------- 1 | 2 | # exclusivecoind RPC settings (linearize-hashes) 3 | rpcuser=someuser 4 | rpcpassword=somepassword 5 | host=127.0.0.1 6 | port=31500 7 | background-color: rgb(0, 0, 0); 8 | alternate-background-color: rgb(86, 0, 120); 9 | 10 | # bootstrap.dat hashlist settings (linearize-hashes) 11 | max_height=390000 12 | 13 | # bootstrap.dat input/output settings (linearize-data) 14 | netmagic=70352205 15 | input=/home/example/.exclusivecoin 16 | output_file=/home/example/Downloads/bootstrap.dat 17 | hashlist=hashlist.txt 18 | split_year=1 19 | 20 | -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/contrib/macdeploy/background.psd -------------------------------------------------------------------------------- /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 | ExclusiveCoin-Qt.app 26 | 27 | 128 28 | 156 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /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 ExclusiveCoin-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: ExclusiveCoin-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 "exclusivecoin-qt" 26 | 27 | -------------------------------------------------------------------------------- /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 exclusivecoin 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 $EXCLUSIVECOINDIR/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'exclusivecoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'exclusivecoin_*.qm')) ]) 20 | 21 | print ",".join(sorted(l1.intersection(l2))) 22 | 23 | -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /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) -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | ExclusiveCoin 0.4.4 BETA 2 | 3 | Copyright (c) 2013 NovaCoin Developers 4 | Copyright (c) 2011-2012 PPCoin Developers 5 | Distributed under the MIT/X11 software license, see the accompanying 6 | file license.txt or http://www.opensource.org/licenses/mit-license.php. 7 | This product includes software developed by the OpenSSL Project for use in 8 | the OpenSSL Toolkit (http://www.openssl.org/). This product includes 9 | cryptographic software written by Eric Young (eay@cryptsoft.com). 10 | 11 | 12 | Intro 13 | ----- 14 | ExclusiveCoin is a free open source project derived from Bitcoin, with 15 | the goal of providing a long-term energy-efficient scrypt-based crypto-currency. 16 | Built on the foundation of Bitcoin, PPCoin and NovaCoin, innovations such as proof-of-stake 17 | help further advance the field of crypto-currency. 18 | 19 | -------------------------------------------------------------------------------- /doc/bitcoin_logo_doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/doc/bitcoin_logo_doxygen.png -------------------------------------------------------------------------------- /doc/readme-qt.rst: -------------------------------------------------------------------------------- 1 | ExclusiveCoin-qt: Qt5 GUI for ExclusiveCoin 2 | =============================== 3 | 4 | Linux 5 | ------- 6 | https://github.com/exclusivecoindev/Exclusivecoin/blob/master/doc/build-unix.md 7 | 8 | Windows 9 | -------- 10 | https://github.com/exclusivecoindev/Exclusivecoin/blob/master/doc/build-msw.md 11 | 12 | Mac OS X 13 | -------- 14 | https://github.com/exclusivecoindev/Exclusivecoin/blob/master/doc/build-osx.md 15 | -------------------------------------------------------------------------------- /doc/ssl.md: -------------------------------------------------------------------------------- 1 | Enabling SSL on original client daemon 2 | ====================================== 3 | By default, Exclusivecoin allows JSON-RPC commands to be sent to http://localhost:17171 4 | and accepts connections only from the localhost. 5 | 6 | JSON-RPC Over SSL Setup 7 | ----------------------- 8 | It can be configured to allow HTTPS connections. You must follow the steps below 9 | for this to work properly. 10 | 11 | 1. Setup a certificate and private key. A self signed certificate will work. 12 | * cd ~/.exclusivecoin 13 | * openssl genrsa -out server.pem 4096 14 | * openssl req -new -x509 -nodes -sha1 -days 3650 -key server.pem > server.cert 15 | (NOTE: you should NOT enter a passphrase) 16 | 17 | 2. Configure NeosCoin to use SSL 18 | * Stop your current exclusivecoind or exclusivecoin-qt 19 | * Edit the exclusivecoin.conf and add 20 | rpcssl=1 21 | 22 | 3. Restart Exclusivecoin to make these changes take effect. 23 | 24 | 4. Optionally you can test SSL functionality using the openssl s_client command 25 | * openssl s_client -connect localhost:15004 26 | -------------------------------------------------------------------------------- /releases/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/releases/.DS_Store -------------------------------------------------------------------------------- /share/genbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -gt 0 ]; then 4 | FILE="$1" 5 | shift 6 | if [ -f "$FILE" ]; then 7 | INFO="$(head -n 1 "$FILE")" 8 | fi 9 | else 10 | echo "Usage: $0 " 11 | exit 1 12 | fi 13 | 14 | if [ -e "$(which git)" ]; then 15 | # clean 'dirty' status of touched files that haven't been modified 16 | git diff >/dev/null 2>/dev/null 17 | 18 | # get a string like "v0.6.0-66-g59887e8-dirty" 19 | DESC="$(git describe --dirty 2>/dev/null)" 20 | 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 | -------------------------------------------------------------------------------- /share/pixmaps/addressbook16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/bitcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/bitcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /share/qt/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIconFile 6 | ExclusiveCoin.icns 7 | CFBundlePackageType 8 | APPL 9 | CFBundleGetInfoString 10 | ExclusiveCoin-Qt 11 | CFBundleSignature 12 | ???? 13 | CFBundleExecutable 14 | ExclusiveCoin-Qt 15 | CFBundleIdentifier 16 | co.exclusivecoin.ExclusiveCoin-Qt 17 | CFBundleURLTypes 18 | 19 | 20 | CFBundleTypeRole 21 | Editor 22 | CFBundleURLName 23 | co.exclusivecoin.ExclusiveCoinPayment 24 | CFBundleURLSchemes 25 | 26 | exclusivecoin 27 | 28 | 29 | 30 | LSAppNapIsDisabled 31 | True 32 | 33 | 34 | -------------------------------------------------------------------------------- /share/qt/img/reload.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/share/qt/img/reload.xcf -------------------------------------------------------------------------------- /share/qt/make_spinner.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # W.J. van der Laan, 2011 3 | # Make spinning .mng animation from a .png 4 | # Requires imagemagick 6.7+ 5 | from __future__ import division 6 | from os import path 7 | from PIL import Image 8 | from subprocess import Popen 9 | 10 | SRC='img/reload_scaled.png' 11 | DST='../../src/qt/res/movies/update_spinner.mng' 12 | TMPDIR='/tmp' 13 | TMPNAME='tmp-%03i.png' 14 | NUMFRAMES=35 15 | FRAMERATE=10.0 16 | CONVERT='convert' 17 | CLOCKWISE=True 18 | DSIZE=(16,16) 19 | 20 | im_src = Image.open(SRC) 21 | 22 | if CLOCKWISE: 23 | im_src = im_src.transpose(Image.FLIP_LEFT_RIGHT) 24 | 25 | def frame_to_filename(frame): 26 | return path.join(TMPDIR, TMPNAME % frame) 27 | 28 | frame_files = [] 29 | for frame in xrange(NUMFRAMES): 30 | rotation = (frame + 0.5) / NUMFRAMES * 360.0 31 | if CLOCKWISE: 32 | rotation = -rotation 33 | im_new = im_src.rotate(rotation, Image.BICUBIC) 34 | im_new.thumbnail(DSIZE, Image.ANTIALIAS) 35 | outfile = frame_to_filename(frame) 36 | im_new.save(outfile, 'png') 37 | frame_files.append(outfile) 38 | 39 | p = Popen([CONVERT, "-delay", str(FRAMERATE), "-dispose", "2"] + frame_files + [DST]) 40 | p.communicate() 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /share/qt/make_windows_icon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # create multiresolution windows icon 3 | ICON_DST=../../src/qt/res/icons/novacoin.ico 4 | 5 | convert ../../src/qt/res/icons/novacoin-16.png ../../src/qt/res/icons/novacoin-32.png ../../src/qt/res/icons/novacoin-48.png ${ICON_DST} 6 | -------------------------------------------------------------------------------- /share/seeds/nodes_main.txt: -------------------------------------------------------------------------------- 1 | 178.62.74.201 2 | 107.170.120.23 3 | -------------------------------------------------------------------------------- /share/seeds/nodes_test.txt: -------------------------------------------------------------------------------- 1 | # List of fixed seed nodes for testnet 2 | -------------------------------------------------------------------------------- /share/ui.rc: -------------------------------------------------------------------------------- 1 | bitcoin ICON "pixmaps/bitcoin.ico" 2 | 3 | #include "wx/msw/wx.rc" 4 | 5 | check ICON "pixmaps/check.ico" 6 | send16 BITMAP "pixmaps/send16.bmp" 7 | send16mask BITMAP "pixmaps/send16mask.bmp" 8 | send16masknoshadow BITMAP "pixmaps/send16masknoshadow.bmp" 9 | send20 BITMAP "pixmaps/send20.bmp" 10 | send20mask BITMAP "pixmaps/send20mask.bmp" 11 | addressbook16 BITMAP "pixmaps/addressbook16.bmp" 12 | addressbook16mask BITMAP "pixmaps/addressbook16mask.bmp" 13 | addressbook20 BITMAP "pixmaps/addressbook20.bmp" 14 | addressbook20mask BITMAP "pixmaps/addressbook20mask.bmp" 15 | favicon ICON "pixmaps/favicon.ico" 16 | -------------------------------------------------------------------------------- /src/chainparamsseeds.h: -------------------------------------------------------------------------------- 1 | #ifndef H_CHAINPARAMSSEEDS 2 | #define H_CHAINPARAMSSEEDS 3 | // List of fixed seed nodes for the bitcoin network 4 | // AUTOGENERATED by contrib/devtools/generate-seeds.py 5 | 6 | // Each line contains a 16-byte IPv6 address and a port. 7 | // IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. 8 | static SeedSpec6 pnSeed6_main[] = { 9 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x6b,0xaa,0x78,0x17}, 23230}, 10 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xb2,0x3e,0x4a,0xc9}, 23230}, 11 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xd0,0xa3,0x9e,0xc9}, 23230}, 12 | {{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0xa1,0x30,0x3b}, 23230} 13 | }; 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/checkpoints.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2012 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_CHECKPOINT_H 5 | #define BITCOIN_CHECKPOINT_H 6 | 7 | #include 8 | #include "net.h" 9 | #include "util.h" 10 | 11 | class uint256; 12 | class CBlockIndex; 13 | 14 | /** Block-chain checkpoints are compiled-in sanity checks. 15 | * They are updated every release or three. 16 | */ 17 | namespace Checkpoints 18 | { 19 | 20 | // Returns true if block passes checkpoint checks 21 | bool CheckHardened(int nHeight, const uint256& hash); 22 | 23 | // Return conservative estimate of total number of blocks, 0 if unknown 24 | int GetTotalBlocksEstimate(); 25 | 26 | // Returns last CBlockIndex* in mapBlockIndex that is a checkpoint 27 | CBlockIndex* GetLastCheckpoint(const std::map& mapBlockIndex); 28 | 29 | const CBlockIndex* AutoSelectSyncCheckpoint(); 30 | bool CheckSync(int nHeight); 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /src/clientversion.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTVERSION_H 2 | #define CLIENTVERSION_H 3 | 4 | // 5 | // client versioning 6 | // 7 | 8 | // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it 9 | #define CLIENT_VERSION_MAJOR 1 10 | #define CLIENT_VERSION_MINOR 4 11 | #define CLIENT_VERSION_REVISION 0 12 | #define CLIENT_VERSION_BUILD 1 13 | 14 | // Set to true for release, false for prerelease or test build 15 | #define CLIENT_VERSION_IS_RELEASE true 16 | 17 | // Converts the parameter X to a string after macro replacement on X has been performed. 18 | // Don't merge these into one macro! 19 | #define STRINGIZE(X) DO_STRINGIZE(X) 20 | #define DO_STRINGIZE(X) #X 21 | 22 | #endif // CLIENTVERSION_H 23 | -------------------------------------------------------------------------------- /src/coincontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROL_H 2 | #define COINCONTROL_H 3 | 4 | #include "core.h" 5 | 6 | /** Coin Control Features. */ 7 | class CCoinControl 8 | { 9 | public: 10 | CTxDestination destChange; 11 | bool useDarkSend; 12 | bool useInstantX; 13 | 14 | CCoinControl() 15 | { 16 | SetNull(); 17 | } 18 | 19 | void SetNull() 20 | { 21 | destChange = CNoDestination(); 22 | setSelected.clear(); 23 | useInstantX = false; 24 | useDarkSend = true; 25 | } 26 | 27 | bool HasSelected() const 28 | { 29 | return (setSelected.size() > 0); 30 | } 31 | 32 | bool IsSelected(const uint256& hash, unsigned int n) const 33 | { 34 | COutPoint outpt(hash, n); 35 | return (setSelected.count(outpt) > 0); 36 | } 37 | 38 | void Select(COutPoint& output) 39 | { 40 | setSelected.insert(output); 41 | } 42 | 43 | void UnSelect(COutPoint& output) 44 | { 45 | setSelected.erase(output); 46 | } 47 | 48 | void UnSelectAll() 49 | { 50 | setSelected.clear(); 51 | } 52 | 53 | void ListSelected(std::vector& vOutpoints) 54 | { 55 | vOutpoints.assign(setSelected.begin(), setSelected.end()); 56 | } 57 | 58 | private: 59 | std::set setSelected; 60 | 61 | }; 62 | 63 | #endif // COINCONTROL_H 64 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 | #include "crypto/hmac_sha256.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[64]; 12 | if (keylen <= 64) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 64 - keylen); 15 | } else { 16 | CSHA256().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 32, 0, 32); 18 | } 19 | 20 | for (int n = 0; n < 64; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 64); 23 | 24 | for (int n = 0; n < 64; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 64); 27 | } 28 | 29 | void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[32]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 32).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_HMAC_SHA256_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA256_H 7 | 8 | #include "crypto/sha256.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA256 15 | { 16 | private: 17 | CSHA256 outer; 18 | CSHA256 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 32; 22 | 23 | CHMAC_SHA256(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA256& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA256_H 33 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 | #include "crypto/hmac_sha512.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[128]; 12 | if (keylen <= 128) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 128 - keylen); 15 | } else { 16 | CSHA512().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 64, 0, 64); 18 | } 19 | 20 | for (int n = 0; n < 128; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 128); 23 | 24 | for (int n = 0; n < 128; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 128); 27 | } 28 | 29 | void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[64]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 64).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_HMAC_SHA512_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA512_H 7 | 8 | #include "crypto/sha512.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA512 15 | { 16 | private: 17 | CSHA512 outer; 18 | CSHA512 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 64; 22 | 23 | CHMAC_SHA512(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA512& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA512_H 33 | -------------------------------------------------------------------------------- /src/crypto/ripemd160.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_RIPEMD160_H 6 | #define BITCOIN_CRYPTO_RIPEMD160_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for RIPEMD-160. */ 12 | class CRIPEMD160 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CRIPEMD160(); 23 | CRIPEMD160& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CRIPEMD160& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_RIPEMD160_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha1.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_SHA1_H 6 | #define BITCOIN_CRYPTO_SHA1_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA1. */ 12 | class CSHA1 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CSHA1(); 23 | CSHA1& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA1& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA1_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_SHA256_H 6 | #define BITCOIN_CRYPTO_SHA256_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-256. */ 12 | class CSHA256 13 | { 14 | private: 15 | uint32_t s[8]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 32; 21 | 22 | CSHA256(); 23 | CSHA256& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA256& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA256_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core 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 BITCOIN_CRYPTO_SHA512_H 6 | #define BITCOIN_CRYPTO_SHA512_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-512. */ 12 | class CSHA512 13 | { 14 | private: 15 | uint64_t s[8]; 16 | unsigned char buf[128]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 64; 21 | 22 | CSHA512(); 23 | CSHA512& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA512& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA512_H 29 | -------------------------------------------------------------------------------- /src/darksend-relay.h: -------------------------------------------------------------------------------- 1 | 2 | // Copyright (c) 2014-2015 The Darkcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef DARKSEND_RELAY_H 7 | #define DARKSEND_RELAY_H 8 | 9 | #include "core.h" 10 | #include "main.h" 11 | #include "activemasternode.h" 12 | #include "masternodeman.h" 13 | 14 | 15 | class CDarkSendRelay 16 | { 17 | public: 18 | CTxIn vinMasternode; 19 | vector vchSig; 20 | vector vchSig2; 21 | int nBlockHeight; 22 | int nRelayType; 23 | CTxIn in; 24 | CTxOut out; 25 | 26 | CDarkSendRelay(); 27 | CDarkSendRelay(CTxIn& vinMasternodeIn, vector& vchSigIn, int nBlockHeightIn, int nRelayTypeIn, CTxIn& in2, CTxOut& out2); 28 | 29 | IMPLEMENT_SERIALIZE 30 | ( 31 | READWRITE(vinMasternode); 32 | READWRITE(vchSig); 33 | READWRITE(vchSig2); 34 | READWRITE(nBlockHeight); 35 | READWRITE(nRelayType); 36 | READWRITE(in); 37 | READWRITE(out); 38 | ) 39 | 40 | std::string ToString(); 41 | 42 | bool Sign(std::string strSharedKey); 43 | bool VerifyMessage(std::string strSharedKey); 44 | void Relay(); 45 | void RelayThroughNode(int nRank); 46 | }; 47 | 48 | 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/hash.cpp: -------------------------------------------------------------------------------- 1 | #include "hash.h" 2 | 3 | int HMAC_SHA512_Init(HMAC_SHA512_CTX *pctx, const void *pkey, size_t len) 4 | { 5 | unsigned char key[128]; 6 | if (len <= 128) 7 | { 8 | memcpy(key, pkey, len); 9 | memset(key + len, 0, 128-len); 10 | } 11 | else 12 | { 13 | SHA512_CTX ctxKey; 14 | SHA512_Init(&ctxKey); 15 | SHA512_Update(&ctxKey, pkey, len); 16 | SHA512_Final(key, &ctxKey); 17 | memset(key + 64, 0, 64); 18 | } 19 | 20 | for (int n=0; n<128; n++) 21 | key[n] ^= 0x5c; 22 | SHA512_Init(&pctx->ctxOuter); 23 | SHA512_Update(&pctx->ctxOuter, key, 128); 24 | 25 | for (int n=0; n<128; n++) 26 | key[n] ^= 0x5c ^ 0x36; 27 | SHA512_Init(&pctx->ctxInner); 28 | return SHA512_Update(&pctx->ctxInner, key, 128); 29 | } 30 | 31 | int HMAC_SHA512_Update(HMAC_SHA512_CTX *pctx, const void *pdata, size_t len) 32 | { 33 | return SHA512_Update(&pctx->ctxInner, pdata, len); 34 | } 35 | 36 | int HMAC_SHA512_Final(unsigned char *pmd, HMAC_SHA512_CTX *pctx) 37 | { 38 | unsigned char buf[64]; 39 | SHA512_Final(buf, &pctx->ctxInner); 40 | SHA512_Update(&pctx->ctxOuter, buf, 64); 41 | return SHA512_Final(pmd, &pctx->ctxOuter); 42 | } 43 | 44 | void BIP32Hash(const unsigned char chainCode[32], unsigned int nChild, unsigned char header, const unsigned char data[32], unsigned char output[64]) { 45 | unsigned char num[4]; 46 | num[0] = (nChild >> 24) & 0xFF; 47 | num[1] = (nChild >> 16) & 0xFF; 48 | num[2] = (nChild >> 8) & 0xFF; 49 | num[3] = (nChild >> 0) & 0xFF; 50 | HMAC_SHA512_CTX ctx; 51 | HMAC_SHA512_Init(&ctx, chainCode, 32); 52 | HMAC_SHA512_Update(&ctx, &header, 1); 53 | HMAC_SHA512_Update(&ctx, data, 32); 54 | HMAC_SHA512_Update(&ctx, num, 4); 55 | HMAC_SHA512_Final(output, &ctx); 56 | } 57 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef BITCOIN_INIT_H 6 | #define BITCOIN_INIT_H 7 | 8 | #include "wallet.h" 9 | 10 | namespace boost { 11 | class thread_group; 12 | } // namespace boost 13 | 14 | extern CWallet* pwalletMain; 15 | void StartShutdown(); 16 | bool ShutdownRequested(); 17 | void Shutdown(); 18 | bool AppInit2(boost::thread_group& threadGroup); 19 | std::string HelpMessage(); 20 | extern bool fOnlyTor; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /src/json/json_spirit_error_position.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_ERROR_POSITION 2 | #define JSON_SPIRIT_ERROR_POSITION 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include 14 | 15 | namespace json_spirit 16 | { 17 | // An Error_position exception is thrown by the "read_or_throw" functions below on finding an error. 18 | // Note the "read_or_throw" functions are around 3 times slower than the standard functions "read" 19 | // functions that return a bool. 20 | // 21 | struct Error_position 22 | { 23 | Error_position(); 24 | Error_position( unsigned int line, unsigned int column, const std::string& reason ); 25 | bool operator==( const Error_position& lhs ) const; 26 | unsigned int line_; 27 | unsigned int column_; 28 | std::string reason_; 29 | }; 30 | 31 | inline Error_position::Error_position() 32 | : line_( 0 ) 33 | , column_( 0 ) 34 | { 35 | } 36 | 37 | inline Error_position::Error_position( unsigned int line, unsigned int column, const std::string& reason ) 38 | : line_( line ) 39 | , column_( column ) 40 | , reason_( reason ) 41 | { 42 | } 43 | 44 | inline bool Error_position::operator==( const Error_position& lhs ) const 45 | { 46 | if( this == &lhs ) return true; 47 | 48 | return ( reason_ == lhs.reason_ ) && 49 | ( line_ == lhs.line_ ) && 50 | ( column_ == lhs.column_ ); 51 | } 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /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/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/leveldb/.gitignore: -------------------------------------------------------------------------------- 1 | build_config.mk 2 | *.a 3 | *.o 4 | *.dylib* 5 | *.so 6 | *.so.* 7 | *_test 8 | db_bench 9 | leveldbutil 10 | Release 11 | Debug 12 | Benchmark 13 | vs2010.* 14 | -------------------------------------------------------------------------------- /src/leveldb/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | 6 | # Initial version authors: 7 | Jeffrey Dean 8 | Sanjay Ghemawat 9 | 10 | # Partial list of contributors: 11 | Kevin Regan 12 | Johan Bilien 13 | -------------------------------------------------------------------------------- /src/leveldb/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above 10 | copyright notice, this list of conditions and the following disclaimer 11 | in the documentation and/or other materials provided with the 12 | distribution. 13 | * Neither the name of Google Inc. nor the names of its 14 | contributors may be used to endorse or promote products derived from 15 | this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /src/leveldb/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /src/leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /src/leveldb/WINDOWS.md: -------------------------------------------------------------------------------- 1 | # Building LevelDB On Windows 2 | 3 | ## Prereqs 4 | 5 | Install the [Windows Software Development Kit version 7.1](http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b). 6 | 7 | Download and extract the [Snappy source distribution](http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz) 8 | 9 | 1. Open the "Windows SDK 7.1 Command Prompt" : 10 | Start Menu -> "Microsoft Windows SDK v7.1" > "Windows SDK 7.1 Command Prompt" 11 | 2. Change the directory to the leveldb project 12 | 13 | ## Building the Static lib 14 | 15 | * 32 bit Version 16 | 17 | setenv /x86 18 | msbuild.exe /p:Configuration=Release /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 19 | 20 | * 64 bit Version 21 | 22 | setenv /x64 23 | msbuild.exe /p:Configuration=Release /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 24 | 25 | 26 | ## Building and Running the Benchmark app 27 | 28 | * 32 bit Version 29 | 30 | setenv /x86 31 | msbuild.exe /p:Configuration=Benchmark /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 32 | Benchmark\leveldb.exe 33 | 34 | * 64 bit Version 35 | 36 | setenv /x64 37 | msbuild.exe /p:Configuration=Benchmark /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 38 | x64\Benchmark\leveldb.exe 39 | 40 | -------------------------------------------------------------------------------- /src/leveldb/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | extern Status BuildTable(const std::string& dbname, 26 | Env* env, 27 | const Options& options, 28 | TableCache* table_cache, 29 | Iterator* iter, 30 | FileMetaData* meta); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /src/leveldb/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.txt for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), type (1 byte), length (2 bytes). 30 | static const int kHeaderSize = 4 + 1 + 2; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /src/leveldb/db/log_writer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_LOG_WRITER_H_ 6 | #define STORAGE_LEVELDB_DB_LOG_WRITER_H_ 7 | 8 | #include 9 | #include "db/log_format.h" 10 | #include "leveldb/slice.h" 11 | #include "leveldb/status.h" 12 | 13 | namespace leveldb { 14 | 15 | class WritableFile; 16 | 17 | namespace log { 18 | 19 | class Writer { 20 | public: 21 | // Create a writer that will append data to "*dest". 22 | // "*dest" must be initially empty. 23 | // "*dest" must remain live while this Writer is in use. 24 | explicit Writer(WritableFile* dest); 25 | ~Writer(); 26 | 27 | Status AddRecord(const Slice& slice); 28 | 29 | private: 30 | WritableFile* dest_; 31 | int block_offset_; // Current offset in block 32 | 33 | // crc32c values for all supported record types. These are 34 | // pre-computed to reduce the overhead of computing the crc of the 35 | // record type stored in the header. 36 | uint32_t type_crc_[kMaxRecordType + 1]; 37 | 38 | Status EmitPhysicalRecord(RecordType type, const char* ptr, size_t length); 39 | 40 | // No copying allowed 41 | Writer(const Writer&); 42 | void operator=(const Writer&); 43 | }; 44 | 45 | } // namespace log 46 | } // namespace leveldb 47 | 48 | #endif // STORAGE_LEVELDB_DB_LOG_WRITER_H_ 49 | -------------------------------------------------------------------------------- /src/leveldb/db/version_edit_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "db/version_edit.h" 6 | #include "util/testharness.h" 7 | 8 | namespace leveldb { 9 | 10 | static void TestEncodeDecode(const VersionEdit& edit) { 11 | std::string encoded, encoded2; 12 | edit.EncodeTo(&encoded); 13 | VersionEdit parsed; 14 | Status s = parsed.DecodeFrom(encoded); 15 | ASSERT_TRUE(s.ok()) << s.ToString(); 16 | parsed.EncodeTo(&encoded2); 17 | ASSERT_EQ(encoded, encoded2); 18 | } 19 | 20 | class VersionEditTest { }; 21 | 22 | TEST(VersionEditTest, EncodeDecode) { 23 | static const uint64_t kBig = 1ull << 50; 24 | 25 | VersionEdit edit; 26 | for (int i = 0; i < 4; i++) { 27 | TestEncodeDecode(edit); 28 | edit.AddFile(3, kBig + 300 + i, kBig + 400 + i, 29 | InternalKey("foo", kBig + 500 + i, kTypeValue), 30 | InternalKey("zoo", kBig + 600 + i, kTypeDeletion)); 31 | edit.DeleteFile(4, kBig + 700 + i); 32 | edit.SetCompactPointer(i, InternalKey("x", kBig + 900 + i, kTypeValue)); 33 | } 34 | 35 | edit.SetComparatorName("foo"); 36 | edit.SetLogNumber(kBig + 100); 37 | edit.SetNextFile(kBig + 200); 38 | edit.SetLastSequence(kBig + 1000); 39 | TestEncodeDecode(edit); 40 | } 41 | 42 | } // namespace leveldb 43 | 44 | int main(int argc, char** argv) { 45 | return leveldb::test::RunAllTests(); 46 | } 47 | -------------------------------------------------------------------------------- /src/leveldb/db/write_batch_internal.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 6 | #define STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 7 | 8 | #include "leveldb/write_batch.h" 9 | 10 | namespace leveldb { 11 | 12 | class MemTable; 13 | 14 | // WriteBatchInternal provides static methods for manipulating a 15 | // WriteBatch that we don't want in the public WriteBatch interface. 16 | class WriteBatchInternal { 17 | public: 18 | // Return the number of entries in the batch. 19 | static int Count(const WriteBatch* batch); 20 | 21 | // Set the count for the number of entries in the batch. 22 | static void SetCount(WriteBatch* batch, int n); 23 | 24 | // Return the seqeunce number for the start of this batch. 25 | static SequenceNumber Sequence(const WriteBatch* batch); 26 | 27 | // Store the specified number as the seqeunce number for the start of 28 | // this batch. 29 | static void SetSequence(WriteBatch* batch, SequenceNumber seq); 30 | 31 | static Slice Contents(const WriteBatch* batch) { 32 | return Slice(batch->rep_); 33 | } 34 | 35 | static size_t ByteSize(const WriteBatch* batch) { 36 | return batch->rep_.size(); 37 | } 38 | 39 | static void SetContents(WriteBatch* batch, const Slice& contents); 40 | 41 | static Status InsertInto(const WriteBatch* batch, MemTable* memtable); 42 | 43 | static void Append(WriteBatch* dst, const WriteBatch* src); 44 | }; 45 | 46 | } // namespace leveldb 47 | 48 | 49 | #endif // STORAGE_LEVELDB_DB_WRITE_BATCH_INTERNAL_H_ 50 | -------------------------------------------------------------------------------- /src/leveldb/doc/doc.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin-left: 0.5in; 3 | margin-right: 0.5in; 4 | background: white; 5 | color: black; 6 | } 7 | 8 | h1 { 9 | margin-left: -0.2in; 10 | font-size: 14pt; 11 | } 12 | h2 { 13 | margin-left: -0in; 14 | font-size: 12pt; 15 | } 16 | h3 { 17 | margin-left: -0in; 18 | } 19 | h4 { 20 | margin-left: -0in; 21 | } 22 | hr { 23 | margin-left: -0in; 24 | } 25 | 26 | /* Definition lists: definition term bold */ 27 | dt { 28 | font-weight: bold; 29 | } 30 | 31 | address { 32 | text-align: center; 33 | } 34 | code,samp,var { 35 | color: blue; 36 | } 37 | kbd { 38 | color: #600000; 39 | } 40 | div.note p { 41 | float: right; 42 | width: 3in; 43 | margin-right: 0%; 44 | padding: 1px; 45 | border: 2px solid #6060a0; 46 | background-color: #fffff0; 47 | } 48 | 49 | ul { 50 | margin-top: -0em; 51 | margin-bottom: -0em; 52 | } 53 | 54 | ol { 55 | margin-top: -0em; 56 | margin-bottom: -0em; 57 | } 58 | 59 | UL.nobullets { 60 | list-style-type: none; 61 | list-style-image: none; 62 | margin-left: -1em; 63 | } 64 | 65 | p { 66 | margin: 1em 0 1em 0; 67 | padding: 0 0 0 0; 68 | } 69 | 70 | pre { 71 | line-height: 1.3em; 72 | padding: 0.4em 0 0.8em 0; 73 | margin: 0 0 0 0; 74 | border: 0 0 0 0; 75 | color: blue; 76 | } 77 | 78 | .datatable { 79 | margin-left: auto; 80 | margin-right: auto; 81 | margin-top: 2em; 82 | margin-bottom: 2em; 83 | border: 1px solid; 84 | } 85 | 86 | .datatable td,th { 87 | padding: 0 0.5em 0 0.5em; 88 | text-align: right; 89 | } 90 | -------------------------------------------------------------------------------- /src/leveldb/helpers/memenv/memenv.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 6 | #define STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Env; 11 | 12 | // Returns a new environment that stores its data in memory and delegates 13 | // all non-file-storage tasks to base_env. The caller must delete the result 14 | // when it is no longer needed. 15 | // *base_env must remain live while the result is in use. 16 | Env* NewMemEnv(Env* base_env); 17 | 18 | } // namespace leveldb 19 | 20 | #endif // STORAGE_LEVELDB_HELPERS_MEMENV_MEMENV_H_ 21 | -------------------------------------------------------------------------------- /src/leveldb/port/README: -------------------------------------------------------------------------------- 1 | This directory contains interfaces and implementations that isolate the 2 | rest of the package from platform details. 3 | 4 | Code in the rest of the package includes "port.h" from this directory. 5 | "port.h" in turn includes a platform specific "port_.h" file 6 | that provides the platform specific implementation. 7 | 8 | See port_posix.h for an example of what must be provided in a platform 9 | specific header file. 10 | 11 | -------------------------------------------------------------------------------- /src/leveldb/port/port.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_PORT_H_ 6 | #define STORAGE_LEVELDB_PORT_PORT_H_ 7 | 8 | #include 9 | 10 | // Include the appropriate platform specific file below. If you are 11 | // porting to a new platform, see "port_example.h" for documentation 12 | // of what the new port_.h file must provide. 13 | #if defined(LEVELDB_PLATFORM_POSIX) 14 | # include "port/port_posix.h" 15 | #elif defined(LEVELDB_PLATFORM_CHROMIUM) 16 | # include "port/port_chromium.h" 17 | #elif defined(LEVELDB_PLATFORM_WINDOWS) 18 | # include "port/port_win.h" 19 | #endif 20 | 21 | #endif // STORAGE_LEVELDB_PORT_PORT_H_ 22 | -------------------------------------------------------------------------------- /src/leveldb/port/port_posix.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "port/port_posix.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include "util/logging.h" 11 | 12 | namespace leveldb { 13 | namespace port { 14 | 15 | static void PthreadCall(const char* label, int result) { 16 | if (result != 0) { 17 | fprintf(stderr, "pthread %s: %s\n", label, strerror(result)); 18 | abort(); 19 | } 20 | } 21 | 22 | Mutex::Mutex() { PthreadCall("init mutex", pthread_mutex_init(&mu_, NULL)); } 23 | 24 | Mutex::~Mutex() { PthreadCall("destroy mutex", pthread_mutex_destroy(&mu_)); } 25 | 26 | void Mutex::Lock() { PthreadCall("lock", pthread_mutex_lock(&mu_)); } 27 | 28 | void Mutex::Unlock() { PthreadCall("unlock", pthread_mutex_unlock(&mu_)); } 29 | 30 | CondVar::CondVar(Mutex* mu) 31 | : mu_(mu) { 32 | PthreadCall("init cv", pthread_cond_init(&cv_, NULL)); 33 | } 34 | 35 | CondVar::~CondVar() { PthreadCall("destroy cv", pthread_cond_destroy(&cv_)); } 36 | 37 | void CondVar::Wait() { 38 | PthreadCall("wait", pthread_cond_wait(&cv_, &mu_->mu_)); 39 | } 40 | 41 | void CondVar::Signal() { 42 | PthreadCall("signal", pthread_cond_signal(&cv_)); 43 | } 44 | 45 | void CondVar::SignalAll() { 46 | PthreadCall("broadcast", pthread_cond_broadcast(&cv_)); 47 | } 48 | 49 | void InitOnce(OnceType* once, void (*initializer)()) { 50 | PthreadCall("once", pthread_once(once, initializer)); 51 | } 52 | 53 | } // namespace port 54 | } // namespace leveldb 55 | -------------------------------------------------------------------------------- /src/leveldb/port/thread_annotations.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 6 | 7 | // Some environments provide custom macros to aid in static thread-safety 8 | // analysis. Provide empty definitions of such macros unless they are already 9 | // defined. 10 | 11 | #ifndef EXCLUSIVE_LOCKS_REQUIRED 12 | #define EXCLUSIVE_LOCKS_REQUIRED(...) 13 | #endif 14 | 15 | #ifndef SHARED_LOCKS_REQUIRED 16 | #define SHARED_LOCKS_REQUIRED(...) 17 | #endif 18 | 19 | #ifndef LOCKS_EXCLUDED 20 | #define LOCKS_EXCLUDED(...) 21 | #endif 22 | 23 | #ifndef LOCK_RETURNED 24 | #define LOCK_RETURNED(x) 25 | #endif 26 | 27 | #ifndef LOCKABLE 28 | #define LOCKABLE 29 | #endif 30 | 31 | #ifndef SCOPED_LOCKABLE 32 | #define SCOPED_LOCKABLE 33 | #endif 34 | 35 | #ifndef EXCLUSIVE_LOCK_FUNCTION 36 | #define EXCLUSIVE_LOCK_FUNCTION(...) 37 | #endif 38 | 39 | #ifndef SHARED_LOCK_FUNCTION 40 | #define SHARED_LOCK_FUNCTION(...) 41 | #endif 42 | 43 | #ifndef EXCLUSIVE_TRYLOCK_FUNCTION 44 | #define EXCLUSIVE_TRYLOCK_FUNCTION(...) 45 | #endif 46 | 47 | #ifndef SHARED_TRYLOCK_FUNCTION 48 | #define SHARED_TRYLOCK_FUNCTION(...) 49 | #endif 50 | 51 | #ifndef UNLOCK_FUNCTION 52 | #define UNLOCK_FUNCTION(...) 53 | #endif 54 | 55 | #ifndef NO_THREAD_SAFETY_ANALYSIS 56 | #define NO_THREAD_SAFETY_ANALYSIS 57 | #endif 58 | 59 | #endif // STORAGE_LEVELDB_PORT_THREAD_ANNOTATIONS_H 60 | -------------------------------------------------------------------------------- /src/leveldb/port/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /src/leveldb/table/block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_H_ 7 | 8 | #include 9 | #include 10 | #include "leveldb/iterator.h" 11 | 12 | namespace leveldb { 13 | 14 | struct BlockContents; 15 | class Comparator; 16 | 17 | class Block { 18 | public: 19 | // Initialize the block with the specified contents. 20 | explicit Block(const BlockContents& contents); 21 | 22 | ~Block(); 23 | 24 | size_t size() const { return size_; } 25 | Iterator* NewIterator(const Comparator* comparator); 26 | 27 | private: 28 | uint32_t NumRestarts() const; 29 | 30 | const char* data_; 31 | size_t size_; 32 | uint32_t restart_offset_; // Offset in data_ of restart array 33 | bool owned_; // Block owns data_[] 34 | 35 | // No copying allowed 36 | Block(const Block&); 37 | void operator=(const Block&); 38 | 39 | class Iter; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_ 45 | -------------------------------------------------------------------------------- /src/leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /src/leveldb/table/two_level_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 6 | #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 7 | 8 | #include "leveldb/iterator.h" 9 | 10 | namespace leveldb { 11 | 12 | struct ReadOptions; 13 | 14 | // Return a new two level iterator. A two-level iterator contains an 15 | // index iterator whose values point to a sequence of blocks where 16 | // each block is itself a sequence of key,value pairs. The returned 17 | // two-level iterator yields the concatenation of all key/value pairs 18 | // in the sequence of blocks. Takes ownership of "index_iter" and 19 | // will delete it when no longer needed. 20 | // 21 | // Uses a supplied function to convert an index_iter value into 22 | // an iterator over the contents of the corresponding block. 23 | extern Iterator* NewTwoLevelIterator( 24 | Iterator* index_iter, 25 | Iterator* (*block_function)( 26 | void* arg, 27 | const ReadOptions& options, 28 | const Slice& index_value), 29 | void* arg, 30 | const ReadOptions& options); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/util/crc32c.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_CRC32C_H_ 6 | #define STORAGE_LEVELDB_UTIL_CRC32C_H_ 7 | 8 | #include 9 | #include 10 | 11 | namespace leveldb { 12 | namespace crc32c { 13 | 14 | // Return the crc32c of concat(A, data[0,n-1]) where init_crc is the 15 | // crc32c of some string A. Extend() is often used to maintain the 16 | // crc32c of a stream of data. 17 | extern uint32_t Extend(uint32_t init_crc, const char* data, size_t n); 18 | 19 | // Return the crc32c of data[0,n-1] 20 | inline uint32_t Value(const char* data, size_t n) { 21 | return Extend(0, data, n); 22 | } 23 | 24 | static const uint32_t kMaskDelta = 0xa282ead8ul; 25 | 26 | // Return a masked representation of crc. 27 | // 28 | // Motivation: it is problematic to compute the CRC of a string that 29 | // contains embedded CRCs. Therefore we recommend that CRCs stored 30 | // somewhere (e.g., in files) should be masked before being stored. 31 | inline uint32_t Mask(uint32_t crc) { 32 | // Rotate right by 15 bits and add a constant. 33 | return ((crc >> 15) | (crc << 17)) + kMaskDelta; 34 | } 35 | 36 | // Return the crc whose masked representation is masked_crc. 37 | inline uint32_t Unmask(uint32_t masked_crc) { 38 | uint32_t rot = masked_crc - kMaskDelta; 39 | return ((rot >> 17) | (rot << 15)); 40 | } 41 | 42 | } // namespace crc32c 43 | } // namespace leveldb 44 | 45 | #endif // STORAGE_LEVELDB_UTIL_CRC32C_H_ 46 | -------------------------------------------------------------------------------- /src/leveldb/util/filter_policy.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/filter_policy.h" 6 | 7 | namespace leveldb { 8 | 9 | FilterPolicy::~FilterPolicy() { } 10 | 11 | } // namespace leveldb 12 | -------------------------------------------------------------------------------- /src/leveldb/util/hash.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include 6 | #include "util/coding.h" 7 | #include "util/hash.h" 8 | 9 | // The FALLTHROUGH_INTENDED macro can be used to annotate implicit fall-through 10 | // between switch labels. The real definition should be provided externally. 11 | // This one is a fallback version for unsupported compilers. 12 | #ifndef FALLTHROUGH_INTENDED 13 | #define FALLTHROUGH_INTENDED do { } while (0) 14 | #endif 15 | 16 | namespace leveldb { 17 | 18 | uint32_t Hash(const char* data, size_t n, uint32_t seed) { 19 | // Similar to murmur hash 20 | const uint32_t m = 0xc6a4a793; 21 | const uint32_t r = 24; 22 | const char* limit = data + n; 23 | uint32_t h = seed ^ (n * m); 24 | 25 | // Pick up four bytes at a time 26 | while (data + 4 <= limit) { 27 | uint32_t w = DecodeFixed32(data); 28 | data += 4; 29 | h += w; 30 | h *= m; 31 | h ^= (h >> 16); 32 | } 33 | 34 | // Pick up remaining bytes 35 | switch (limit - data) { 36 | case 3: 37 | h += data[2] << 16; 38 | FALLTHROUGH_INTENDED; 39 | case 2: 40 | h += data[1] << 8; 41 | FALLTHROUGH_INTENDED; 42 | case 1: 43 | h += data[0]; 44 | h *= m; 45 | h ^= (h >> r); 46 | break; 47 | } 48 | return h; 49 | } 50 | 51 | 52 | } // namespace leveldb 53 | -------------------------------------------------------------------------------- /src/leveldb/util/hash.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Simple hash function used for internal data structures 6 | 7 | #ifndef STORAGE_LEVELDB_UTIL_HASH_H_ 8 | #define STORAGE_LEVELDB_UTIL_HASH_H_ 9 | 10 | #include 11 | #include 12 | 13 | namespace leveldb { 14 | 15 | extern uint32_t Hash(const char* data, size_t n, uint32_t seed); 16 | 17 | } 18 | 19 | #endif // STORAGE_LEVELDB_UTIL_HASH_H_ 20 | -------------------------------------------------------------------------------- /src/leveldb/util/histogram.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 6 | #define STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 7 | 8 | #include 9 | 10 | namespace leveldb { 11 | 12 | class Histogram { 13 | public: 14 | Histogram() { } 15 | ~Histogram() { } 16 | 17 | void Clear(); 18 | void Add(double value); 19 | void Merge(const Histogram& other); 20 | 21 | std::string ToString() const; 22 | 23 | private: 24 | double min_; 25 | double max_; 26 | double num_; 27 | double sum_; 28 | double sum_squares_; 29 | 30 | enum { kNumBuckets = 154 }; 31 | static const double kBucketLimit[kNumBuckets]; 32 | double buckets_[kNumBuckets]; 33 | 34 | double Median() const; 35 | double Percentile(double p) const; 36 | double Average() const; 37 | double StandardDeviation() const; 38 | }; 39 | 40 | } // namespace leveldb 41 | 42 | #endif // STORAGE_LEVELDB_UTIL_HISTOGRAM_H_ 43 | -------------------------------------------------------------------------------- /src/leveldb/util/logging.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Must not be included from any .h files to avoid polluting the namespace 6 | // with macros. 7 | 8 | #ifndef STORAGE_LEVELDB_UTIL_LOGGING_H_ 9 | #define STORAGE_LEVELDB_UTIL_LOGGING_H_ 10 | 11 | #include 12 | #include 13 | #include 14 | #include "port/port.h" 15 | 16 | namespace leveldb { 17 | 18 | class Slice; 19 | class WritableFile; 20 | 21 | // Append a human-readable printout of "num" to *str 22 | extern void AppendNumberTo(std::string* str, uint64_t num); 23 | 24 | // Append a human-readable printout of "value" to *str. 25 | // Escapes any non-printable characters found in "value". 26 | extern void AppendEscapedStringTo(std::string* str, const Slice& value); 27 | 28 | // Return a human-readable printout of "num" 29 | extern std::string NumberToString(uint64_t num); 30 | 31 | // Return a human-readable version of "value". 32 | // Escapes any non-printable characters found in "value". 33 | extern std::string EscapeString(const Slice& value); 34 | 35 | // If *in starts with "c", advances *in past the first character and 36 | // returns true. Otherwise, returns false. 37 | extern bool ConsumeChar(Slice* in, char c); 38 | 39 | // Parse a human-readable number from "*in" into *value. On success, 40 | // advances "*in" past the consumed number and sets "*val" to the 41 | // numeric value. Otherwise, returns false and leaves *in in an 42 | // unspecified state. 43 | extern bool ConsumeDecimalNumber(Slice* in, uint64_t* val); 44 | 45 | } // namespace leveldb 46 | 47 | #endif // STORAGE_LEVELDB_UTIL_LOGGING_H_ 48 | -------------------------------------------------------------------------------- /src/leveldb/util/mutexlock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 6 | #define STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 7 | 8 | #include "port/port.h" 9 | #include "port/thread_annotations.h" 10 | 11 | namespace leveldb { 12 | 13 | // Helper class that locks a mutex on construction and unlocks the mutex when 14 | // the destructor of the MutexLock object is invoked. 15 | // 16 | // Typical usage: 17 | // 18 | // void MyClass::MyMethod() { 19 | // MutexLock l(&mu_); // mu_ is an instance variable 20 | // ... some complex code, possibly with multiple return paths ... 21 | // } 22 | 23 | class SCOPED_LOCKABLE MutexLock { 24 | public: 25 | explicit MutexLock(port::Mutex *mu) EXCLUSIVE_LOCK_FUNCTION(mu) 26 | : mu_(mu) { 27 | this->mu_->Lock(); 28 | } 29 | ~MutexLock() UNLOCK_FUNCTION() { this->mu_->Unlock(); } 30 | 31 | private: 32 | port::Mutex *const mu_; 33 | // No copying allowed 34 | MutexLock(const MutexLock&); 35 | void operator=(const MutexLock&); 36 | }; 37 | 38 | } // namespace leveldb 39 | 40 | 41 | #endif // STORAGE_LEVELDB_UTIL_MUTEXLOCK_H_ 42 | -------------------------------------------------------------------------------- /src/leveldb/util/options.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/options.h" 6 | 7 | #include "leveldb/comparator.h" 8 | #include "leveldb/env.h" 9 | 10 | namespace leveldb { 11 | 12 | Options::Options() 13 | : comparator(BytewiseComparator()), 14 | create_if_missing(false), 15 | error_if_exists(false), 16 | paranoid_checks(false), 17 | env(Env::Default()), 18 | info_log(NULL), 19 | write_buffer_size(4<<20), 20 | max_open_files(1000), 21 | block_cache(NULL), 22 | block_size(4096), 23 | block_restart_interval(16), 24 | compression(kSnappyCompression), 25 | filter_policy(NULL) { 26 | } 27 | 28 | 29 | } // namespace leveldb 30 | -------------------------------------------------------------------------------- /src/leveldb/util/testutil.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/testutil.h" 6 | 7 | #include "util/random.h" 8 | 9 | namespace leveldb { 10 | namespace test { 11 | 12 | Slice RandomString(Random* rnd, int len, std::string* dst) { 13 | dst->resize(len); 14 | for (int i = 0; i < len; i++) { 15 | (*dst)[i] = static_cast(' ' + rnd->Uniform(95)); // ' ' .. '~' 16 | } 17 | return Slice(*dst); 18 | } 19 | 20 | std::string RandomKey(Random* rnd, int len) { 21 | // Make sure to generate a wide variety of characters so we 22 | // test the boundary conditions for short-key optimizations. 23 | static const char kTestChars[] = { 24 | '\0', '\1', 'a', 'b', 'c', 'd', 'e', '\xfd', '\xfe', '\xff' 25 | }; 26 | std::string result; 27 | for (int i = 0; i < len; i++) { 28 | result += kTestChars[rnd->Uniform(sizeof(kTestChars))]; 29 | } 30 | return result; 31 | } 32 | 33 | 34 | extern Slice CompressibleString(Random* rnd, double compressed_fraction, 35 | size_t len, std::string* dst) { 36 | int raw = static_cast(len * compressed_fraction); 37 | if (raw < 1) raw = 1; 38 | std::string raw_data; 39 | RandomString(rnd, raw, &raw_data); 40 | 41 | // Duplicate the random data until we have filled "len" bytes 42 | dst->clear(); 43 | while (dst->size() < len) { 44 | dst->append(raw_data); 45 | } 46 | dst->resize(len); 47 | return Slice(*dst); 48 | } 49 | 50 | } // namespace test 51 | } // namespace leveldb 52 | -------------------------------------------------------------------------------- /src/lz4/LICENSE: -------------------------------------------------------------------------------- 1 | LZ4 Library 2 | Copyright (c) 2011-2014, Yann Collet 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without modification, 6 | are permitted provided that the following conditions are met: 7 | 8 | * Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | * Redistributions in binary form must reproduce the above copyright notice, this 12 | list of conditions and the following disclaimer in the documentation and/or 13 | other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 19 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 22 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /src/masternodeconfig.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "net.h" 3 | #include "masternodeconfig.h" 4 | #include "util.h" 5 | #include 6 | 7 | CMasternodeConfig masternodeConfig; 8 | 9 | void CMasternodeConfig::add(std::string alias, std::string ip, std::string privKey, std::string txHash, std::string outputIndex) { 10 | CMasternodeEntry cme(alias, ip, privKey, txHash, outputIndex); 11 | entries.push_back(cme); 12 | } 13 | 14 | bool CMasternodeConfig::read(boost::filesystem::path path) { 15 | boost::filesystem::ifstream streamConfig(GetMasternodeConfigFile()); 16 | if (!streamConfig.good()) { 17 | return true; // No masternode.conf file is OK 18 | } 19 | 20 | for(std::string line; std::getline(streamConfig, line); ) 21 | { 22 | if(line.empty()) { 23 | continue; 24 | } 25 | std::istringstream iss(line); 26 | std::string alias, ip, privKey, txHash, outputIndex; 27 | iss.str(line); 28 | iss.clear(); 29 | if (!(iss >> alias >> ip >> privKey >> txHash >> outputIndex)) { 30 | LogPrintf("Could not parse masternode.conf line: %s\n", line.c_str()); 31 | streamConfig.close(); 32 | return false; 33 | } 34 | 35 | add(alias, ip, privKey, txHash, outputIndex); 36 | } 37 | 38 | streamConfig.close(); 39 | return true; 40 | } 41 | -------------------------------------------------------------------------------- /src/miner.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Copyright (c) 2013 The NovaCoin developers 4 | // Distributed under the MIT/X11 software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | #ifndef NOVACOIN_MINER_H 7 | #define NOVACOIN_MINER_H 8 | 9 | #include "main.h" 10 | #include "wallet.h" 11 | 12 | /* Generate a new block, without valid proof-of-work */ 13 | CBlock* CreateNewBlock(CReserveKey& reservekey, bool fProofOfStake=false, int64_t* pFees = 0); 14 | 15 | /** Modify the extranonce in a block */ 16 | void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce); 17 | 18 | /** Do mining precalculation */ 19 | void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash1); 20 | 21 | /** Check mined proof-of-work block */ 22 | bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey); 23 | 24 | /** Check mined proof-of-stake block */ 25 | bool CheckStake(CBlock* pblock, CWallet& wallet); 26 | 27 | /** Base sha256 mining transform */ 28 | void SHA256Transform(void* pstate, void* pinput, const void* pinit); 29 | 30 | #endif // NOVACOIN_MINER_H 31 | -------------------------------------------------------------------------------- /src/noui.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "ui_interface.h" 7 | #include "init.h" 8 | 9 | #include 10 | 11 | static int noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, unsigned int style) 12 | { 13 | std::string strCaption; 14 | // Check for usage of predefined caption 15 | switch (style) { 16 | case CClientUIInterface::MSG_ERROR: 17 | strCaption += _("Error"); 18 | break; 19 | case CClientUIInterface::MSG_WARNING: 20 | strCaption += _("Warning"); 21 | break; 22 | case CClientUIInterface::MSG_INFORMATION: 23 | strCaption += _("Information"); 24 | break; 25 | default: 26 | strCaption += caption; // Use supplied caption 27 | } 28 | 29 | LogPrintf("%s: %s\n", caption, message); 30 | fprintf(stderr, "%s: %s\n", strCaption.c_str(), message.c_str()); 31 | return 4; 32 | } 33 | 34 | static bool noui_ThreadSafeAskFee(int64_t nFeeRequired, const std::string& strCaption) 35 | { 36 | return true; 37 | } 38 | 39 | static void noui_InitMessage(const std::string &message) 40 | { 41 | LogPrintf("init message: %s\n", message); 42 | } 43 | 44 | void noui_connect() 45 | { 46 | // Connect bitcoind signal handlers 47 | uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox); 48 | uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee); 49 | uiInterface.InitMessage.connect(noui_InitMessage); 50 | } 51 | -------------------------------------------------------------------------------- /src/obj-test/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/obj/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !support 3 | !crypto 4 | !.gitignore 5 | -------------------------------------------------------------------------------- /src/obj/crypto/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/obj/support/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/pbkdf2.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 NovaCoin Developers 2 | 3 | #ifndef PBKDF2_H 4 | #define PBKDF2_H 5 | 6 | #include 7 | #include 8 | 9 | typedef struct HMAC_SHA256Context { 10 | SHA256_CTX ictx; 11 | SHA256_CTX octx; 12 | } HMAC_SHA256_CTX; 13 | 14 | void 15 | HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen); 16 | 17 | void 18 | HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void *in, size_t len); 19 | 20 | void 21 | HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX * ctx); 22 | 23 | void 24 | PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, 25 | size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen); 26 | 27 | #endif // PBKDF2_H 28 | -------------------------------------------------------------------------------- /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/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/addeditadrenalinenode.h: -------------------------------------------------------------------------------- 1 | #ifndef ADDEDITADRENALINENODE_H 2 | #define ADDEDITADRENALINENODE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace Ui { 9 | class AddEditAdrenalineNode; 10 | } 11 | 12 | 13 | class AddEditAdrenalineNode : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit AddEditAdrenalineNode(QWidget *parent = 0); 19 | ~AddEditAdrenalineNode(); 20 | 21 | protected: 22 | 23 | private slots: 24 | void on_okButton_clicked(); 25 | void on_cancelButton_clicked(); 26 | void on_AddEditAddressPasteButton_clicked(); 27 | void on_AddEditPrivkeyPasteButton_clicked(); 28 | void on_AddEditTxhashPasteButton_clicked(); 29 | 30 | signals: 31 | 32 | private: 33 | Ui::AddEditAdrenalineNode *ui; 34 | }; 35 | 36 | #endif // ADDEDITADRENALINENODE_H 37 | -------------------------------------------------------------------------------- /src/qt/adrenalinenodeconfigdialog.cpp: -------------------------------------------------------------------------------- 1 | #include "adrenalinenodeconfigdialog.h" 2 | #include "ui_adrenalinenodeconfigdialog.h" 3 | 4 | #include 5 | 6 | AdrenalineNodeConfigDialog::AdrenalineNodeConfigDialog(QWidget *parent, QString nodeAddress, QString privkey) : 7 | QDialog(parent), 8 | ui(new Ui::AdrenalineNodeConfigDialog) 9 | { 10 | ui->setupUi(this); 11 | QString desc = "rpcallowip=127.0.0.1
rpcuser=REPLACEME
rpcpassword=REPLACEME
server=1
listen=1
port=REPLACEMEWITHYOURPORT
masternode=1
masternodeaddr=" + nodeAddress + "
masternodeprivkey=" + privkey + "
"; 12 | ui->detailText->setHtml(desc); 13 | } 14 | 15 | AdrenalineNodeConfigDialog::~AdrenalineNodeConfigDialog() 16 | { 17 | delete ui; 18 | } 19 | -------------------------------------------------------------------------------- /src/qt/adrenalinenodeconfigdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ADRENALINENODECONFIGDIALOG_H 2 | #define ADRENALINENODECONFIGDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AdrenalineNodeConfigDialog; 8 | } 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QModelIndex; 12 | QT_END_NAMESPACE 13 | 14 | /** Dialog showing transaction details. */ 15 | class AdrenalineNodeConfigDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit AdrenalineNodeConfigDialog(QWidget *parent = 0, QString nodeAddress = "123.456.789.123:9999", QString privkey="MASTERNODEPRIVKEY"); 21 | ~AdrenalineNodeConfigDialog(); 22 | 23 | private: 24 | Ui::AdrenalineNodeConfigDialog *ui; 25 | }; 26 | 27 | #endif // ADRENALINENODECONFIGDIALOG_H 28 | -------------------------------------------------------------------------------- /src/qt/askpassphrasedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ASKPASSPHRASEDIALOG_H 2 | #define ASKPASSPHRASEDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AskPassphraseDialog; 8 | } 9 | class WalletModel; 10 | 11 | /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. 12 | */ 13 | class AskPassphraseDialog : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | enum Mode { 19 | Encrypt, /**< Ask passphrase twice and encrypt */ 20 | UnlockStaking, /**< Ask passphrase and unlock */ 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 | 42 | protected: 43 | bool event(QEvent *event); 44 | bool eventFilter(QObject *, QEvent *event); 45 | void secureClearPassFields(); 46 | }; 47 | 48 | #endif // ASKPASSPHRASEDIALOG_H 49 | -------------------------------------------------------------------------------- /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 | 13 | public: 14 | explicit BitcoinAddressValidator(QObject *parent = 0); 15 | 16 | State validate(QString &input, int &pos) const; 17 | 18 | static const int MaxAddressLength = 128; 19 | }; 20 | 21 | #endif // BITCOINADDRESSVALIDATOR_H 22 | -------------------------------------------------------------------------------- /src/qt/blockbrowser.h: -------------------------------------------------------------------------------- 1 | #ifndef BLOCKBROWSER_H 2 | #define BLOCKBROWSER_H 3 | 4 | #include "clientmodel.h" 5 | #include "walletmodel.h" 6 | #include "main.h" 7 | #include "wallet.h" 8 | #include "base58.h" 9 | #include 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | double getBlockHardness(int); 22 | double getTxTotalValue(std::string); 23 | double convertCoins(int64_t); 24 | double getTxFees(std::string); 25 | int getBlockTime(int); 26 | int getBlocknBits(int); 27 | int getBlockNonce(int); 28 | int blocksInPastHours(int); 29 | int getBlockHashrate(int); 30 | std::string getInputs(std::string); 31 | std::string getOutputs(std::string); 32 | std::string getBlockHash(int); 33 | std::string getBlockMerkle(int); 34 | bool addnode(std::string); 35 | const CBlockIndex* getBlockIndex(int); 36 | int64_t getInputValue(CTransaction, CScript); 37 | 38 | 39 | namespace Ui { 40 | class BlockBrowser; 41 | } 42 | class WalletModel; 43 | 44 | class BlockBrowser : public QWidget 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | explicit BlockBrowser(QWidget *parent = 0); 50 | ~BlockBrowser(); 51 | 52 | void setModel(WalletModel *model); 53 | 54 | public slots: 55 | 56 | void blockClicked(); 57 | void txClicked(); 58 | void updateExplorer(bool); 59 | 60 | private slots: 61 | 62 | private: 63 | Ui::BlockBrowser *ui; 64 | WalletModel *model; 65 | 66 | }; 67 | 68 | #endif // BLOCKBROWSER_H -------------------------------------------------------------------------------- /src/qt/coincontroltreewidget.cpp: -------------------------------------------------------------------------------- 1 | #include "coincontroltreewidget.h" 2 | #include "coincontroldialog.h" 3 | 4 | CoinControlTreeWidget::CoinControlTreeWidget(QWidget *parent) : 5 | QTreeWidget(parent) 6 | { 7 | 8 | } 9 | 10 | void CoinControlTreeWidget::keyPressEvent(QKeyEvent *event) 11 | { 12 | if (event->key() == Qt::Key_Space) // press spacebar -> select checkbox 13 | { 14 | event->ignore(); 15 | int COLUMN_CHECKBOX = 0; 16 | this->currentItem()->setCheckState(COLUMN_CHECKBOX, ((this->currentItem()->checkState(COLUMN_CHECKBOX) == Qt::Checked) ? Qt::Unchecked : Qt::Checked)); 17 | } 18 | else if (event->key() == Qt::Key_Escape) // press esc -> close dialog 19 | { 20 | event->ignore(); 21 | CoinControlDialog *coinControlDialog = (CoinControlDialog*)this->parentWidget(); 22 | coinControlDialog->done(QDialog::Accepted); 23 | } 24 | else 25 | { 26 | this->QTreeWidget::keyPressEvent(event); 27 | } 28 | } -------------------------------------------------------------------------------- /src/qt/coincontroltreewidget.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROLTREEWIDGET_H 2 | #define COINCONTROLTREEWIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class CoinControlTreeWidget : public QTreeWidget { 8 | Q_OBJECT 9 | 10 | public: 11 | explicit CoinControlTreeWidget(QWidget *parent = 0); 12 | 13 | protected: 14 | virtual void keyPressEvent(QKeyEvent *event); 15 | }; 16 | 17 | #endif // COINCONTROLTREEWIDGET_H -------------------------------------------------------------------------------- /src/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 | 18 | public: 19 | explicit CSVModelWriter(const QString &filename, QObject *parent = 0); 20 | 21 | void setModel(const QAbstractItemModel *model); 22 | void addColumn(const QString &title, int column, int role=Qt::EditRole); 23 | 24 | /** Perform export of the model to CSV. 25 | @returns true on success, false otherwise 26 | */ 27 | bool write(); 28 | 29 | private: 30 | QString filename; 31 | const QAbstractItemModel *model; 32 | 33 | struct Column 34 | { 35 | QString title; 36 | int column; 37 | int role; 38 | }; 39 | QList columns; 40 | }; 41 | 42 | #endif // CSVMODELWRITER_H 43 | -------------------------------------------------------------------------------- /src/qt/darksendconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef DARKSENDCONFIG_H 2 | #define DARKSENDCONFIG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class DarksendConfig; 8 | } 9 | class WalletModel; 10 | 11 | /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. 12 | */ 13 | class DarksendConfig : public QDialog 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | 19 | DarksendConfig(QWidget *parent = 0); 20 | ~DarksendConfig(); 21 | 22 | void setModel(WalletModel *model); 23 | 24 | 25 | private: 26 | Ui::DarksendConfig *ui; 27 | WalletModel *model; 28 | void configure(bool enabled, int coins, int rounds); 29 | 30 | private slots: 31 | 32 | void clickBasic(); 33 | void clickHigh(); 34 | void clickMax(); 35 | }; 36 | 37 | #endif // DARKSENDCONFIG_H 38 | -------------------------------------------------------------------------------- /src/qt/editaddressdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITADDRESSDIALOG_H 2 | #define EDITADDRESSDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class EditAddressDialog; 8 | } 9 | class AddressTableModel; 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QDataWidgetMapper; 13 | QT_END_NAMESPACE 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 | QString getAddress() const; 36 | void setAddress(const QString &address); 37 | private slots: 38 | void on_EditAddressPasteButton_clicked(); 39 | 40 | public slots: 41 | void accept(); 42 | 43 | private: 44 | bool saveCurrentRow(); 45 | 46 | Ui::EditAddressDialog *ui; 47 | QDataWidgetMapper *mapper; 48 | Mode mode; 49 | AddressTableModel *model; 50 | 51 | QString address; 52 | }; 53 | 54 | #endif // EDITADDRESSDIALOG_H 55 | -------------------------------------------------------------------------------- /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 = 250; 6 | 7 | /* AskPassphraseDialog -- Maximum passphrase length */ 8 | static const int MAX_PASSPHRASE_SIZE = 1024; 9 | 10 | /* BitcoinGUI -- 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 | /* Tooltips longer than this (in characters) are converted into rich text, 24 | so that they can be word-wrapped. 25 | */ 26 | static const int TOOLTIP_WRAP_THRESHOLD = 80; 27 | 28 | /* Maximum allowed URI length */ 29 | static const int MAX_URI_LENGTH = 255; 30 | 31 | /* QRCodeDialog -- size of exported QR Code image */ 32 | #define EXPORT_IMAGE_SIZE 256 33 | 34 | #endif // GUICONSTANTS_H 35 | -------------------------------------------------------------------------------- /src/qt/macdockiconhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MACDOCKICONHANDLER_H 2 | #define MACDOCKICONHANDLER_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QIcon; 9 | class QMenu; 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/macnotificationhandler.h: -------------------------------------------------------------------------------- 1 | #ifndef MACNOTIFICATIONHANDLER_H 2 | #define MACNOTIFICATIONHANDLER_H 3 | #include 4 | 5 | /** Macintosh-specific notification handler (supports UserNotificationCenter). 6 | */ 7 | class MacNotificationHandler : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | /** shows a 10.8+ UserNotification in the UserNotificationCenter 13 | */ 14 | void showNotification(const QString &title, const QString &text); 15 | 16 | /** executes AppleScript */ 17 | void sendAppleScript(const QString &script); 18 | 19 | /** check if OS can handle UserNotifications */ 20 | bool hasUserNotificationCenterSupport(void); 21 | static MacNotificationHandler *instance(); 22 | }; 23 | 24 | 25 | #endif // MACNOTIFICATIONHANDLER_H 26 | -------------------------------------------------------------------------------- /src/qt/masternodemanager.h: -------------------------------------------------------------------------------- 1 | #ifndef MASTERNODEMANAGER_H 2 | #define MASTERNODEMANAGER_H 3 | 4 | #include "util.h" 5 | #include "sync.h" 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #define MASTERNODELIST_UPDATE_SECONDS 15 12 | #define MASTERNODELIST_FILTER_COOLDOWN_SECONDS 3 13 | 14 | namespace Ui { 15 | class MasternodeManager; 16 | 17 | } 18 | class ClientModel; 19 | class WalletModel; 20 | 21 | QT_BEGIN_NAMESPACE 22 | class QModelIndex; 23 | QT_END_NAMESPACE 24 | 25 | /** Masternode Manager page widget */ 26 | class MasternodeManager : public QWidget 27 | { 28 | Q_OBJECT 29 | 30 | public: 31 | explicit MasternodeManager(QWidget *parent = 0); 32 | ~MasternodeManager(); 33 | 34 | void setClientModel(ClientModel *clientModel); 35 | void setWalletModel(WalletModel *walletModel); 36 | 37 | void updateListConc(); 38 | 39 | 40 | public slots: 41 | void updateNodeList(); 42 | void updateAdrenalineNode(QString alias, QString addr, QString privkey, QString txHash, QString txIndex, QString status); 43 | void on_UpdateButton_clicked(); 44 | 45 | signals: 46 | 47 | private: 48 | QTimer *timer; 49 | Ui::MasternodeManager *ui; 50 | ClientModel *clientModel; 51 | WalletModel *walletModel; 52 | CCriticalSection cs_adrenaline; 53 | int64_t nTimeFilterUpdated; 54 | bool fFilterUpdated; 55 | QFuture f1; 56 | 57 | private slots: 58 | void on_createButton_clicked(); 59 | void on_startButton_clicked(); 60 | void on_startAllButton_clicked(); 61 | void on_tableWidget_2_itemSelectionChanged(); 62 | }; 63 | #endif // MASTERNODEMANAGER_H 64 | -------------------------------------------------------------------------------- /src/qt/messagepage.h: -------------------------------------------------------------------------------- 1 | #ifndef MESSAGEPAGE_H 2 | #define MESSAGEPAGE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class MessagePage; 8 | } 9 | class MessageModel; 10 | //class OptionsModel; 11 | 12 | QT_BEGIN_NAMESPACE 13 | class QTableView; 14 | class QItemSelection; 15 | class QSortFilterProxyModel; 16 | class QMenu; 17 | class QModelIndex; 18 | class MessageViewDelegate; 19 | class MRichTextEdit; 20 | QT_END_NAMESPACE 21 | 22 | 23 | /** Widget that shows a list of sending or receiving addresses. 24 | */ 25 | class MessagePage : public QWidget 26 | { 27 | Q_OBJECT 28 | 29 | public: 30 | 31 | explicit MessagePage(QWidget *parent = 0); 32 | ~MessagePage(); 33 | 34 | void setModel(MessageModel *model); 35 | 36 | private: 37 | void setupTextActions(); 38 | 39 | public slots: 40 | void exportClicked(); 41 | 42 | private: 43 | Ui::MessagePage *ui; 44 | MessageModel *model; 45 | 46 | QMenu *contextMenu; 47 | QAction *replyAction; 48 | QAction *copyFromAddressAction; 49 | QAction *copyToAddressAction; 50 | QAction *deleteAction; 51 | QString replyFromAddress; 52 | QString replyToAddress; 53 | MessageViewDelegate *msgdelegate; 54 | MRichTextEdit *messageTextEdit; 55 | 56 | private slots: 57 | void on_sendButton_clicked(); 58 | void on_newButton_clicked(); 59 | void on_copyFromAddressButton_clicked(); 60 | void on_copyToAddressButton_clicked(); 61 | void on_deleteButton_clicked(); 62 | void on_backButton_clicked(); 63 | void messageTextChanged(); 64 | void selectionChanged(); 65 | void itemSelectionChanged(); 66 | void incomingMessage(); 67 | /** Spawn contextual menu (right mouse menu) for address book entry */ 68 | void contextualMenu(const QPoint &point); 69 | 70 | signals: 71 | }; 72 | 73 | #endif // MESSAGEPAGE_H 74 | -------------------------------------------------------------------------------- /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 | void MonitoredDataMapper::addMapping(QWidget *widget, int section) 13 | { 14 | QDataWidgetMapper::addMapping(widget, section); 15 | addChangeMonitor(widget); 16 | } 17 | 18 | void MonitoredDataMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName) 19 | { 20 | QDataWidgetMapper::addMapping(widget, section, propertyName); 21 | addChangeMonitor(widget); 22 | } 23 | 24 | void MonitoredDataMapper::addChangeMonitor(QWidget *widget) 25 | { 26 | // Watch user property of widget for changes, and connect 27 | // the signal to our viewModified signal. 28 | QMetaProperty prop = widget->metaObject()->userProperty(); 29 | int signal = prop.notifySignalIndex(); 30 | int method = this->metaObject()->indexOfMethod("viewModified()"); 31 | if(signal != -1 && method != -1) 32 | { 33 | QMetaObject::connect(widget, signal, this, method); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /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 | 17 | public: 18 | explicit MonitoredDataMapper(QObject *parent=0); 19 | 20 | void addMapping(QWidget *widget, int section); 21 | void addMapping(QWidget *widget, int section, const QByteArray &propertyName); 22 | 23 | private: 24 | void addChangeMonitor(QWidget *widget); 25 | 26 | signals: 27 | void viewModified(); 28 | }; 29 | 30 | #endif // MONITOREDDATAMAPPER_H 31 | -------------------------------------------------------------------------------- /src/qt/optionsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef OPTIONSDIALOG_H 2 | #define OPTIONSDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class OptionsDialog; 8 | } 9 | class OptionsModel; 10 | class MonitoredDataMapper; 11 | class QValidatedLineEdit; 12 | 13 | /** Preferences dialog. */ 14 | class OptionsDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit OptionsDialog(QWidget *parent = 0); 20 | ~OptionsDialog(); 21 | 22 | void setModel(OptionsModel *model); 23 | void setMapper(); 24 | 25 | protected: 26 | bool eventFilter(QObject *object, QEvent *event); 27 | 28 | private slots: 29 | /* enable only apply button */ 30 | void enableApplyButton(); 31 | /* disable only apply button */ 32 | void disableApplyButton(); 33 | /* enable apply button and OK button */ 34 | void enableSaveButtons(); 35 | /* disable apply button and OK button */ 36 | void disableSaveButtons(); 37 | /* set apply button and OK button state (enabled / disabled) */ 38 | void setSaveButtonState(bool fState); 39 | void on_okButton_clicked(); 40 | void on_cancelButton_clicked(); 41 | void on_applyButton_clicked(); 42 | 43 | void showRestartWarning_Proxy(); 44 | void showRestartWarning_Lang(); 45 | void updateDisplayUnit(); 46 | void handleProxyIpValid(QValidatedLineEdit *object, bool fState); 47 | 48 | signals: 49 | void proxyIpValid(QValidatedLineEdit *object, bool fValid); 50 | 51 | private: 52 | Ui::OptionsDialog *ui; 53 | OptionsModel *model; 54 | MonitoredDataMapper *mapper; 55 | bool fRestartWarningDisplayed_Proxy; 56 | bool fRestartWarningDisplayed_Lang; 57 | bool fProxyIpValid; 58 | }; 59 | 60 | #endif // OPTIONSDIALOG_H 61 | -------------------------------------------------------------------------------- /src/qt/plugins/mrichtexteditor/LGPL_EXCEPTION.txt: -------------------------------------------------------------------------------- 1 | Digia Qt LGPL Exception version 1.1 2 | 3 | As an additional permission to the GNU Lesser General Public License version 4 | 2.1, the object code form of a "work that uses the Library" may incorporate 5 | material from a header file that is part of the Library. You may distribute 6 | such object code under terms of your choice, provided that: 7 | (i) the header files of the Library have not been modified; and 8 | (ii) the incorporated material is limited to numerical parameters, data 9 | structure layouts, accessors, macros, inline functions and 10 | templates; and 11 | (iii) you comply with the terms of Section 6 of the GNU Lesser General 12 | Public License version 2.1. 13 | 14 | Moreover, you may apply this exception to a modified version of the Library, 15 | provided that such modification does not involve copying material from the 16 | Library into the modified Library's header files unless such material is 17 | limited to (i) numerical parameters; (ii) data structure layouts; 18 | (iii) accessors; and (iv) small macros, templates and inline functions of 19 | five lines or less in length. 20 | 21 | Furthermore, you are not required to apply this additional permission to a 22 | modified version of the Library. 23 | 24 | -------------------------------------------------------------------------------- /src/qt/plugins/mrichtexteditor/README.md: -------------------------------------------------------------------------------- 1 | # MRichTextEdit 2 | 3 | A simple Qt rich-text editor widget, easy to use in any Qt project. 4 | 5 | ![Screenshot](https://github.com/Anchakor/MRichTextEditor/raw/master/example.png) 6 | 7 | The icons used are standard icons from theme as defined by [freedesktop.org Icon Naming Specification](http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html) (which lacks button/ordered list icons). 8 | 9 | The editor automatically converts plain text http(s) links and emails to html links in toHtml(). 10 | 11 | Courtesy of [Hobrasoft](http://www.hobrasoft.cz/). 12 | -------------------------------------------------------------------------------- /src/qt/plugins/mrichtexteditor/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/plugins/mrichtexteditor/example.png -------------------------------------------------------------------------------- /src/qt/qrcodedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef QRCODEDIALOG_H 2 | #define QRCODEDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class QRCodeDialog; 9 | } 10 | class OptionsModel; 11 | 12 | class QRCodeDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit QRCodeDialog(const QString &addr, const QString &label, bool enableReq, QWidget *parent = 0); 18 | ~QRCodeDialog(); 19 | 20 | void setModel(OptionsModel *model); 21 | 22 | private slots: 23 | void on_lnReqAmount_textChanged(); 24 | void on_lnLabel_textChanged(); 25 | void on_lnMessage_textChanged(); 26 | void on_btnSaveAs_clicked(); 27 | void on_chkReqPayment_toggled(bool fChecked); 28 | 29 | void updateDisplayUnit(); 30 | 31 | private: 32 | Ui::QRCodeDialog *ui; 33 | OptionsModel *model; 34 | QString address; 35 | QImage myImage; 36 | 37 | void genCode(); 38 | QString getURI(); 39 | }; 40 | 41 | #endif // QRCODEDIALOG_H 42 | -------------------------------------------------------------------------------- /src/qt/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/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 | 13 | public: 14 | explicit QValidatedLineEdit(QWidget *parent = 0); 15 | void clear(); 16 | 17 | protected: 18 | void focusInEvent(QFocusEvent *evt); 19 | 20 | private: 21 | bool valid; 22 | 23 | public slots: 24 | void setValid(bool valid); 25 | 26 | private slots: 27 | void markValid(); 28 | }; 29 | 30 | #endif // QVALIDATEDLINEEDIT_H 31 | -------------------------------------------------------------------------------- /src/qt/qvalidatedtextedit.cpp: -------------------------------------------------------------------------------- 1 | #include "qvalidatedtextedit.h" 2 | 3 | #include "guiconstants.h" 4 | 5 | #include 6 | QValidatedTextEdit::QValidatedTextEdit(QWidget *parent) : 7 | QPlainTextEdit(parent), valid(true) 8 | {} 9 | 10 | void QValidatedTextEdit::setValid(bool valid) 11 | { 12 | setStyleSheet(valid ? "" : STYLE_INVALID); 13 | 14 | if(valid) 15 | { 16 | if(toPlainText() == this->errorText) 17 | setPlainText(""); 18 | } 19 | else if(toPlainText() == "") 20 | setPlainText(this->errorText); 21 | } 22 | 23 | void QValidatedTextEdit::setErrorText(QString errorText) 24 | { 25 | this->errorText = errorText; 26 | } 27 | 28 | void QValidatedTextEdit::focusInEvent(QFocusEvent *evt) 29 | { 30 | // Clear invalid flag on focus 31 | setValid(true); 32 | QPlainTextEdit::focusInEvent(evt); 33 | } 34 | 35 | void QValidatedTextEdit::markValid() 36 | { 37 | setValid(true); 38 | } 39 | 40 | void QValidatedTextEdit::clear() 41 | { 42 | setValid(true); 43 | QPlainTextEdit::clear(); 44 | } 45 | -------------------------------------------------------------------------------- /src/qt/qvalidatedtextedit.h: -------------------------------------------------------------------------------- 1 | #ifndef QVALIDATEDTEXTEDIT_H 2 | #define QVALIDATEDTEXTEDIT_H 3 | 4 | #include 5 | 6 | /** Text 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 QValidatedTextEdit : public QPlainTextEdit 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit QValidatedTextEdit(QWidget *parent = 0); 14 | void clear(); 15 | 16 | protected: 17 | void focusInEvent(QFocusEvent *evt); 18 | 19 | private: 20 | bool valid; 21 | QString errorText; 22 | 23 | public slots: 24 | void setValid(bool valid); 25 | void setErrorText(QString errorText); 26 | 27 | private slots: 28 | void markValid(); 29 | }; 30 | 31 | #endif // QVALIDATEDTEXTEDIT_H 32 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.cpp: -------------------------------------------------------------------------------- 1 | #include "qvaluecombobox.h" 2 | 3 | #include 4 | 5 | QValueComboBox::QValueComboBox(QWidget *parent) : 6 | QComboBox(parent), role(Qt::UserRole) 7 | { 8 | setItemDelegate(new QStyledItemDelegate()); 9 | 10 | connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int))); 11 | } 12 | 13 | QVariant QValueComboBox::value() const 14 | { 15 | return itemData(currentIndex(), role); 16 | } 17 | 18 | void QValueComboBox::setValue(const QVariant &value) 19 | { 20 | setCurrentIndex(findData(value, role)); 21 | } 22 | 23 | void QValueComboBox::setRole(int role) 24 | { 25 | this->role = role; 26 | } 27 | 28 | void QValueComboBox::handleSelectionChanged(int idx) 29 | { 30 | emit valueChanged(); 31 | } 32 | -------------------------------------------------------------------------------- /src/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 | 12 | Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) 13 | 14 | public: 15 | explicit QValueComboBox(QWidget *parent = 0); 16 | 17 | QVariant value() const; 18 | void setValue(const QVariant &value); 19 | 20 | /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */ 21 | void setRole(int role); 22 | 23 | signals: 24 | void valueChanged(); 25 | 26 | private: 27 | int role; 28 | 29 | private slots: 30 | void handleSelectionChanged(int idx); 31 | }; 32 | 33 | #endif // QVALUECOMBOBOX_H 34 | -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin-128.png -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin-16.png -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin-256.png -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin.icns -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin.ico -------------------------------------------------------------------------------- /src/qt/res/icons/ExclusiveCoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/ExclusiveCoin.png -------------------------------------------------------------------------------- /src/qt/res/icons/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/Thumbs.db -------------------------------------------------------------------------------- /src/qt/res/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/add.png -------------------------------------------------------------------------------- /src/qt/res/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/address-book.png -------------------------------------------------------------------------------- /src/qt/res/icons/bitcoin_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/bitcoin_testnet.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/Thumbs.db -------------------------------------------------------------------------------- /src/qt/res/icons/black/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/staking_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/staking_off.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/staking_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/staking_on.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/synced.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/icons/black/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/black/tx_output.png -------------------------------------------------------------------------------- /src/qt/res/icons/block.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/block.png -------------------------------------------------------------------------------- /src/qt/res/icons/browse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/browse.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/clock1.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/clock2.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/clock3.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/clock4.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/clock5.png -------------------------------------------------------------------------------- /src/qt/res/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/configure.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/debugwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/debugwindow.png -------------------------------------------------------------------------------- /src/qt/res/icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/edit.png -------------------------------------------------------------------------------- /src/qt/res/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/editcopy.png -------------------------------------------------------------------------------- /src/qt/res/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/editpaste.png -------------------------------------------------------------------------------- /src/qt/res/icons/exclusivecoin-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/exclusivecoin-16.png -------------------------------------------------------------------------------- /src/qt/res/icons/exclusivecoin-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/exclusivecoin-80.png -------------------------------------------------------------------------------- /src/qt/res/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/export.png -------------------------------------------------------------------------------- /src/qt/res/icons/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/eye.png -------------------------------------------------------------------------------- /src/qt/res/icons/eye_minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/eye_minus.png -------------------------------------------------------------------------------- /src/qt/res/icons/eye_plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/eye_plus.png -------------------------------------------------------------------------------- /src/qt/res/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/filesave.png -------------------------------------------------------------------------------- /src/qt/res/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/history.png -------------------------------------------------------------------------------- /src/qt/res/icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/key.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/icons/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/icons/onion-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/onion-black.png -------------------------------------------------------------------------------- /src/qt/res/icons/onion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/onion.png -------------------------------------------------------------------------------- /src/qt/res/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/overview.png -------------------------------------------------------------------------------- /src/qt/res/icons/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/qrcode.png -------------------------------------------------------------------------------- /src/qt/res/icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/quit.png -------------------------------------------------------------------------------- /src/qt/res/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/receive.png -------------------------------------------------------------------------------- /src/qt/res/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/remove.png -------------------------------------------------------------------------------- /src/qt/res/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/send.png -------------------------------------------------------------------------------- /src/qt/res/icons/staking_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/staking_off.png -------------------------------------------------------------------------------- /src/qt/res/icons/staking_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/staking_on.png -------------------------------------------------------------------------------- /src/qt/res/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/synced.png -------------------------------------------------------------------------------- /src/qt/res/icons/trade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/trade.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/transaction0.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/transaction2.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction_conflicted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/transaction_conflicted.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/icons/tx_output.png -------------------------------------------------------------------------------- /src/qt/res/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/images/about.png -------------------------------------------------------------------------------- /src/qt/res/images/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/images/header.png -------------------------------------------------------------------------------- /src/qt/res/images/splash2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/images/splash2.jpg -------------------------------------------------------------------------------- /src/qt/res/images/splash2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/images/splash2.png -------------------------------------------------------------------------------- /src/qt/res/images/splash3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/images/splash3.png -------------------------------------------------------------------------------- /src/qt/res/movies/update_spinner.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/movies/update_spinner.mng -------------------------------------------------------------------------------- /src/qt/res/movies/update_spinner_black.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/movies/update_spinner_black.mng -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/add.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/address-book.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/clock1.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/clock2.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/clock3.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/clock4.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/clock5.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/configure.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/debugwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/debugwindow.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/edit.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/editcopy.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/editpaste.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/exclusivecoin_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/exclusivecoin_512x512.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/export.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/filesave.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/history.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/key.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/mining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/mining.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/mining_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/mining_active.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/mining_inactive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/mining_inactive.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/overview.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/photothumb.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/photothumb.db -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/qrcode.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/quit.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/receive.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/remove.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/send.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/staking_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/staking_off.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/staking_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/staking_on.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/synced.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/transaction0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/transaction0.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/transaction2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/transaction2.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/transaction_conflicted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/transaction_conflicted.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/icons/tx_output.png -------------------------------------------------------------------------------- /src/qt/res/orig.res/movies/update_spinner.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/qt/res/orig.res/movies/update_spinner.mng -------------------------------------------------------------------------------- /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 | void setAddress(const QString &address); 30 | 31 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 32 | */ 33 | QWidget *setupTabChain(QWidget *prev); 34 | 35 | void setFocus(); 36 | 37 | public slots: 38 | void setRemoveEnabled(bool enabled); 39 | void clear(); 40 | 41 | signals: 42 | void removeEntry(SendCoinsEntry *entry); 43 | void payAmountChanged(); 44 | 45 | private slots: 46 | void on_deleteButton_clicked(); 47 | void on_payTo_textChanged(const QString &address); 48 | void on_addressBookButton_clicked(); 49 | void on_pasteButton_clicked(); 50 | void updateDisplayUnit(); 51 | 52 | private: 53 | Ui::SendCoinsEntry *ui; 54 | WalletModel *model; 55 | }; 56 | 57 | #endif // SENDCOINSENTRY_H 58 | -------------------------------------------------------------------------------- /src/qt/sendmessagesdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDMESSAGESDIALOG_H 2 | #define SENDMESSAGESDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class SendMessagesDialog; 9 | } 10 | 11 | class MessageModel; 12 | class SendMessagesEntry; 13 | class SendMessagesRecipient; 14 | 15 | //QT_BEGIN_NAMESPACE 16 | //class QUrl; 17 | //QT_END_NAMESPACE 18 | 19 | /** Dialog for sending messages */ 20 | class SendMessagesDialog : public QDialog 21 | { 22 | Q_OBJECT 23 | 24 | public: 25 | 26 | enum Mode { 27 | Encrypted, 28 | Anonymous, 29 | }; 30 | 31 | enum Type { 32 | Page, 33 | Dialog, 34 | }; 35 | 36 | explicit SendMessagesDialog(Mode mode, Type type, QWidget *parent = 0); 37 | ~SendMessagesDialog(); 38 | 39 | void setModel (MessageModel *model); 40 | void loadRow(int row); 41 | bool checkMode(Mode mode); 42 | bool validate (); 43 | 44 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 45 | */ 46 | QWidget *setupTabChain(QWidget *prev); 47 | 48 | void pasteEntry(const SendMessagesRecipient &rv); 49 | 50 | public slots: 51 | void done(int retval); 52 | void clear(); 53 | void reject(); 54 | void accept(); 55 | SendMessagesEntry *addEntry(); 56 | void updateRemoveEnabled(); 57 | 58 | private: 59 | Ui::SendMessagesDialog *ui; 60 | MessageModel *model; 61 | bool fNewRecipientAllowed; 62 | Mode mode; 63 | Type type; 64 | 65 | private slots: 66 | void on_sendButton_clicked(); 67 | void removeEntry(SendMessagesEntry* entry); 68 | void on_addressBookButton_clicked(); 69 | void on_pasteButton_clicked(); 70 | }; 71 | 72 | #endif // SENDMESSAGESDIALOG_H 73 | -------------------------------------------------------------------------------- /src/qt/sendmessagesentry.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDMESSAGESENTRY_H 2 | #define SENDMESSAGESENTRY_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class SendMessagesEntry; 8 | } 9 | class MessageModel; 10 | class SendMessagesRecipient; 11 | 12 | /** A single entry in the dialog for sending messages. */ 13 | class SendMessagesEntry : public QFrame 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit SendMessagesEntry(QWidget *parent = 0); 19 | ~SendMessagesEntry(); 20 | 21 | void setModel(MessageModel *model); 22 | void loadRow(int row); 23 | bool validate(); 24 | SendMessagesRecipient getValue(); 25 | 26 | /** Return whether the entry is still empty and unedited */ 27 | bool isClear(); 28 | 29 | void setValue(const SendMessagesRecipient &value); 30 | 31 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 32 | */ 33 | QWidget *setupTabChain(QWidget *prev); 34 | 35 | void setFocus(); 36 | 37 | public slots: 38 | void setRemoveEnabled(bool enabled); 39 | void clear(); 40 | 41 | signals: 42 | void removeEntry(SendMessagesEntry *entry); 43 | 44 | private slots: 45 | void on_deleteButton_clicked(); 46 | void on_addressBookButton_clicked(); 47 | void on_pasteButton_clicked(); 48 | void on_PubkeyPasteButton_clicked(); 49 | void on_sendTo_textChanged(const QString &address); 50 | 51 | private: 52 | Ui::SendMessagesEntry *ui; 53 | MessageModel *model; 54 | }; 55 | 56 | #endif // SENDMESSAGESENTRY_H 57 | -------------------------------------------------------------------------------- /src/qt/signverifymessagedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SIGNVERIFYMESSAGEDIALOG_H 2 | #define SIGNVERIFYMESSAGEDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class SignVerifyMessageDialog; 8 | } 9 | class WalletModel; 10 | 11 | class SignVerifyMessageDialog : public QDialog 12 | { 13 | Q_OBJECT 14 | 15 | public: 16 | explicit SignVerifyMessageDialog(QWidget *parent = 0); 17 | ~SignVerifyMessageDialog(); 18 | 19 | void setModel(WalletModel *model); 20 | void setAddress_SM(QString address); 21 | void setAddress_VM(QString address); 22 | 23 | void showTab_SM(bool fShow); 24 | void showTab_VM(bool fShow); 25 | 26 | protected: 27 | bool eventFilter(QObject *object, QEvent *event); 28 | 29 | private: 30 | Ui::SignVerifyMessageDialog *ui; 31 | WalletModel *model; 32 | 33 | private slots: 34 | /* sign message */ 35 | void on_addressBookButton_SM_clicked(); 36 | void on_pasteButton_SM_clicked(); 37 | void on_signMessageButton_SM_clicked(); 38 | void on_copySignatureButton_SM_clicked(); 39 | void on_clearButton_SM_clicked(); 40 | /* verify message */ 41 | void on_addressBookButton_VM_clicked(); 42 | void on_verifyMessageButton_VM_clicked(); 43 | void on_clearButton_VM_clicked(); 44 | }; 45 | 46 | #endif // SIGNVERIFYMESSAGEDIALOG_H 47 | -------------------------------------------------------------------------------- /src/qt/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "uritests.h" 5 | 6 | // This is all you need to run all the tests 7 | int main(int argc, char *argv[]) 8 | { 9 | bool fInvalid = false; 10 | 11 | URITests test1; 12 | if (QTest::qExec(&test1) != 0) 13 | fInvalid = true; 14 | 15 | return fInvalid; 16 | } 17 | -------------------------------------------------------------------------------- /src/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 | -------------------------------------------------------------------------------- /src/qt/trafficgraphwidget.h: -------------------------------------------------------------------------------- 1 | #ifndef TRAFFICGRAPHWIDGET_H 2 | #define TRAFFICGRAPHWIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | class ClientModel; 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QPaintEvent; 11 | class QTimer; 12 | QT_END_NAMESPACE 13 | 14 | class TrafficGraphWidget : public QWidget 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TrafficGraphWidget(QWidget *parent = 0); 20 | void setClientModel(ClientModel *model); 21 | int getGraphRangeMins() const; 22 | 23 | protected: 24 | void paintEvent(QPaintEvent *); 25 | 26 | public slots: 27 | void updateRates(); 28 | void setGraphRangeMins(int mins); 29 | void clear(); 30 | 31 | private: 32 | void paintPath(QPainterPath &path, QQueue &samples); 33 | 34 | QTimer *timer; 35 | float fMax; 36 | int nMins; 37 | QQueue vSamplesIn; 38 | QQueue vSamplesOut; 39 | quint64 nLastBytesIn; 40 | quint64 nLastBytesOut; 41 | ClientModel *clientModel; 42 | }; 43 | 44 | #endif // TRAFFICGRAPHWIDGET_H 45 | -------------------------------------------------------------------------------- /src/qt/transactiondesc.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONDESC_H 2 | #define TRANSACTIONDESC_H 3 | 4 | #include 5 | #include 6 | 7 | class TransactionRecord; 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 | 17 | public: 18 | static QString toHTML(CWallet *wallet, CWalletTx &wtx, TransactionRecord *rec, int unit); 19 | 20 | private: 21 | TransactionDesc() {} 22 | 23 | static QString FormatTxStatus(const CWalletTx& wtx); 24 | }; 25 | 26 | #endif // TRANSACTIONDESC_H 27 | -------------------------------------------------------------------------------- /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/transactiondescdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONDESCDIALOG_H 2 | #define TRANSACTIONDESCDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class TransactionDescDialog; 8 | } 9 | 10 | QT_BEGIN_NAMESPACE 11 | class QModelIndex; 12 | QT_END_NAMESPACE 13 | 14 | /** Dialog showing transaction details. */ 15 | class TransactionDescDialog : public QDialog 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0); 21 | ~TransactionDescDialog(); 22 | 23 | private: 24 | Ui::TransactionDescDialog *ui; 25 | }; 26 | 27 | #endif // TRANSACTIONDESCDIALOG_H 28 | -------------------------------------------------------------------------------- /src/qt/walletmodeltransaction.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_QT_WALLETMODELTRANSACTION_H 6 | #define BITCOIN_QT_WALLETMODELTRANSACTION_H 7 | 8 | #include "walletmodel.h" 9 | #include "util.h" 10 | 11 | #include 12 | 13 | class SendCoinsRecipient; 14 | 15 | class CReserveKey; 16 | class CWallet; 17 | class CWalletTx; 18 | 19 | /** Data model for a walletmodel transaction. */ 20 | class WalletModelTransaction 21 | { 22 | public: 23 | explicit WalletModelTransaction(const QList &recipients); 24 | ~WalletModelTransaction(); 25 | 26 | QList getRecipients(); 27 | 28 | CWalletTx *getTransaction(); 29 | unsigned int getTransactionSize(); 30 | 31 | void setTransactionFee(const CAmount& newFee); 32 | CAmount getTransactionFee(); 33 | 34 | CAmount getTotalTransactionAmount(); 35 | 36 | void newPossibleKeyChange(CWallet *wallet); 37 | CReserveKey *getPossibleKeyChange(); 38 | 39 | private: 40 | const QList recipients; 41 | CWalletTx *walletTransaction; 42 | CReserveKey *keyChange; 43 | CAmount fee; 44 | }; 45 | 46 | #endif // BITCOIN_QT_WALLETMODELTRANSACTION_H 47 | -------------------------------------------------------------------------------- /src/rpcclient.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2013 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef _BITCOINRPC_CLIENT_H_ 7 | #define _BITCOINRPC_CLIENT_H_ 1 8 | 9 | #include "json/json_spirit_reader_template.h" 10 | #include "json/json_spirit_utils.h" 11 | #include "json/json_spirit_writer_template.h" 12 | 13 | int CommandLineRPC(int argc, char *argv[]); 14 | 15 | json_spirit::Array RPCConvertValues(const std::string &strMethod, const std::vector &strParams); 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/scrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRYPT_MINE_H 2 | #define SCRYPT_MINE_H 3 | 4 | #include 5 | #include 6 | 7 | #include "util.h" 8 | #include "net.h" 9 | 10 | uint256 scrypt_salted_multiround_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen, const unsigned int nRounds); 11 | uint256 scrypt_salted_hash(const void* input, size_t inputlen, const void* salt, size_t saltlen); 12 | uint256 scrypt_hash(const void* input, size_t inputlen); 13 | uint256 scrypt_blockhash(const void* input); 14 | 15 | #endif // SCRYPT_MINE_H 16 | -------------------------------------------------------------------------------- /src/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | bench_inv 2 | bench_ecdh 3 | bench_sign 4 | bench_verify 5 | bench_schnorr_verify 6 | bench_recover 7 | bench_internal 8 | tests 9 | gen_context 10 | *.exe 11 | *.so 12 | *.a 13 | !.gitignore 14 | 15 | Makefile 16 | configure 17 | .libs/ 18 | Makefile.in 19 | aclocal.m4 20 | autom4te.cache/ 21 | config.log 22 | config.status 23 | *.tar.gz 24 | *.la 25 | libtool 26 | .deps/ 27 | .dirstamp 28 | *.lo 29 | *.o 30 | *~ 31 | src/libsecp256k1-config.h 32 | src/libsecp256k1-config.h.in 33 | src/ecmult_static_context.h 34 | m4/libtool.m4 35 | m4/ltoptions.m4 36 | m4/ltsugar.m4 37 | m4/ltversion.m4 38 | m4/lt~obsolete.m4 39 | src/stamp-h1 40 | libsecp256k1.pc 41 | -------------------------------------------------------------------------------- /src/secp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/secp256k1/TODO: -------------------------------------------------------------------------------- 1 | * Unit tests for fieldelem/groupelem, including ones intended to 2 | trigger fieldelem's boundary cases. 3 | * Complete constant-time operations for signing/keygen 4 | -------------------------------------------------------------------------------- /src/secp256k1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /src/secp256k1/build-aux/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # @configure_input@ 11 | 12 | # serial 3337 ltversion.m4 13 | # This file is part of GNU Libtool 14 | 15 | m4_define([LT_PACKAGE_VERSION], [2.4.2]) 16 | m4_define([LT_PACKAGE_REVISION], [1.3337]) 17 | 18 | AC_DEFUN([LTVERSION_VERSION], 19 | [macro_version='2.4.2' 20 | macro_revision='1.3337' 21 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 22 | _LT_DECL(, macro_revision, 0) 23 | ]) 24 | -------------------------------------------------------------------------------- /src/secp256k1/include/secp256k1_ecdh.h: -------------------------------------------------------------------------------- 1 | #ifndef _SECP256K1_ECDH_ 2 | # define _SECP256K1_ECDH_ 3 | 4 | # include "secp256k1.h" 5 | 6 | # ifdef __cplusplus 7 | extern "C" { 8 | # endif 9 | 10 | /** Compute an EC Diffie-Hellman secret in constant time 11 | * Returns: 1: exponentiation was successful 12 | * 0: scalar was invalid (zero or overflow) 13 | * Args: ctx: pointer to a context object (cannot be NULL) 14 | * Out: result: a 32-byte array which will be populated by an ECDH 15 | * secret computed from the point and scalar 16 | * In: pubkey: a pointer to a secp256k1_pubkey containing an 17 | * initialized public key 18 | * privkey: a 32-byte scalar with which to multiply the point 19 | */ 20 | SECP256K1_API SECP256K1_WARN_UNUSED_RESULT int secp256k1_ecdh( 21 | const secp256k1_context* ctx, 22 | unsigned char *result, 23 | const secp256k1_pubkey *pubkey, 24 | const unsigned char *privkey 25 | ) SECP256K1_ARG_NONNULL(1) SECP256K1_ARG_NONNULL(2) SECP256K1_ARG_NONNULL(3) SECP256K1_ARG_NONNULL(4); 26 | 27 | # ifdef __cplusplus 28 | } 29 | # endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/secp256k1/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs.private: @SECP_LIBS@ 12 | Libs: -L${libdir} -lsecp256k1 13 | 14 | -------------------------------------------------------------------------------- /src/secp256k1/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/exclfork/ExclusiveCoin/e3625c14a26097496f6005487180afe039e63552/src/secp256k1/obj/.gitignore -------------------------------------------------------------------------------- /src/secp256k1/src/basic-config.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_BASIC_CONFIG_ 8 | #define _SECP256K1_BASIC_CONFIG_ 9 | 10 | #ifdef USE_BASIC_CONFIG 11 | 12 | #undef USE_ASM_X86_64 13 | #undef USE_ENDOMORPHISM 14 | #undef USE_FIELD_10X26 15 | #undef USE_FIELD_5X52 16 | #undef USE_FIELD_INV_BUILTIN 17 | #undef USE_FIELD_INV_NUM 18 | #undef USE_NUM_GMP 19 | #undef USE_NUM_NONE 20 | #undef USE_SCALAR_4X64 21 | #undef USE_SCALAR_8X32 22 | #undef USE_SCALAR_INV_BUILTIN 23 | #undef USE_SCALAR_INV_NUM 24 | 25 | #define USE_NUM_NONE 1 26 | #define USE_FIELD_INV_BUILTIN 1 27 | #define USE_SCALAR_INV_BUILTIN 1 28 | #define USE_FIELD_10X26 1 29 | #define USE_SCALAR_8X32 1 30 | 31 | #endif // USE_BASIC_CONFIG 32 | #endif // _SECP256K1_BASIC_CONFIG_ 33 | -------------------------------------------------------------------------------- /src/secp256k1/src/bench_ecdh.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Pieter Wuille, Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #include 8 | 9 | #include "include/secp256k1.h" 10 | #include "include/secp256k1_ecdh.h" 11 | #include "util.h" 12 | #include "bench.h" 13 | 14 | typedef struct { 15 | secp256k1_context *ctx; 16 | secp256k1_pubkey point; 17 | unsigned char scalar[32]; 18 | } bench_ecdh_t; 19 | 20 | static void bench_ecdh_setup(void* arg) { 21 | int i; 22 | bench_ecdh_t *data = (bench_ecdh_t*)arg; 23 | const unsigned char point[] = { 24 | 0x03, 25 | 0x54, 0x94, 0xc1, 0x5d, 0x32, 0x09, 0x97, 0x06, 26 | 0xc2, 0x39, 0x5f, 0x94, 0x34, 0x87, 0x45, 0xfd, 27 | 0x75, 0x7c, 0xe3, 0x0e, 0x4e, 0x8c, 0x90, 0xfb, 28 | 0xa2, 0xba, 0xd1, 0x84, 0xf8, 0x83, 0xc6, 0x9f 29 | }; 30 | 31 | data->ctx = secp256k1_context_create(0); 32 | for (i = 0; i < 32; i++) { 33 | data->scalar[i] = i + 1; 34 | } 35 | CHECK(secp256k1_ec_pubkey_parse(data->ctx, &data->point, point, sizeof(point)) == 1); 36 | } 37 | 38 | static void bench_ecdh(void* arg) { 39 | int i; 40 | unsigned char res[32]; 41 | bench_ecdh_t *data = (bench_ecdh_t*)arg; 42 | 43 | for (i = 0; i < 20000; i++) { 44 | CHECK(secp256k1_ecdh(data->ctx, res, &data->point, data->scalar) == 1); 45 | } 46 | } 47 | 48 | int main(void) { 49 | bench_ecdh_t data; 50 | 51 | run_benchmark("ecdh", bench_ecdh, bench_ecdh_setup, NULL, &data, 10, 20000); 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /src/secp256k1/src/bench_sign.c: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #include "include/secp256k1.h" 8 | #include "util.h" 9 | #include "bench.h" 10 | 11 | typedef struct { 12 | secp256k1_context* ctx; 13 | unsigned char msg[32]; 14 | unsigned char key[32]; 15 | } bench_sign_t; 16 | 17 | static void bench_sign_setup(void* arg) { 18 | int i; 19 | bench_sign_t *data = (bench_sign_t*)arg; 20 | 21 | for (i = 0; i < 32; i++) { 22 | data->msg[i] = i + 1; 23 | } 24 | for (i = 0; i < 32; i++) { 25 | data->key[i] = i + 65; 26 | } 27 | } 28 | 29 | static void bench_sign(void* arg) { 30 | int i; 31 | bench_sign_t *data = (bench_sign_t*)arg; 32 | 33 | unsigned char sig[74]; 34 | for (i = 0; i < 20000; i++) { 35 | size_t siglen = 74; 36 | int j; 37 | secp256k1_ecdsa_signature signature; 38 | CHECK(secp256k1_ecdsa_sign(data->ctx, &signature, data->msg, data->key, NULL, NULL)); 39 | CHECK(secp256k1_ecdsa_signature_serialize_der(data->ctx, sig, &siglen, &signature)); 40 | for (j = 0; j < 32; j++) { 41 | data->msg[j] = sig[j]; 42 | data->key[j] = sig[j + 32]; 43 | } 44 | } 45 | } 46 | 47 | int main(void) { 48 | bench_sign_t data; 49 | 50 | data.ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); 51 | 52 | run_benchmark("ecdsa_sign", bench_sign, bench_sign_setup, NULL, &data, 10, 20000); 53 | 54 | secp256k1_context_destroy(data.ctx); 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecdsa.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECDSA_ 8 | #define _SECP256K1_ECDSA_ 9 | 10 | #include 11 | 12 | #include "scalar.h" 13 | #include "group.h" 14 | #include "ecmult.h" 15 | 16 | static int secp256k1_ecdsa_sig_parse(secp256k1_scalar *r, secp256k1_scalar *s, const unsigned char *sig, size_t size); 17 | static int secp256k1_ecdsa_sig_serialize(unsigned char *sig, size_t *size, const secp256k1_scalar *r, const secp256k1_scalar *s); 18 | static int secp256k1_ecdsa_sig_verify(const secp256k1_ecmult_context *ctx, const secp256k1_scalar* r, const secp256k1_scalar* s, const secp256k1_ge *pubkey, const secp256k1_scalar *message); 19 | static int secp256k1_ecdsa_sig_sign(const secp256k1_ecmult_gen_context *ctx, secp256k1_scalar* r, secp256k1_scalar* s, const secp256k1_scalar *seckey, const secp256k1_scalar *message, const secp256k1_scalar *nonce, int *recid); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /src/secp256k1/src/eckey.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECKEY_ 8 | #define _SECP256K1_ECKEY_ 9 | 10 | #include 11 | 12 | #include "group.h" 13 | #include "scalar.h" 14 | #include "ecmult.h" 15 | #include "ecmult_gen.h" 16 | 17 | static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char *pub, size_t size); 18 | static int secp256k1_eckey_pubkey_serialize(secp256k1_ge *elem, unsigned char *pub, size_t *size, int compressed); 19 | 20 | static int secp256k1_eckey_privkey_tweak_add(secp256k1_scalar *key, const secp256k1_scalar *tweak); 21 | static int secp256k1_eckey_pubkey_tweak_add(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak); 22 | static int secp256k1_eckey_privkey_tweak_mul(secp256k1_scalar *key, const secp256k1_scalar *tweak); 23 | static int secp256k1_eckey_pubkey_tweak_mul(const secp256k1_ecmult_context *ctx, secp256k1_ge *key, const secp256k1_scalar *tweak); 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecmult.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECMULT_ 8 | #define _SECP256K1_ECMULT_ 9 | 10 | #include "num.h" 11 | #include "group.h" 12 | 13 | typedef struct { 14 | /* For accelerating the computation of a*P + b*G: */ 15 | secp256k1_ge_storage (*pre_g)[]; /* odd multiples of the generator */ 16 | #ifdef USE_ENDOMORPHISM 17 | secp256k1_ge_storage (*pre_g_128)[]; /* odd multiples of 2^128*generator */ 18 | #endif 19 | } secp256k1_ecmult_context; 20 | 21 | static void secp256k1_ecmult_context_init(secp256k1_ecmult_context *ctx); 22 | static void secp256k1_ecmult_context_build(secp256k1_ecmult_context *ctx, const secp256k1_callback *cb); 23 | static void secp256k1_ecmult_context_clone(secp256k1_ecmult_context *dst, 24 | const secp256k1_ecmult_context *src, const secp256k1_callback *cb); 25 | static void secp256k1_ecmult_context_clear(secp256k1_ecmult_context *ctx); 26 | static int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx); 27 | 28 | /** Double multiply: R = na*A + ng*G */ 29 | static void secp256k1_ecmult(const secp256k1_ecmult_context *ctx, secp256k1_gej *r, const secp256k1_gej *a, const secp256k1_scalar *na, const secp256k1_scalar *ng); 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /src/secp256k1/src/ecmult_const.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2015 Andrew Poelstra * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_ECMULT_CONST_ 8 | #define _SECP256K1_ECMULT_CONST_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | static void secp256k1_ecmult_const(secp256k1_gej *r, const secp256k1_ge *a, const secp256k1_scalar *q); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c: -------------------------------------------------------------------------------- 1 | #include "org_bitcoin_NativeSecp256k1.h" 2 | #include "include/secp256k1.h" 3 | 4 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 5 | (JNIEnv* env, jclass classObject, jobject byteBufferObject) 6 | { 7 | unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); 8 | int sigLen = *((int*)(data + 32)); 9 | int pubLen = *((int*)(data + 32 + 4)); 10 | 11 | return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); 12 | } 13 | 14 | static void __javasecp256k1_attach(void) __attribute__((constructor)); 15 | static void __javasecp256k1_detach(void) __attribute__((destructor)); 16 | 17 | static void __javasecp256k1_attach(void) { 18 | secp256k1_start(SECP256K1_START_VERIFY); 19 | } 20 | 21 | static void __javasecp256k1_detach(void) { 22 | secp256k1_stop(); 23 | } 24 | -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_bitcoin_NativeSecp256k1 */ 4 | 5 | #ifndef _Included_org_bitcoin_NativeSecp256k1 6 | #define _Included_org_bitcoin_NativeSecp256k1 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_bitcoin_NativeSecp256k1 12 | * Method: secp256k1_ecdsa_verify 13 | * Signature: (Ljava/nio/ByteBuffer;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 16 | (JNIEnv *, jclass, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/ecdh/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_ecdh.h 2 | noinst_HEADERS += src/modules/ecdh/main_impl.h 3 | noinst_HEADERS += src/modules/ecdh/tests_impl.h 4 | if USE_BENCHMARK 5 | noinst_PROGRAMS += bench_ecdh 6 | bench_ecdh_SOURCES = src/bench_ecdh.c 7 | bench_ecdh_LDADD = libsecp256k1.la $(SECP_LIBS) 8 | endif 9 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/recovery/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_recovery.h 2 | noinst_HEADERS += src/modules/recovery/main_impl.h 3 | noinst_HEADERS += src/modules/recovery/tests_impl.h 4 | if USE_BENCHMARK 5 | noinst_PROGRAMS += bench_recover 6 | bench_recover_SOURCES = src/bench_recover.c 7 | bench_recover_LDADD = libsecp256k1.la $(SECP_LIBS) 8 | endif 9 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/schnorr/Makefile.am.include: -------------------------------------------------------------------------------- 1 | include_HEADERS += include/secp256k1_schnorr.h 2 | noinst_HEADERS += src/modules/schnorr/main_impl.h 3 | noinst_HEADERS += src/modules/schnorr/schnorr.h 4 | noinst_HEADERS += src/modules/schnorr/schnorr_impl.h 5 | noinst_HEADERS += src/modules/schnorr/tests_impl.h 6 | if USE_BENCHMARK 7 | noinst_PROGRAMS += bench_schnorr_verify 8 | bench_schnorr_verify_SOURCES = src/bench_schnorr_verify.c 9 | bench_schnorr_verify_LDADD = libsecp256k1.la $(SECP_LIBS) 10 | endif 11 | -------------------------------------------------------------------------------- /src/secp256k1/src/modules/schnorr/schnorr.h: -------------------------------------------------------------------------------- 1 | /*********************************************************************** 2 | * Copyright (c) 2014-2015 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php. * 5 | ***********************************************************************/ 6 | 7 | #ifndef _SECP256K1_MODULE_SCHNORR_H_ 8 | #define _SECP256K1_MODULE_SCHNORR_H_ 9 | 10 | #include "scalar.h" 11 | #include "group.h" 12 | 13 | typedef void (*secp256k1_schnorr_msghash)(unsigned char *h32, const unsigned char *r32, const unsigned char *msg32); 14 | 15 | static int secp256k1_schnorr_sig_sign(const secp256k1_ecmult_gen_context* ctx, unsigned char *sig64, const secp256k1_scalar *key, const secp256k1_scalar *nonce, const secp256k1_ge *pubnonce, secp256k1_schnorr_msghash hash, const unsigned char *msg32); 16 | static int secp256k1_schnorr_sig_verify(const secp256k1_ecmult_context* ctx, const unsigned char *sig64, const secp256k1_ge *pubkey, secp256k1_schnorr_msghash hash, const unsigned char *msg32); 17 | static int secp256k1_schnorr_sig_recover(const secp256k1_ecmult_context* ctx, const unsigned char *sig64, secp256k1_ge *pubkey, secp256k1_schnorr_msghash hash, const unsigned char *msg32); 18 | static int secp256k1_schnorr_sig_combine(unsigned char *sig64, size_t n, const unsigned char * const *sig64ins); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_REPR_ 8 | #define _SECP256K1_NUM_REPR_ 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_IMPL_H_ 8 | #define _SECP256K1_NUM_IMPL_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/testrand.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_TESTRAND_H_ 8 | #define _SECP256K1_TESTRAND_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | /* A non-cryptographic RNG used only for test infrastructure. */ 15 | 16 | /** Seed the pseudorandom number generator for testing. */ 17 | SECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16); 18 | 19 | /** Generate a pseudorandom number in the range [0..2**32-1]. */ 20 | static uint32_t secp256k1_rand32(void); 21 | 22 | /** Generate a pseudorandom number in the range [0..2**bits-1]. Bits must be 1 or 23 | * more. */ 24 | static uint32_t secp256k1_rand_bits(int bits); 25 | 26 | /** Generate a pseudorandom number in the range [0..range-1]. */ 27 | static uint32_t secp256k1_rand_int(uint32_t range); 28 | 29 | /** Generate a pseudorandom 32-byte array. */ 30 | static void secp256k1_rand256(unsigned char *b32); 31 | 32 | /** Generate a pseudorandom 32-byte array with long sequences of zero and one bits. */ 33 | static void secp256k1_rand256_test(unsigned char *b32); 34 | 35 | /** Generate pseudorandom bytes with long sequences of zero and one bits. */ 36 | static void secp256k1_rand_bytes_test(unsigned char *bytes, size_t len); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/support/cleanse.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "cleanse.h" 7 | 8 | #include 9 | 10 | void memory_cleanse(void *ptr, size_t len) 11 | { 12 | OPENSSL_cleanse(ptr, len); 13 | } -------------------------------------------------------------------------------- /src/support/cleanse.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SUPPORT_CLEANSE_H 7 | #define BITCOIN_SUPPORT_CLEANSE_H 8 | 9 | #include 10 | 11 | void memory_cleanse(void *ptr, size_t len); 12 | 13 | #endif // BITCOIN_SUPPORT_CLEANSE_H -------------------------------------------------------------------------------- /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("0x0000000069e244f73d78e8fd29ba2fd2ed618bd6fa2ee92559f542fdb26e7c1d"); 18 | uint256 p134444 = uint256("0x00000000000005b12ffd4cd315cd34ffd4a594f430ac814c91184a0d42d2b0fe"); 19 | BOOST_CHECK(Checkpoints::CheckBlock(11111, p11111)); 20 | BOOST_CHECK(Checkpoints::CheckBlock(134444, p134444)); 21 | 22 | 23 | // Wrong hashes at checkpoints should fail: 24 | BOOST_CHECK(!Checkpoints::CheckBlock(11111, p134444)); 25 | BOOST_CHECK(!Checkpoints::CheckBlock(134444, p11111)); 26 | 27 | // ... but any hash not at a checkpoint should succeed: 28 | BOOST_CHECK(Checkpoints::CheckBlock(11111+1, p134444)); 29 | BOOST_CHECK(Checkpoints::CheckBlock(134444+1, p11111)); 30 | 31 | BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate() >= 134444); 32 | } 33 | 34 | BOOST_AUTO_TEST_SUITE_END() 35 | -------------------------------------------------------------------------------- /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/test/base32_tests.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "util.h" 4 | 5 | BOOST_AUTO_TEST_SUITE(base32_tests) 6 | 7 | BOOST_AUTO_TEST_CASE(base32_testvectors) 8 | { 9 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 10 | static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"}; 11 | for (unsigned int i=0; i 2 | 3 | #include "main.h" 4 | #include "wallet.h" 5 | #include "util.h" 6 | 7 | BOOST_AUTO_TEST_SUITE(base64_tests) 8 | 9 | BOOST_AUTO_TEST_CASE(base64_testvectors) 10 | { 11 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 12 | static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"}; 13 | for (unsigned int i=0; i 2 | 3 | #include 4 | #include 5 | 6 | #include "serialize.h" 7 | 8 | using namespace std; 9 | 10 | BOOST_AUTO_TEST_SUITE(serialize_tests) 11 | 12 | BOOST_AUTO_TEST_CASE(varints) 13 | { 14 | // encode 15 | 16 | CDataStream ss(SER_DISK, 0); 17 | CDataStream::size_type size = 0; 18 | for (int i = 0; i < 100000; i++) { 19 | ss << VARINT(i); 20 | size += ::GetSerializeSize(VARINT(i), 0, 0); 21 | BOOST_CHECK(size == ss.size()); 22 | } 23 | 24 | for (uint64 i = 0; i < 100000000000ULL; i += 999999937) { 25 | ss << VARINT(i); 26 | size += ::GetSerializeSize(VARINT(i), 0, 0); 27 | BOOST_CHECK(size == ss.size()); 28 | } 29 | 30 | // decode 31 | for (int i = 0; i < 100000; i++) { 32 | int j; 33 | ss >> VARINT(j); 34 | BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i); 35 | } 36 | 37 | for (uint64 i = 0; i < 100000000000ULL; i += 999999937) { 38 | uint64 j; 39 | ss >> VARINT(j); 40 | BOOST_CHECK_MESSAGE(i == j, "decoded:" << j << " expected:" << i); 41 | } 42 | 43 | } 44 | 45 | BOOST_AUTO_TEST_SUITE_END() 46 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /src/txdb.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file license.txt or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_TXDB_H 7 | #define BITCOIN_TXDB_H 8 | 9 | #include "txdb-leveldb.h" 10 | 11 | #endif // BITCOIN_TXDB_H 12 | -------------------------------------------------------------------------------- /src/txmempool.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2013 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef BITCOIN_TXMEMPOOL_H 6 | #define BITCOIN_TXMEMPOOL_H 7 | 8 | #include "core.h" 9 | 10 | /* 11 | * CTxMemPool stores valid-according-to-the-current-best-chain 12 | * transactions that may be included in the next block. 13 | * 14 | * Transactions are added when they are seen on the network 15 | * (or created by the local node), but not all transactions seen 16 | * are added to the pool: if a new transaction double-spends 17 | * an input of a transaction in the pool, it is dropped, 18 | * as are non-standard transactions. 19 | */ 20 | class CTxMemPool 21 | { 22 | private: 23 | unsigned int nTransactionsUpdated; 24 | 25 | public: 26 | mutable CCriticalSection cs; 27 | std::map mapTx; 28 | std::map mapNextTx; 29 | 30 | CTxMemPool(); 31 | 32 | bool addUnchecked(const uint256& hash, CTransaction &tx); 33 | bool remove(const CTransaction &tx, bool fRecursive = false); 34 | bool removeConflicts(const CTransaction &tx); 35 | void clear(); 36 | void queryHashes(std::vector& vtxid); 37 | unsigned int GetTransactionsUpdated() const; 38 | void AddTransactionsUpdated(unsigned int n); 39 | 40 | unsigned long size() const 41 | { 42 | LOCK(cs); 43 | return mapTx.size(); 44 | } 45 | 46 | bool exists(uint256 hash) const 47 | { 48 | LOCK(cs); 49 | return (mapTx.count(hash) != 0); 50 | } 51 | 52 | bool lookup(uint256 hash, CTransaction& result) const; 53 | }; 54 | 55 | #endif /* BITCOIN_TXMEMPOOL_H */ 56 | --------------------------------------------------------------------------------