├── BitcoinDark-qt.pro ├── BitcoinDark-qt.pro.user ├── COPYING ├── INSTALL ├── README ├── README.html ├── README.md ├── autom4te.cache ├── output.0 ├── output.1 ├── requests ├── traces.0 └── traces.1 ├── build └── build.h ├── contrib ├── bitrpc │ └── bitrpc.py ├── debian │ ├── bin │ │ ├── novacoin-qt │ │ └── novacoind │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── examples │ │ └── novacoin.conf │ ├── gbp.conf │ ├── manpages │ │ ├── novacoin.conf.5 │ │ └── novacoind.1 │ ├── novacoin-qt.desktop │ ├── novacoin-qt.install │ ├── novacoin-qt.lintian-overrides │ ├── novacoin-qt.protocol │ ├── novacoind.examples │ ├── novacoind.install │ ├── novacoind.lintian-overrides │ ├── novacoind.manpages │ ├── patches │ │ ├── README │ │ └── series │ ├── rules │ ├── source │ │ └── format │ └── watch ├── gitian-descriptors │ ├── README │ ├── boost-win32.yml │ ├── deps-win32.yml │ ├── gitian-win32.yml │ ├── gitian.yml │ └── qt-win32.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 ├── macdeploy │ ├── LICENSE │ ├── background.png │ ├── background.psd │ ├── fancy.plist │ ├── macdeployqtplus │ └── notes.txt ├── qt_translations.py └── wallettools │ ├── walletchangepass.py │ └── walletunlock.py ├── doc ├── Doxyfile ├── README ├── README_windows.txt ├── README~ ├── assets-attribution.txt ├── bitcoin_logo_doxygen.png ├── build-msw.txt ├── build-osx.txt ├── build-unix.txt ├── coding.txt ├── readme-qt.rst ├── release-process.txt └── translation_process.md ├── qa ├── pull-tester │ ├── build-tests.sh │ ├── build-tests.sh.in │ ├── pull-tester.py │ ├── pull-tester.sh │ ├── run-bitcoind-for-test.sh │ └── run-bitcoind-for-test.sh.in └── rpc-tests │ ├── .gitignore │ ├── README.md │ ├── conflictedbalance.sh │ ├── listtransactions.py │ ├── python-bitcoinrpc │ ├── bitcoinrpc │ │ ├── .gitignore │ │ ├── __init__.py │ │ └── authproxy.py │ └── setup.py │ ├── send.sh │ ├── skeleton.py │ ├── txnmall.sh │ ├── util.py │ ├── util.sh │ ├── wallet.sh │ └── walletbackup.sh ├── 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.in │ ├── extract_strings_qt.py │ ├── img │ │ └── reload.xcf │ ├── make_spinner.py │ └── make_windows_icon.sh ├── setup.nsi ├── setup.nsi.in └── ui.rc └── src ├── COPYING ├── INSTALL ├── Makefile ├── Makefile.in ├── README ├── README.md ├── addrman.cpp ├── addrman.h ├── alert.cpp ├── alert.h ├── allocators.h ├── base58.h ├── bignum.h ├── bitcoin-config.h.in ├── bitcoinrpc.cpp ├── bitcoinrpc.h ├── build-aux ├── config.guess ├── config.sub ├── install-sh └── missing ├── checkpoints.cpp ├── checkpoints.h ├── clientversion.h ├── coincontrol.h ├── compat.h ├── crypter.cpp ├── crypter.h ├── db.cpp ├── db.h ├── hash.cpp ├── hash.h ├── init.cpp ├── init.h ├── irc.cpp ├── irc.h ├── 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 ├── 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 ├── liblto_plugin-0.dll ├── m4 ├── ax_boost_base.m4 ├── ax_boost_chrono.m4 ├── ax_boost_filesystem.m4 ├── ax_boost_program_options.m4 ├── ax_boost_system.m4 ├── ax_boost_thread.m4 ├── ax_boost_unit_test_framework.m4 ├── ax_check_compile_flag.m4 ├── ax_check_link_flag.m4 ├── ax_check_preproc_flag.m4 ├── ax_pthread.m4 ├── bitcoin_find_bdb48.m4 ├── bitcoin_qt.m4 └── bitcoin_subdir_to_include.m4 ├── main.cpp ├── main.h ├── makefile.bsd ├── makefile.linux-mingw ├── makefile.mingw ├── makefile.osx ├── makefile.unix ├── miner.cpp ├── miner.h ├── mruset.h ├── net.cpp ├── net.h ├── netbase.cpp ├── netbase.h ├── noui.cpp ├── obj-test └── .gitignore ├── pbkdf2.cpp ├── pbkdf2.h ├── protocol.cpp ├── protocol.h ├── qt ├── Makefile.in ├── aboutdialog.cpp ├── aboutdialog.h ├── addressbookpage.cpp ├── addressbookpage.h ├── addresstablemodel.cpp ├── addresstablemodel.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 ├── clientmodel.cpp ├── clientmodel.h ├── coincontroldialog.cpp ├── coincontroldialog.h ├── coincontroltreewidget.cpp ├── coincontroltreewidget.h ├── csvmodelwriter.cpp ├── csvmodelwriter.h ├── editaddressdialog.cpp ├── editaddressdialog.h ├── forms │ ├── aboutdialog.ui │ ├── addressbookpage.ui │ ├── askpassphrasedialog.ui │ ├── coincontroldialog.ui │ ├── editaddressdialog.ui │ ├── optionsdialog.ui │ ├── overviewpage.ui │ ├── qrcodedialog.ui │ ├── rpcconsole.ui │ ├── sendcoinsdialog.ui │ ├── sendcoinsentry.ui │ ├── signverifymessagedialog.ui │ └── transactiondescdialog.ui ├── guiconstants.h ├── guiutil.cpp ├── guiutil.h ├── locale │ ├── bitcoin_af_ZA.qm │ ├── bitcoin_af_ZA.ts │ ├── bitcoin_ar.qm │ ├── bitcoin_ar.ts │ ├── bitcoin_be_BY.qm │ ├── bitcoin_be_BY.ts │ ├── bitcoin_bg.qm │ ├── bitcoin_bg.ts │ ├── bitcoin_bs.qm │ ├── bitcoin_bs.ts │ ├── bitcoin_ca.qm │ ├── bitcoin_ca.ts │ ├── bitcoin_ca@valencia.qm │ ├── bitcoin_ca@valencia.ts │ ├── bitcoin_ca_ES.qm │ ├── bitcoin_ca_ES.ts │ ├── bitcoin_cs.qm │ ├── bitcoin_cs.ts │ ├── bitcoin_cy.qm │ ├── bitcoin_cy.ts │ ├── bitcoin_da.qm │ ├── bitcoin_da.ts │ ├── bitcoin_de.qm │ ├── bitcoin_de.ts │ ├── bitcoin_el_GR.qm │ ├── bitcoin_el_GR.ts │ ├── bitcoin_en.qm │ ├── bitcoin_en.ts │ ├── bitcoin_eo.qm │ ├── bitcoin_eo.ts │ ├── bitcoin_es.qm │ ├── bitcoin_es.ts │ ├── bitcoin_es_CL.qm │ ├── bitcoin_es_CL.ts │ ├── bitcoin_es_DO.qm │ ├── bitcoin_es_DO.ts │ ├── bitcoin_es_MX.qm │ ├── bitcoin_es_MX.ts │ ├── bitcoin_es_UY.qm │ ├── bitcoin_es_UY.ts │ ├── bitcoin_et.qm │ ├── bitcoin_et.ts │ ├── bitcoin_eu_ES.qm │ ├── bitcoin_eu_ES.ts │ ├── bitcoin_fa.qm │ ├── bitcoin_fa.ts │ ├── bitcoin_fa_IR.qm │ ├── bitcoin_fa_IR.ts │ ├── bitcoin_fi.qm │ ├── bitcoin_fi.ts │ ├── bitcoin_fr.qm │ ├── bitcoin_fr.ts │ ├── bitcoin_fr_CA.qm │ ├── bitcoin_fr_CA.ts │ ├── bitcoin_gl.qm │ ├── bitcoin_gl.ts │ ├── bitcoin_he.qm │ ├── bitcoin_he.ts │ ├── bitcoin_hi_IN.qm │ ├── bitcoin_hi_IN.ts │ ├── bitcoin_hr.qm │ ├── bitcoin_hr.ts │ ├── bitcoin_hu.qm │ ├── bitcoin_hu.ts │ ├── bitcoin_id_ID.qm │ ├── bitcoin_id_ID.ts │ ├── bitcoin_it.qm │ ├── bitcoin_it.ts │ ├── bitcoin_ja.qm │ ├── bitcoin_ja.ts │ ├── bitcoin_ka.qm │ ├── bitcoin_ka.ts │ ├── bitcoin_kk_KZ.qm │ ├── bitcoin_kk_KZ.ts │ ├── bitcoin_ko_KR.qm │ ├── bitcoin_ko_KR.ts │ ├── bitcoin_ky.qm │ ├── bitcoin_ky.ts │ ├── bitcoin_la.qm │ ├── bitcoin_la.ts │ ├── bitcoin_lt.qm │ ├── bitcoin_lt.ts │ ├── bitcoin_lv_LV.qm │ ├── bitcoin_lv_LV.ts │ ├── bitcoin_ms_MY.qm │ ├── bitcoin_ms_MY.ts │ ├── bitcoin_nb.qm │ ├── bitcoin_nb.ts │ ├── bitcoin_nl.qm │ ├── bitcoin_nl.ts │ ├── bitcoin_pam.qm │ ├── bitcoin_pam.ts │ ├── bitcoin_pl.qm │ ├── bitcoin_pl.ts │ ├── bitcoin_pt_BR.qm │ ├── bitcoin_pt_BR.ts │ ├── bitcoin_pt_PT.qm │ ├── bitcoin_pt_PT.ts │ ├── bitcoin_ro_RO.qm │ ├── bitcoin_ro_RO.ts │ ├── bitcoin_ru.qm │ ├── bitcoin_ru.ts │ ├── bitcoin_sah.qm │ ├── bitcoin_sah.ts │ ├── bitcoin_sk.qm │ ├── bitcoin_sk.ts │ ├── bitcoin_sl_SI.qm │ ├── bitcoin_sl_SI.ts │ ├── bitcoin_sq.qm │ ├── bitcoin_sq.ts │ ├── bitcoin_sr.qm │ ├── bitcoin_sr.ts │ ├── bitcoin_sv.qm │ ├── bitcoin_sv.ts │ ├── bitcoin_th_TH.qm │ ├── bitcoin_th_TH.ts │ ├── bitcoin_tr.qm │ ├── bitcoin_tr.ts │ ├── bitcoin_uk.qm │ ├── bitcoin_uk.ts │ ├── bitcoin_ur_PK.qm │ ├── bitcoin_ur_PK.ts │ ├── bitcoin_vi.qm │ ├── bitcoin_vi.ts │ ├── bitcoin_vi_VN.qm │ ├── bitcoin_vi_VN.ts │ ├── bitcoin_zh_CN.qm │ ├── bitcoin_zh_CN.ts │ ├── bitcoin_zh_TW.qm │ └── bitcoin_zh_TW.ts ├── macdockiconhandler.h ├── macdockiconhandler.mm ├── monitoreddatamapper.cpp ├── monitoreddatamapper.h ├── notificator.cpp ├── notificator.h ├── optionsdialog.cpp ├── optionsdialog.h ├── optionsmodel.cpp ├── optionsmodel.h ├── overviewpage.cpp ├── overviewpage.h ├── qrcodedialog.cpp ├── qrcodedialog.h ├── qtipcserver.cpp ├── qtipcserver.h ├── qvalidatedlineedit.cpp ├── qvalidatedlineedit.h ├── qvaluecombobox.cpp ├── qvaluecombobox.h ├── res │ ├── bitcoin-qt.rc │ ├── icons │ │ ├── add.png │ │ ├── address-book.png │ │ ├── bitcoin.icns │ │ ├── bitcoin_testnet.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 │ │ ├── export.png │ │ ├── filesave.png │ │ ├── history.png │ │ ├── key.png │ │ ├── lock_closed.png │ │ ├── lock_open.png │ │ ├── notsynced.png │ │ ├── novacoin-128.png │ │ ├── novacoin-16.png │ │ ├── novacoin-32.png │ │ ├── novacoin-48.png │ │ ├── novacoin-80.png │ │ ├── novacoin.ico │ │ ├── novacoin.png │ │ ├── overview.png │ │ ├── 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 │ ├── images │ │ ├── about.png │ │ ├── splash2.jpg │ │ └── splash3.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 ├── rpcconsole.cpp ├── rpcconsole.h ├── sendcoinsdialog.cpp ├── sendcoinsdialog.h ├── sendcoinsentry.cpp ├── sendcoinsentry.h ├── signverifymessagedialog.cpp ├── signverifymessagedialog.h ├── test │ ├── Makefile.in │ ├── test_main.cpp │ ├── uritests.cpp │ └── uritests.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 ├── rpcblockchain.cpp ├── rpcdump.cpp ├── rpcmining.cpp ├── rpcnet.cpp ├── rpcrawtransaction.cpp ├── rpcwallet.cpp ├── script.cpp ├── script.h ├── scrypt-arm.S ├── scrypt-sse2.cpp ├── scrypt-x86.S ├── scrypt-x86_64.S ├── scrypt.cpp ├── scrypt.h ├── serialize.h ├── strlcpy.h ├── sync.cpp ├── sync.h ├── test ├── Checkpoints_tests.cpp ├── DoS_tests.cpp ├── Makefile.in ├── 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 │ ├── script_invalid.json │ ├── script_valid.json │ ├── tx_invalid.json │ └── tx_valid.json ├── getarg_tests.cpp ├── key_tests.cpp ├── miner_tests.cpp ├── mruset_tests.cpp ├── multisig_tests.cpp ├── netbase_tests.cpp ├── rpc_tests.cpp ├── script_P2SH_tests.cpp ├── script_tests.cpp ├── sigopcount_tests.cpp ├── test_bitcoin.cpp ├── transaction_tests.cpp ├── uint160_tests.cpp ├── uint256_tests.cpp ├── util_tests.cpp └── wallet_tests.cpp ├── testcoin-qt.pro ├── txdb-leveldb.cpp ├── txdb-leveldb.h ├── txdb.h ├── ui_interface.h ├── uint256.h ├── util.cpp ├── util.h ├── version.cpp ├── version.h ├── wallet.cpp ├── wallet.h ├── walletdb.cpp ├── walletdb.h └── zerocoin ├── Accumulator.cpp ├── Accumulator.h ├── AccumulatorProofOfKnowledge.cpp ├── AccumulatorProofOfKnowledge.h ├── Coin.cpp ├── Coin.h ├── CoinSpend.cpp ├── CoinSpend.h ├── Commitment.cpp ├── Commitment.h ├── ParamGeneration.cpp ├── ParamGeneration.h ├── Params.cpp ├── Params.h ├── SerialNumberSignatureOfKnowledge.cpp ├── SerialNumberSignatureOfKnowledge.h ├── SpendMetaData.cpp ├── SpendMetaData.h ├── ZeroTest.cpp ├── ZeroTest.h └── Zerocoin.h /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 BitcoinDark Developers 2 | Copyright (c) 2013-2014 NovaCoin Developers 3 | Copyright (c) 2011-2012 PPCoin Developers 4 | Copyright (c) 2009-2014 Bitcoin Developers 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building BitcoinDark 2 | 3 | See doc/readme-qt.rst for instructions on building BitcoinDark QT, 4 | the intended-for-end-users, nice-graphical-interface, reference 5 | implementation of BitcoinDark. 6 | 7 | See doc/build-*.txt for instructions on building Testcoind, 8 | the intended-for-services, no-graphical-interface, reference 9 | implementation of BitcoinDark. 10 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /README.html: -------------------------------------------------------------------------------- 1 |

BitcoinDark

2 | 3 |

--insert image here--

4 | 5 |

What Is BitcoinDark?

6 | 7 |

BitcoinDark is a Proof of Stake Cryptocurrency. The first two weeks after release will consist of a two week Proof of Work period.

8 | 9 |

Why BitcoinDark?

10 | 11 |

It is the goal of the BitcoinDark developers for everyone involved in the Cryptocurrency revolution to have access to the exciting developments that have been taking place. An ASIC-friendly, mixed PoW/PoS coin with eventual anonymous transaction capabilities has been sorely overlooked.

12 | 13 |

The BitcoinDark developers believe that progress should never be held back. ASICs use much less energy than GPUs and are orders of magnitude more efficient. The energy used mining Scrypt coins for years to prolong the days of GPU mining was a truly enormous waste of resources on a global scale. Why hold back progress? BitcoinDark encourages it.

14 | 15 |

BitcoinDark Specifications

16 | 17 |

Coin Generation: Pure Proof of Stake with Proof of Work period upon release

18 | 19 |

Proof of Work Algorithm: SHA-256

20 | 21 |

Total Number of Coins: 22 million

22 | 23 |

PoW Block Reward: 80 BTCD

24 | 25 |

PoW Blocks: 20,160

26 | 27 |

PoW Target Blocktime: 1 minute

28 | 29 |

RPC Port: 14632

30 | 31 |

Port: 14631

32 | 33 |

Time to Maturity: 100 Confirmations

34 | 35 |

Proof of Stake Reward: 5% per year

36 | 37 |

Minimum Coin Stake Age: 8 hours

38 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | BitcoinDark 3 | ============================ 4 | 5 | 6 | What Is BitcoinDark? 7 | ---------------------------- 8 | 9 | BitcoinDark is a Proof of Stake Cryptocurrency. The first two weeks after release will consist of a two week Proof of Work period. 10 | 11 | Why BitcoinDark? 12 | -------------------------- 13 | 14 | It is the goal of the BitcoinDark developers for everyone involved in the Cryptocurrency revolution to have access to the exciting developments that have been taking place. An ASIC-friendly, mixed PoW/PoS coin with eventual anonymous transaction capabilities has been sorely overlooked. 15 | 16 | The BitcoinDark developers believe that progress should never be held back. ASICs use much less energy than GPUs and are orders of magnitude more efficient. The energy used mining Scrypt coins for years to prolong the days of GPU mining was a truly enormous waste of resources on a global scale. Why hold back progress? BitcoinDark encourages it. 17 | 18 | BitcoinDark Specifications 19 | -------------------------- 20 | 21 | **Coin Generation**: Pure Proof of Stake with Proof of Work period upon release 22 | 23 | **Proof of Work Algorithm**: SHA-256 24 | 25 | **Total Number of Coins**: 22 million 26 | 27 | **PoW Block Reward**: 80 BTCD 28 | 29 | **PoW Blocks**: 20,160 30 | 31 | **PoW Target Blocktime**: 1 minute 32 | 33 | **RPC Port**: 14632 34 | 35 | **Port**: 14631 36 | 37 | **Time to Maturity**: 100 Confirmations 38 | 39 | **Proof of Stake Reward**: 5% per year 40 | 41 | **Minimum Coin Stake Age**: 8 hours 42 | 43 | -------------------------------------------------------------------------------- /build/build.h: -------------------------------------------------------------------------------- 1 | // No build information available 2 | #define BUILD_DATE "2014-06-17 14:05:48 -0400" 3 | -------------------------------------------------------------------------------- /contrib/debian/bin/novacoin-qt: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 077 6 | 7 | basedir=~/.novacoin 8 | dbfile="$basedir/DB_CONFIG" 9 | cfgfile="$basedir/novacoin.conf" 10 | 11 | [ -e "$basedir" ] || mkdir "$basedir" 12 | 13 | # Novacoin does not clean up DB log files by default 14 | [ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile" 15 | 16 | exec /usr/lib/novacoin/novacoin-qt "$@" 17 | -------------------------------------------------------------------------------- /contrib/debian/bin/novacoind: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 077 6 | 7 | basedir=~/.novacoin 8 | cfgfile="$basedir/novacoin.conf" 9 | 10 | [ -e "$basedir" ] || mkdir "$basedir" 11 | 12 | [ -e "$cfgfile" ] || perl -le 'print"rpcpassword=",map{(a..z,A..Z,0..9)[rand 62]}0..9' > "$cfgfile" 13 | 14 | exec /usr/lib/novacoin/novacoind "$@" 15 | -------------------------------------------------------------------------------- /contrib/debian/changelog: -------------------------------------------------------------------------------- 1 | novacoin (0.4.0~dfsg-1) unstable; urgency=low 2 | 3 | [ Balthazar ] 4 | * Initial release. 5 | 6 | -- Balthazar Mon, 15 Apr 2013 22:15:22 +0100 7 | -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /contrib/debian/gbp.conf: -------------------------------------------------------------------------------- 1 | # Configuration file for git-buildpackage and friends 2 | 3 | [DEFAULT] 4 | pristine-tar = True 5 | sign-tags = True 6 | -------------------------------------------------------------------------------- /contrib/debian/novacoin-qt.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Name=NovaCoin 4 | Comment=NovaCoin P2P Cryptocurrency 5 | Comment[fr]=NovaCoin, monnaie virtuelle cryptographique pair à pair 6 | Comment[tr]=NovaCoin, eşten eşe kriptografik sanal para birimi 7 | Exec=/usr/bin/novacoin-qt 8 | Terminal=false 9 | Type=Application 10 | Icon=/usr/share/pixmaps/bitcoin80.xpm 11 | MimeType=x-scheme-handler/novacoin; 12 | Categories=Office; 13 | -------------------------------------------------------------------------------- /contrib/debian/novacoin-qt.install: -------------------------------------------------------------------------------- 1 | novacoin-qt usr/bin 2 | share/pixmaps/bitcoin32.xpm usr/share/pixmaps 3 | share/pixmaps/bitcoin80.xpm usr/share/pixmaps 4 | debian/novacoin-qt.desktop usr/share/applications 5 | debian/novacoin-qt.protocol usr/share/kde4/services/ 6 | -------------------------------------------------------------------------------- /contrib/debian/novacoin-qt.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | novacoin-qt: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/debian/novacoin-qt.protocol: -------------------------------------------------------------------------------- 1 | [Protocol] 2 | exec=novacoin-qt '%u' 3 | protocol=novacoin 4 | input=none 5 | output=none 6 | helper=true 7 | listing= 8 | reading=false 9 | writing=false 10 | makedir=false 11 | deleting=false 12 | -------------------------------------------------------------------------------- /contrib/debian/novacoind.examples: -------------------------------------------------------------------------------- 1 | debian/examples/novacoin.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/novacoind.install: -------------------------------------------------------------------------------- 1 | debian/bin/novacoind usr/bin 2 | src/novacoind usr/lib/novacoin 3 | -------------------------------------------------------------------------------- /contrib/debian/novacoind.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Linked code is Expat - only Debian packaging is GPL-2+ 2 | novacoind: possible-gpl-code-linked-with-openssl 3 | -------------------------------------------------------------------------------- /contrib/debian/novacoind.manpages: -------------------------------------------------------------------------------- 1 | debian/manpages/novacoind.1 2 | debian/manpages/novacoin.conf.5 3 | -------------------------------------------------------------------------------- /contrib/debian/patches/README: -------------------------------------------------------------------------------- 1 | 0xxx: Grabbed from upstream development. 2 | 1xxx: Possibly relevant for upstream adoption. 3 | 2xxx: Only relevant for official Debian release. 4 | -------------------------------------------------------------------------------- /contrib/debian/patches/series: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- mode: makefile; coding: utf-8 -*- 3 | 4 | #DEB_MAKE_CHECK_TARGET = test_bitcoin 5 | #build/bitcoind:: 6 | # $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,src/test_bitcoin) 7 | 8 | DEB_INSTALL_EXAMPLES_novacoind += debian/examples/* 9 | DEB_INSTALL_MANPAGES_novacoind += debian/manpages/* 10 | 11 | %: 12 | dh --with bash-completion $@ 13 | 14 | override_dh_auto_build: 15 | cd src; $(MAKE) -f makefile.unix novacoind 16 | $(MAKE) 17 | 18 | override_dh_auto_clean: 19 | if [ -f Makefile ]; then $(MAKE) clean; else rm -rf build/; rm -f novacoin-qt; fi 20 | cd src; $(MAKE) -f makefile.unix clean 21 | 22 | override_dh_auto_configure: 23 | qmake novacoin-qt.pro USE_QRCODE=1 24 | 25 | override_dh_auto_test: 26 | cd src; $(MAKE) -f makefile.unix test_novacoin 27 | src/test_novacoin 28 | 29 | # Ensure wrapper is set executable 30 | binary-post-install/novacoind: 31 | chmod +x $(cdbs_curdestdir)usr/bin/novacoind 32 | binary-post-install/novacoin-qt: 33 | chmod +x $(cdbs_curdestdir)usr/bin/novacoin-qt 34 | -------------------------------------------------------------------------------- /contrib/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /contrib/debian/watch: -------------------------------------------------------------------------------- 1 | # Run the "uscan" command to check for upstream updates and more. 2 | version=4 3 | opts=uversionmangle=s/(\d)(alpha|beta|rc)/$1~$2/,dversionmangle=s/~dfsg\d*// \ 4 | http://githubredir.debian.net/github/CryptoManiac/novacoin v(.*).tar.gz 5 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/README: -------------------------------------------------------------------------------- 1 | Gavin's notes on getting gitian builds up and running: 2 | 3 | You need the right hardware: you need a 64-bit-capable CPU with hardware virtualization support (Intel VT-x or AMD-V). Not all modern CPUs support hardware virtualization. 4 | 5 | You probably need to enable hardware virtualization in your machine's BIOS. 6 | 7 | You need to be running a recent version of 64-bit-Ubuntu, and you need to install several prerequisites: 8 | sudo apt-get install apache2 git apt-cacher-ng python-vm-builder qemu-kvm 9 | 10 | Sanity checks: 11 | sudo service apt-cacher-ng status # Should return apt-cacher-ng is running 12 | ls -l /dev/kvm # Should show a /dev/kvm device 13 | 14 | Once you've got the right hardware and software: 15 | 16 | git clone git://github.com/bitcoin/bitcoin.git 17 | git clone git://github.com/devrandom/gitian-builder.git 18 | mkdir gitian-builder/inputs 19 | wget 'http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.6.tar.gz' -O gitian-builder/inputs/miniupnpc-1.6.tar.gz 20 | 21 | cd gitian-builder 22 | bin/make-base-vm --arch i386 23 | bin/make-base-vm --arch amd64 24 | cd .. 25 | 26 | # To build 27 | cd bitcoin 28 | git pull 29 | cd ../gitian-builder 30 | git pull 31 | ./bin/gbuild --commit bitcoin=HEAD ../bitcoin/contrib/gitian.yml 32 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/boost-win32.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "boost" 3 | suites: 4 | - "lucid" 5 | architectures: 6 | - "i386" 7 | packages: 8 | - "mingw32" 9 | - "faketime" 10 | - "zip" 11 | reference_datetime: "2011-01-30 00:00:00" 12 | remotes: [] 13 | files: 14 | - "boost_1_47_0.tar.bz2" 15 | script: | 16 | TMPDIR="$HOME/tmpdir" 17 | mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include 18 | tar xjf boost_1_47_0.tar.bz2 19 | cd boost_1_47_0 20 | echo "using gcc : 4.4 : i586-mingw32msvc-g++ 21 | : 22 | i586-mingw32msvc-windres 23 | i586-mingw32msvc-ar 24 | -frandom-seed=boost1 25 | ;" > user-config.jam 26 | ./bootstrap.sh --without-icu 27 | ./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage 28 | for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do 29 | mkdir $lib 30 | (cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a) 31 | mv $lib $TMPDIR/bin/$GBUILD_BITS 32 | done 33 | cp -a boost $TMPDIR/include 34 | cd $TMPDIR 35 | export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 36 | export FAKETIME=$REFERENCE_DATETIME 37 | zip -r boost-win32-1.47.0-gitian.zip * 38 | cp boost-win32-1.47.0-gitian.zip $OUTDIR 39 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "ppcoin" 3 | suites: 4 | - "lucid" 5 | architectures: 6 | - "i386" 7 | - "amd64" 8 | packages: 9 | - "libdb4.8++-dev" 10 | - "qt4-qmake" 11 | - "libqt4-dev" 12 | - "libboost-system-dev" 13 | - "libboost-filesystem-dev" 14 | - "libboost-program-options-dev" 15 | - "libboost-thread-dev" 16 | - "libssl-dev" 17 | - "git-core" 18 | - "unzip" 19 | - "pkg-config" 20 | - "libpng12-dev" 21 | reference_datetime: "2011-01-30 00:00:00" 22 | remotes: 23 | - "url": "https://github.com/ppcoin/ppcoin.git" 24 | "dir": "ppcoin" 25 | files: 26 | - "miniupnpc-1.6.tar.gz" 27 | - "qrencode-3.2.0.tar.bz2" 28 | script: | 29 | INSTDIR="$HOME/install" 30 | export LIBRARY_PATH="$INSTDIR/lib" 31 | # 32 | tar xzf miniupnpc-1.6.tar.gz 33 | cd miniupnpc-1.6 34 | INSTALLPREFIX=$INSTDIR make $MAKEOPTS install 35 | cd .. 36 | # 37 | tar xjf qrencode-3.2.0.tar.bz2 38 | cd qrencode-3.2.0 39 | ./configure --prefix=$INSTDIR --enable-static --disable-shared 40 | make $MAKEOPTS install 41 | cd .. 42 | # 43 | cd ppcoin 44 | mkdir -p $OUTDIR/src 45 | git archive HEAD | tar -x -C $OUTDIR/src 46 | cp $OUTDIR/src/doc/README $OUTDIR 47 | cp $OUTDIR/src/COPYING $OUTDIR 48 | cd src 49 | make -f makefile.unix STATIC=1 OPENSSL_INCLUDE_PATH="$INSTDIR/include" OPENSSL_LIB_PATH="$INSTDIR/lib" $MAKEOPTS ppcoind USE_UPNP=1 DEBUGFLAGS= 50 | mkdir -p $OUTDIR/bin/$GBUILD_BITS 51 | install -s ppcoind $OUTDIR/bin/$GBUILD_BITS 52 | # 53 | cd .. 54 | qmake INCLUDEPATH="$INSTDIR/include" LIBS="-L$INSTDIR/lib" RELEASE=1 USE_QRCODE=1 55 | make $MAKEOPTS 56 | install ppcoin-qt $OUTDIR/bin/$GBUILD_BITS 57 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/bluematt-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/gitian-downloader/bluematt-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/devrandom-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/gitian-downloader/devrandom-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/gavinandresen-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/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: bitcoin 3 | urls: 4 | - http://bitcoin.org/bitcoin-latest-linux-gitian.zip 5 | rss: 6 | - url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss 7 | xpath: //item/link/text() 8 | pattern: bitcoin-\d+.\d+.\d+-linux-gitian.zip 9 | signers: 10 | 0A82509767C7D4A5D14DA2301AE1D35043E08E54: 11 | weight: 40 12 | name: BlueMatt 13 | key: bluematt 14 | BF6273FAEF7CC0BA1F562E50989F6B3048A116B5: 15 | weight: 40 16 | name: Devrandom 17 | key: devrandom 18 | E463A93F5F3117EEDE6C7316BD02942421F4889F: 19 | weight: 40 20 | name: Luke-Jr 21 | key: luke-jr 22 | D762373D24904A3E42F33B08B9A408E71DAAC974: 23 | weight: 40 24 | name: "Pieter Wuille" 25 | key: sipa 26 | 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: 27 | weight: 40 28 | name: tcatm 29 | key: tcatm 30 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8: 31 | weight: 40 32 | name: "Gavin Andresen" 33 | key: gavinandresen 34 | 71A3B16735405025D447E8F274810B012346C9A6: 35 | weight: 40 36 | name: "Wladimir J. van der Laan" 37 | key: laanwj 38 | minimum_weight: 120 39 | -------------------------------------------------------------------------------- /contrib/gitian-downloader/luke-jr-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/gitian-downloader/luke-jr-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/sipa-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/gitian-downloader/sipa-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/tcatm-key.pgp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/gitian-downloader/tcatm-key.pgp -------------------------------------------------------------------------------- /contrib/gitian-downloader/win32-download-config: -------------------------------------------------------------------------------- 1 | --- 2 | name: bitcoin 3 | urls: 4 | - http://bitcoin.org/bitcoin-latest-win32-gitian.zip 5 | rss: 6 | - url: http://sourceforge.net/api/file/index/project-id/244765/mtime/desc/limit/100/rss 7 | xpath: //item/link/text() 8 | pattern: bitcoin-\d+.\d+.\d+-win32-gitian.zip 9 | signers: 10 | 0A82509767C7D4A5D14DA2301AE1D35043E08E54: 11 | weight: 40 12 | name: BlueMatt 13 | key: bluematt 14 | BF6273FAEF7CC0BA1F562E50989F6B3048A116B5: 15 | weight: 40 16 | name: Devrandom 17 | key: devrandom 18 | E463A93F5F3117EEDE6C7316BD02942421F4889F: 19 | weight: 40 20 | name: Luke-Jr 21 | key: luke-jr 22 | D762373D24904A3E42F33B08B9A408E71DAAC974: 23 | weight: 40 24 | name: "Pieter Wuille" 25 | key: sipa 26 | 77E72E69DA7EE0A148C06B21B34821D4944DE5F7: 27 | weight: 40 28 | name: tcatm 29 | key: tcatm 30 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8: 31 | weight: 40 32 | name: "Gavin Andresen" 33 | key: gavinandresen 34 | 71A3B16735405025D447E8F274810B012346C9A6: 35 | weight: 40 36 | name: "Wladimir J. van der Laan" 37 | key: laanwj 38 | minimum_weight: 120 39 | -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/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 | NovaCoin-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 NovaCoin-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: NovaCoin-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 "novacoin-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 bitcoin distributions 6 | 7 | import glob 8 | import os 9 | import re 10 | import sys 11 | 12 | if len(sys.argv) != 3: 13 | sys.exit("Usage: %s $QTDIR/translations $BITCOINDIR/src/qt/locale"%sys.argv[0]) 14 | 15 | d1 = sys.argv[1] 16 | d2 = sys.argv[2] 17 | 18 | l1 = set([ re.search(r'qt_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d1, 'qt_*.qm')) ]) 19 | l2 = set([ re.search(r'bitcoin_(.*).qm', f).group(1) for f in glob.glob(os.path.join(d2, 'bitcoin_*.qm')) ]) 20 | 21 | print ",".join(sorted(l1.intersection(l2))) 22 | 23 | -------------------------------------------------------------------------------- /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 | BitcoinDark 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 | BitcoinDark 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/README_windows.txt: -------------------------------------------------------------------------------- 1 | BitcoinDark 0.4.4 BETA 2 | 3 | Copyright (c) 2013 NovaCoin Developers 4 | Copyright (c) 2011-2013 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 | BitcoinDark 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 and scrypt 17 | help further advance the field of crypto-currency. 18 | 19 | -------------------------------------------------------------------------------- /doc/README~: -------------------------------------------------------------------------------- 1 | TestCoin 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 | TestCoin 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/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/doc/bitcoin_logo_doxygen.png -------------------------------------------------------------------------------- /doc/build-osx.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2012 Bitcoin Developers 2 | Distributed under the MIT/X11 software license, see the accompanying file 3 | license.txt or http://www.opensource.org/licenses/mit-license.php. This 4 | product includes software developed by the OpenSSL Project for use in the 5 | OpenSSL Toolkit (http://www.openssl.org/). This product includes cryptographic 6 | software written by Eric Young (eay@cryptsoft.com) and UPnP software written by 7 | Thomas Bernard. 8 | 9 | 10 | Mac OS X Testcoind build instructions 11 | Laszlo Hanyecz 12 | Douglas Huff 13 | 14 | 15 | See readme-qt.rst for instructions on building BitcoinDark QT, the 16 | graphical user interface. 17 | 18 | Tested on 10.5 and 10.6 intel. PPC is not supported because it's big-endian. 19 | 20 | All of the commands should be executed in Terminal.app.. it's in 21 | /Applications/Utilities 22 | 23 | You need to install XCode with all the options checked so that the compiler and 24 | everything is available in /usr not just /Developer I think it comes on the DVD 25 | but you can get the current version from http://developer.apple.com 26 | 27 | 28 | 1. Clone the github tree to get the source code: 29 | 30 | git clone git@github.com:rat4/Testcoin.git Testcoin 31 | 32 | 2. Download and install MacPorts from http://www.macports.org/ 33 | 34 | 2a. (for 10.7 Lion) 35 | Edit /opt/local/etc/macports/macports.conf and uncomment "build_arch i386" 36 | 37 | 3. Install dependencies from MacPorts 38 | 39 | sudo port install boost db48 openssl miniupnpc 40 | 41 | Optionally install qrencode (and set USE_QRCODE=1): 42 | sudo port install qrencode 43 | 44 | 4. Now you should be able to build Testcoind: 45 | 46 | cd Testcoin/src 47 | make -f makefile.osx 48 | 49 | Run: 50 | ./Testcoind --help # for a list of command-line options. 51 | Run 52 | ./Testcoind -daemon # to start the Testcoin daemon. 53 | Run 54 | ./Testcoind help # When the daemon is running, to get a list of RPC commands 55 | -------------------------------------------------------------------------------- /qa/pull-tester/pull-tester.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2013 The Bitcoin Core 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 | # Helper script for pull-tester. 7 | #Param 1: path to bitcoin srcroot 8 | #Param ...: arguments for build-test.sh 9 | 10 | if [ $# -lt 1 ]; then 11 | echo "usage: $0 [bitcoin srcroot] build-test arguments..." 12 | fi 13 | 14 | killall -q bitcoin-cli 15 | killall -q bitcoind 16 | 17 | cd $1 18 | shift 19 | 20 | ./autogen.sh 21 | ./configure 22 | ./qa/pull-tester/build-tests.sh "$@" 23 | -------------------------------------------------------------------------------- /qa/pull-tester/run-bitcoind-for-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2013 The Bitcoin Core 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 | DATADIR="/c/deps/bitcoin-master/.bitcoin" 7 | rm -rf "$DATADIR" 8 | mkdir -p "$DATADIR"/regtest 9 | touch "$DATADIR/regtest/debug.log" 10 | tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & 11 | WAITER=$! 12 | PORT=`expr $BASHPID + 10000` 13 | "/c/deps/bitcoin-master/src/bitcoind.exe" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -regtest -rpcport=`expr $PORT + 1` & 14 | BITCOIND=$! 15 | 16 | #Install a watchdog. 17 | (sleep 10 && kill -0 $WAITER 2>/dev/null && kill -9 $BITCOIND $$)& 18 | wait $WAITER 19 | 20 | if [ -n "$TIMEOUT" ]; then 21 | timeout "$TIMEOUT"s "$@" $PORT 22 | RETURN=$? 23 | else 24 | "$@" $PORT 25 | RETURN=$? 26 | fi 27 | 28 | (sleep 15 && kill -0 $BITCOIND 2>/dev/null && kill -9 $BITCOIND $$)& 29 | kill $BITCOIND && wait $BITCOIND 30 | 31 | # timeout returns 124 on timeout, otherwise the return value of the child 32 | exit $RETURN 33 | -------------------------------------------------------------------------------- /qa/pull-tester/run-bitcoind-for-test.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2013 The Bitcoin Core 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 | DATADIR="@abs_top_builddir@/.bitcoin" 7 | rm -rf "$DATADIR" 8 | mkdir -p "$DATADIR"/regtest 9 | touch "$DATADIR/regtest/debug.log" 10 | tail -q -n 1 -F "$DATADIR/regtest/debug.log" | grep -m 1 -q "Done loading" & 11 | WAITER=$! 12 | PORT=`expr $BASHPID + 10000` 13 | "@abs_top_builddir@/src/bitcoind@EXEEXT@" -connect=0.0.0.0 -datadir="$DATADIR" -rpcuser=user -rpcpassword=pass -listen -keypool=3 -debug -debug=net -logtimestamps -port=$PORT -regtest -rpcport=`expr $PORT + 1` & 14 | BITCOIND=$! 15 | 16 | #Install a watchdog. 17 | (sleep 10 && kill -0 $WAITER 2>/dev/null && kill -9 $BITCOIND $$)& 18 | wait $WAITER 19 | 20 | if [ -n "$TIMEOUT" ]; then 21 | timeout "$TIMEOUT"s "$@" $PORT 22 | RETURN=$? 23 | else 24 | "$@" $PORT 25 | RETURN=$? 26 | fi 27 | 28 | (sleep 15 && kill -0 $BITCOIND 2>/dev/null && kill -9 $BITCOIND $$)& 29 | kill $BITCOIND && wait $BITCOIND 30 | 31 | # timeout returns 124 on timeout, otherwise the return value of the child 32 | exit $RETURN 33 | -------------------------------------------------------------------------------- /qa/rpc-tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | cache 3 | -------------------------------------------------------------------------------- /qa/rpc-tests/README.md: -------------------------------------------------------------------------------- 1 | Regression tests of RPC interface 2 | ================================= 3 | 4 | ### [python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc) 5 | Git subtree of [https://github.com/jgarzik/python-bitcoinrpc](https://github.com/jgarzik/python-bitcoinrpc). 6 | Changes to python-bitcoinrpc should be made upstream, and then 7 | pulled here using git subtree. 8 | 9 | ### [skeleton.py](skeleton.py) 10 | Copy this to create new regression tests. 11 | 12 | ### [listtransactions.py](listtransactions.py) 13 | Tests for the listtransactions RPC call. 14 | 15 | ### [util.py](util.sh) 16 | Generally useful functions. 17 | 18 | Bash-based tests, to be ported to Python: 19 | ----------------------------------------- 20 | - wallet.sh : Exercise wallet send/receive code. 21 | - walletbackup.sh : Exercise wallet backup / dump / import 22 | - txnmall.sh : Test proper accounting of malleable transactions 23 | - conflictedbalance.sh : More testing of malleable transaction handling 24 | 25 | Notes 26 | ===== 27 | 28 | A 200-block -regtest blockchain and wallets for four nodes 29 | is created the first time a regression test is run and 30 | is stored in the cache/ directory. Each node has 25 mature 31 | blocks (25*50=1250 BTC) in their wallet. 32 | 33 | After the first run, the cache/ blockchain and wallets are 34 | copied into a temporary directory and used as the initial 35 | test state. 36 | 37 | If you get into a bad state, you should be able 38 | to recover with: 39 | 40 | ```bash 41 | rm -rf cache 42 | killall bitcoind 43 | ``` 44 | -------------------------------------------------------------------------------- /qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/__init__.py -------------------------------------------------------------------------------- /qa/rpc-tests/python-bitcoinrpc/setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from distutils.core import setup 4 | 5 | setup(name='python-bitcoinrpc', 6 | version='0.1', 7 | description='Enhanced version of python-jsonrpc for use with Bitcoin', 8 | long_description=open('README').read(), 9 | author='Jeff Garzik', 10 | author_email='', 11 | maintainer='Jeff Garzik', 12 | maintainer_email='', 13 | url='http://www.github.com/jgarzik/python-bitcoinrpc', 14 | packages=['bitcoinrpc'], 15 | classifiers=['License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)', 'Operating System :: OS Independent']) 16 | -------------------------------------------------------------------------------- /qa/rpc-tests/send.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2014 The Bitcoin Core 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 | TIMEOUT=10 6 | SIGNAL=HUP 7 | PIDFILE=.send.pid 8 | if [ $# -eq 0 ]; then 9 | echo -e "Usage:\t$0 " 10 | echo -e "\tRuns and wait ${TIMEOUT} seconds or until SIG${SIGNAL} is received." 11 | echo -e "\tReturns: 0 if SIG${SIGNAL} is received, 1 otherwise." 12 | echo -e "Or:\t$0 -STOP" 13 | echo -e "\tsends SIG${SIGNAL} to running send.sh" 14 | exit 0 15 | fi 16 | 17 | if [ $1 == "-STOP" ]; then 18 | if [ -s ${PIDFILE} ]; then 19 | kill -s ${SIGNAL} $(<${PIDFILE}) 20 | fi 21 | exit 0 22 | fi 23 | 24 | trap '[[ ${PID} ]] && kill ${PID}' ${SIGNAL} 25 | trap 'rm -f ${PIDFILE}' EXIT 26 | echo $$ > ${PIDFILE} 27 | "$@" 28 | sleep ${TIMEOUT} & PID=$! 29 | wait ${PID} && exit 1 30 | 31 | exit 0 32 | -------------------------------------------------------------------------------- /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/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/bitcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/bitcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /share/qt/img/reload.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/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/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/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 BitcoinDark Developers 2 | Copyright (c) 2013-2014 NovaCoin Developers 3 | Copyright (c) 2011-2012 PPCoin Developers 4 | Copyright (c) 2009-2014 Bitcoin Developers 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /src/INSTALL: -------------------------------------------------------------------------------- 1 | Building BitcoinDark 2 | 3 | See doc/readme-qt.rst for instructions on building BitcoinDark QT, 4 | the intended-for-end-users, nice-graphical-interface, reference 5 | implementation of BitcoinDark. 6 | 7 | See doc/build-*.txt for instructions on building Testcoind, 8 | the intended-for-services, no-graphical-interface, reference 9 | implementation of BitcoinDark. 10 | -------------------------------------------------------------------------------- /src/README: -------------------------------------------------------------------------------- 1 | README.md -------------------------------------------------------------------------------- /src/README.md: -------------------------------------------------------------------------------- 1 | 2 | BitcoinDark development tree 3 | 4 | BitcoinDark is a PoS-based cryptocurrency. 5 | 6 | Development process 7 | =========================== 8 | 9 | Developers work in their own trees, then submit pull requests when 10 | they think their feature or bug fix is ready. 11 | 12 | The patch will be accepted if there is broad consensus that it is a 13 | good thing. Developers should expect to rework and resubmit patches 14 | if they don't match the project's coding conventions (see coding.txt) 15 | or are controversial. 16 | 17 | The master branch is regularly built and tested, but is not guaranteed 18 | to be completely stable. Tags are regularly created to indicate new 19 | stable release versions of BitcoinDark. 20 | 21 | Feature branches are created when there are major new features being 22 | worked on by several people. 23 | 24 | From time to time a pull request will become outdated. If this occurs, and 25 | the pull is no longer automatically mergeable; a comment on the pull will 26 | be used to issue a warning of closure. The pull will be closed 15 days 27 | after the warning if action is not taken by the author. Pull requests closed 28 | in this manner will have their corresponding issue labeled 'stagnant'. 29 | 30 | Issues with no commits will be given a similar warning, and closed after 31 | 15 days from their last activity. Issues closed in this manner will be 32 | labeled 'stale'. 33 | -------------------------------------------------------------------------------- /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 0 11 | #define CLIENT_VERSION_REVISION 0 12 | #define CLIENT_VERSION_BUILD 0 13 | 14 | // Converts the parameter X to a string after macro replacement on X has been performed. 15 | // Don't merge these into one macro! 16 | #define STRINGIZE(X) DO_STRINGIZE(X) 17 | #define DO_STRINGIZE(X) #X 18 | 19 | #endif // CLIENTVERSION_H 20 | -------------------------------------------------------------------------------- /src/coincontrol.h: -------------------------------------------------------------------------------- 1 | #ifndef COINCONTROL_H 2 | #define COINCONTROL_H 3 | 4 | /** Coin Control Features. */ 5 | class CCoinControl 6 | { 7 | public: 8 | CTxDestination destChange; 9 | 10 | CCoinControl() 11 | { 12 | SetNull(); 13 | } 14 | 15 | void SetNull() 16 | { 17 | destChange = CNoDestination(); 18 | setSelected.clear(); 19 | } 20 | 21 | bool HasSelected() const 22 | { 23 | return (setSelected.size() > 0); 24 | } 25 | 26 | bool IsSelected(const uint256& hash, unsigned int n) const 27 | { 28 | COutPoint outpt(hash, n); 29 | return (setSelected.count(outpt) > 0); 30 | } 31 | 32 | void Select(COutPoint& output) 33 | { 34 | setSelected.insert(output); 35 | } 36 | 37 | void UnSelect(COutPoint& output) 38 | { 39 | setSelected.erase(output); 40 | } 41 | 42 | void UnSelectAll() 43 | { 44 | setSelected.clear(); 45 | } 46 | 47 | void ListSelected(std::vector& vOutpoints) 48 | { 49 | vOutpoints.assign(setSelected.begin(), setSelected.end()); 50 | } 51 | 52 | private: 53 | std::set setSelected; 54 | 55 | }; 56 | 57 | #endif // COINCONTROL_H 58 | -------------------------------------------------------------------------------- /src/compat.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef _BITCOIN_COMPAT_H 6 | #define _BITCOIN_COMPAT_H 1 7 | 8 | #ifdef WIN32 9 | #define _WIN32_WINNT 0x0501 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #ifndef NOMINMAX 12 | #define NOMINMAX 13 | #endif 14 | #include 15 | #include 16 | #include 17 | #else 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | typedef u_int SOCKET; 28 | #endif 29 | 30 | 31 | #ifdef WIN32 32 | #define MSG_NOSIGNAL 0 33 | #define MSG_DONTWAIT 0 34 | typedef int socklen_t; 35 | #else 36 | #include "errno.h" 37 | #define WSAGetLastError() errno 38 | #define WSAEINVAL EINVAL 39 | #define WSAEALREADY EALREADY 40 | #define WSAEWOULDBLOCK EWOULDBLOCK 41 | #define WSAEMSGSIZE EMSGSIZE 42 | #define WSAEINTR EINTR 43 | #define WSAEINPROGRESS EINPROGRESS 44 | #define WSAEADDRINUSE EADDRINUSE 45 | #define WSAENOTSOCK EBADF 46 | #define INVALID_SOCKET (SOCKET)(~0) 47 | #define SOCKET_ERROR -1 48 | #endif 49 | 50 | inline int myclosesocket(SOCKET& hSocket) 51 | { 52 | if (hSocket == INVALID_SOCKET) 53 | return WSAENOTSOCK; 54 | #ifdef WIN32 55 | int ret = closesocket(hSocket); 56 | #else 57 | int ret = close(hSocket); 58 | #endif 59 | hSocket = INVALID_SOCKET; 60 | return ret; 61 | } 62 | #define closesocket(s) myclosesocket(s) 63 | 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2012 The Bitcoin developers 3 | // Distributed under the MIT/X11 software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | #ifndef BITCOIN_INIT_H 6 | #define BITCOIN_INIT_H 7 | 8 | #include "wallet.h" 9 | 10 | extern CWallet* pwalletMain; 11 | void StartShutdown(); 12 | void Shutdown(void* parg); 13 | bool AppInit2(); 14 | std::string HelpMessage(); 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /src/irc.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_IRC_H 6 | #define BITCOIN_IRC_H 7 | 8 | void ThreadIRCSeed(void* parg); 9 | 10 | extern int nGotIRCAddresses; 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /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_stream_reader.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_READ_STREAM 2 | #define JSON_SPIRIT_READ_STREAM 3 | 4 | // Copyright John W. Wilkinson 2007 - 2009. 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.03 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | # pragma once 11 | #endif 12 | 13 | #include "json_spirit_reader_template.h" 14 | 15 | namespace json_spirit 16 | { 17 | // these classes allows you to read multiple top level contiguous values from a stream, 18 | // the normal stream read functions have a bug that prevent multiple top level values 19 | // from being read unless they are separated by spaces 20 | 21 | template< class Istream_type, class Value_type > 22 | class Stream_reader 23 | { 24 | public: 25 | 26 | Stream_reader( Istream_type& is ) 27 | : iters_( is ) 28 | { 29 | } 30 | 31 | bool read_next( Value_type& value ) 32 | { 33 | return read_range( iters_.begin_, iters_.end_, value ); 34 | } 35 | 36 | private: 37 | 38 | typedef Multi_pass_iters< Istream_type > Mp_iters; 39 | 40 | Mp_iters iters_; 41 | }; 42 | 43 | template< class Istream_type, class Value_type > 44 | class Stream_reader_thrower 45 | { 46 | public: 47 | 48 | Stream_reader_thrower( Istream_type& is ) 49 | : iters_( is ) 50 | , posn_begin_( iters_.begin_, iters_.end_ ) 51 | , posn_end_( iters_.end_, iters_.end_ ) 52 | { 53 | } 54 | 55 | void read_next( Value_type& value ) 56 | { 57 | posn_begin_ = read_range_or_throw( posn_begin_, posn_end_, value ); 58 | } 59 | 60 | private: 61 | 62 | typedef Multi_pass_iters< Istream_type > Mp_iters; 63 | typedef spirit_namespace::position_iterator< typename Mp_iters::Mp_iter > Posn_iter_t; 64 | 65 | Mp_iters iters_; 66 | Posn_iter_t posn_begin_, posn_end_; 67 | }; 68 | } 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /src/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/kernel.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 The PPCoin 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 PPCOIN_KERNEL_H 5 | #define PPCOIN_KERNEL_H 6 | 7 | #include "main.h" 8 | 9 | // MODIFIER_INTERVAL: time to elapse before new modifier is computed 10 | extern unsigned int nModifierInterval; 11 | 12 | // MODIFIER_INTERVAL_RATIO: 13 | // ratio of group interval length between the last group and the first group 14 | static const int MODIFIER_INTERVAL_RATIO = 3; 15 | 16 | // Compute the hash modifier for proof-of-stake 17 | bool ComputeNextStakeModifier(const CBlockIndex* pindexPrev, uint64_t& nStakeModifier, bool& fGeneratedStakeModifier); 18 | 19 | // Check whether stake kernel meets hash target 20 | // Sets hashProofOfStake on success return 21 | bool CheckStakeKernelHash(unsigned int nBits, const CBlock& blockFrom, unsigned int nTxPrevOffset, const CTransaction& txPrev, const COutPoint& prevout, unsigned int nTimeTx, uint256& hashProofOfStake, uint256& targetProofOfStake, bool fPrintProofOfStake=false); 22 | 23 | // Check kernel hash target and coinstake signature 24 | // Sets hashProofOfStake on success return 25 | bool CheckProofOfStake(const CTransaction& tx, unsigned int nBits, uint256& hashProofOfStake, uint256& targetProofOfStake); 26 | 27 | // Check whether the coinstake timestamp meets protocol 28 | bool CheckCoinStakeTimestamp(int64_t nTimeBlock, int64_t nTimeTx); 29 | 30 | // Get stake modifier checksum 31 | unsigned int GetStakeModifierChecksum(const CBlockIndex* pindex); 32 | 33 | // Check stake modifier hard checkpoints 34 | bool CheckStakeModifierCheckpoints(int nHeight, unsigned int nStakeModifierChecksum); 35 | 36 | // Get time weight using supplied timestamps 37 | int64_t GetWeight(int64_t nIntervalBeginning, int64_t nIntervalEnd); 38 | 39 | #endif // PPCOIN_KERNEL_H 40 | -------------------------------------------------------------------------------- /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/README: -------------------------------------------------------------------------------- 1 | leveldb: A key-value store 2 | Authors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com) 3 | 4 | The code under this directory implements a system for maintaining a 5 | persistent key/value store. 6 | 7 | See doc/index.html for more explanation. 8 | See doc/impl.html for a brief overview of the implementation. 9 | 10 | The public interface is in include/*.h. Callers should not include or 11 | rely on the details of any other header files in this package. Those 12 | internal APIs may be changed without warning. 13 | 14 | Guide to header files: 15 | 16 | include/db.h 17 | Main interface to the DB: Start here 18 | 19 | include/options.h 20 | Control over the behavior of an entire database, and also 21 | control over the behavior of individual reads and writes. 22 | 23 | include/comparator.h 24 | Abstraction for user-specified comparison function. If you want 25 | just bytewise comparison of keys, you can use the default comparator, 26 | but clients can write their own comparator implementations if they 27 | want custom ordering (e.g. to handle different character 28 | encodings, etc.) 29 | 30 | include/iterator.h 31 | Interface for iterating over data. You can get an iterator 32 | from a DB object. 33 | 34 | include/write_batch.h 35 | Interface for atomically applying multiple updates to a database. 36 | 37 | include/slice.h 38 | A simple module for maintaining a pointer and a length into some 39 | other byte array. 40 | 41 | include/status.h 42 | Status is returned from many of the public interfaces and is used 43 | to report success and various kinds of errors. 44 | 45 | include/env.h 46 | Abstraction of the OS environment. A posix implementation of 47 | this interface is in util/env_posix.cc 48 | 49 | include/table.h 50 | include/table_builder.h 51 | Lower-level modules that most clients probably won't use directly 52 | -------------------------------------------------------------------------------- /src/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/snapshot.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_SNAPSHOT_H_ 6 | #define STORAGE_LEVELDB_DB_SNAPSHOT_H_ 7 | 8 | #include "leveldb/db.h" 9 | 10 | namespace leveldb { 11 | 12 | class SnapshotList; 13 | 14 | // Snapshots are kept in a doubly-linked list in the DB. 15 | // Each SnapshotImpl corresponds to a particular sequence number. 16 | class SnapshotImpl : public Snapshot { 17 | public: 18 | SequenceNumber number_; // const after creation 19 | 20 | private: 21 | friend class SnapshotList; 22 | 23 | // SnapshotImpl is kept in a doubly-linked circular list 24 | SnapshotImpl* prev_; 25 | SnapshotImpl* next_; 26 | 27 | SnapshotList* list_; // just for sanity checks 28 | }; 29 | 30 | class SnapshotList { 31 | public: 32 | SnapshotList() { 33 | list_.prev_ = &list_; 34 | list_.next_ = &list_; 35 | } 36 | 37 | bool empty() const { return list_.next_ == &list_; } 38 | SnapshotImpl* oldest() const { assert(!empty()); return list_.next_; } 39 | SnapshotImpl* newest() const { assert(!empty()); return list_.prev_; } 40 | 41 | const SnapshotImpl* New(SequenceNumber seq) { 42 | SnapshotImpl* s = new SnapshotImpl; 43 | s->number_ = seq; 44 | s->list_ = this; 45 | s->next_ = &list_; 46 | s->prev_ = list_.prev_; 47 | s->prev_->next_ = s; 48 | s->next_->prev_ = s; 49 | return s; 50 | } 51 | 52 | void Delete(const SnapshotImpl* s) { 53 | assert(s->list_ == this); 54 | s->prev_->next_ = s->next_; 55 | s->next_->prev_ = s->prev_; 56 | delete s; 57 | } 58 | 59 | private: 60 | // Dummy head of doubly-linked list of snapshots 61 | SnapshotImpl list_; 62 | }; 63 | 64 | } // namespace leveldb 65 | 66 | #endif // STORAGE_LEVELDB_DB_SNAPSHOT_H_ 67 | -------------------------------------------------------------------------------- /src/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/issues/issue200_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 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 | // Test for issue 200: when iterator switches direction from backward 6 | // to forward, the current key can be yielded unexpectedly if a new 7 | // mutation has been added just before the current key. 8 | 9 | #include "leveldb/db.h" 10 | #include "util/testharness.h" 11 | 12 | namespace leveldb { 13 | 14 | class Issue200 { }; 15 | 16 | TEST(Issue200, Test) { 17 | // Get rid of any state from an old run. 18 | std::string dbpath = test::TmpDir() + "/leveldb_issue200_test"; 19 | DestroyDB(dbpath, Options()); 20 | 21 | DB *db; 22 | Options options; 23 | options.create_if_missing = true; 24 | ASSERT_OK(DB::Open(options, dbpath, &db)); 25 | 26 | WriteOptions write_options; 27 | ASSERT_OK(db->Put(write_options, "1", "b")); 28 | ASSERT_OK(db->Put(write_options, "2", "c")); 29 | ASSERT_OK(db->Put(write_options, "3", "d")); 30 | ASSERT_OK(db->Put(write_options, "4", "e")); 31 | ASSERT_OK(db->Put(write_options, "5", "f")); 32 | 33 | ReadOptions read_options; 34 | Iterator *iter = db->NewIterator(read_options); 35 | 36 | // Add an element that should not be reflected in the iterator. 37 | ASSERT_OK(db->Put(write_options, "25", "cd")); 38 | 39 | iter->Seek("5"); 40 | ASSERT_EQ(iter->key().ToString(), "5"); 41 | iter->Prev(); 42 | ASSERT_EQ(iter->key().ToString(), "4"); 43 | iter->Prev(); 44 | ASSERT_EQ(iter->key().ToString(), "3"); 45 | iter->Next(); 46 | ASSERT_EQ(iter->key().ToString(), "4"); 47 | iter->Next(); 48 | ASSERT_EQ(iter->key().ToString(), "5"); 49 | 50 | delete iter; 51 | delete db; 52 | DestroyDB(dbpath, options); 53 | } 54 | 55 | } // namespace leveldb 56 | 57 | int main(int argc, char** argv) { 58 | return leveldb::test::RunAllTests(); 59 | } 60 | -------------------------------------------------------------------------------- /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/block_builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 7 | 8 | #include 9 | 10 | #include 11 | #include "leveldb/slice.h" 12 | 13 | namespace leveldb { 14 | 15 | struct Options; 16 | 17 | class BlockBuilder { 18 | public: 19 | explicit BlockBuilder(const Options* options); 20 | 21 | // Reset the contents as if the BlockBuilder was just constructed. 22 | void Reset(); 23 | 24 | // REQUIRES: Finish() has not been callled since the last call to Reset(). 25 | // REQUIRES: key is larger than any previously added key 26 | void Add(const Slice& key, const Slice& value); 27 | 28 | // Finish building the block and return a slice that refers to the 29 | // block contents. The returned slice will remain valid for the 30 | // lifetime of this builder or until Reset() is called. 31 | Slice Finish(); 32 | 33 | // Returns an estimate of the current (uncompressed) size of the block 34 | // we are building. 35 | size_t CurrentSizeEstimate() const; 36 | 37 | // Return true iff no entries have been added since the last Reset() 38 | bool empty() const { 39 | return buffer_.empty(); 40 | } 41 | 42 | private: 43 | const Options* options_; 44 | std::string buffer_; // Destination buffer 45 | std::vector restarts_; // Restart points 46 | int counter_; // Number of entries emitted since restart 47 | bool finished_; // Has Finish() been called? 48 | std::string last_key_; 49 | 50 | // No copying allowed 51 | BlockBuilder(const BlockBuilder&); 52 | void operator=(const BlockBuilder&); 53 | }; 54 | 55 | } // namespace leveldb 56 | 57 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_BUILDER_H_ 58 | -------------------------------------------------------------------------------- /src/leveldb/table/iterator.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "leveldb/iterator.h" 6 | 7 | namespace leveldb { 8 | 9 | Iterator::Iterator() { 10 | cleanup_.function = NULL; 11 | cleanup_.next = NULL; 12 | } 13 | 14 | Iterator::~Iterator() { 15 | if (cleanup_.function != NULL) { 16 | (*cleanup_.function)(cleanup_.arg1, cleanup_.arg2); 17 | for (Cleanup* c = cleanup_.next; c != NULL; ) { 18 | (*c->function)(c->arg1, c->arg2); 19 | Cleanup* next = c->next; 20 | delete c; 21 | c = next; 22 | } 23 | } 24 | } 25 | 26 | void Iterator::RegisterCleanup(CleanupFunction func, void* arg1, void* arg2) { 27 | assert(func != NULL); 28 | Cleanup* c; 29 | if (cleanup_.function == NULL) { 30 | c = &cleanup_; 31 | } else { 32 | c = new Cleanup; 33 | c->next = cleanup_.next; 34 | cleanup_.next = c; 35 | } 36 | c->function = func; 37 | c->arg1 = arg1; 38 | c->arg2 = arg2; 39 | } 40 | 41 | namespace { 42 | class EmptyIterator : public Iterator { 43 | public: 44 | EmptyIterator(const Status& s) : status_(s) { } 45 | virtual bool Valid() const { return false; } 46 | virtual void Seek(const Slice& target) { } 47 | virtual void SeekToFirst() { } 48 | virtual void SeekToLast() { } 49 | virtual void Next() { assert(false); } 50 | virtual void Prev() { assert(false); } 51 | Slice key() const { assert(false); return Slice(); } 52 | Slice value() const { assert(false); return Slice(); } 53 | virtual Status status() const { return status_; } 54 | private: 55 | Status status_; 56 | }; 57 | } // namespace 58 | 59 | Iterator* NewEmptyIterator() { 60 | return new EmptyIterator(Status::OK()); 61 | } 62 | 63 | Iterator* NewErrorIterator(const Status& status) { 64 | return new EmptyIterator(status); 65 | } 66 | 67 | } // namespace leveldb 68 | -------------------------------------------------------------------------------- /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/arena_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/arena.h" 6 | 7 | #include "util/random.h" 8 | #include "util/testharness.h" 9 | 10 | namespace leveldb { 11 | 12 | class ArenaTest { }; 13 | 14 | TEST(ArenaTest, Empty) { 15 | Arena arena; 16 | } 17 | 18 | TEST(ArenaTest, Simple) { 19 | std::vector > allocated; 20 | Arena arena; 21 | const int N = 100000; 22 | size_t bytes = 0; 23 | Random rnd(301); 24 | for (int i = 0; i < N; i++) { 25 | size_t s; 26 | if (i % (N / 10) == 0) { 27 | s = i; 28 | } else { 29 | s = rnd.OneIn(4000) ? rnd.Uniform(6000) : 30 | (rnd.OneIn(10) ? rnd.Uniform(100) : rnd.Uniform(20)); 31 | } 32 | if (s == 0) { 33 | // Our arena disallows size 0 allocations. 34 | s = 1; 35 | } 36 | char* r; 37 | if (rnd.OneIn(10)) { 38 | r = arena.AllocateAligned(s); 39 | } else { 40 | r = arena.Allocate(s); 41 | } 42 | 43 | for (size_t b = 0; b < s; b++) { 44 | // Fill the "i"th allocation with a known bit pattern 45 | r[b] = i % 256; 46 | } 47 | bytes += s; 48 | allocated.push_back(std::make_pair(s, r)); 49 | ASSERT_GE(arena.MemoryUsage(), bytes); 50 | if (i > N/10) { 51 | ASSERT_LE(arena.MemoryUsage(), bytes * 1.10); 52 | } 53 | } 54 | for (size_t i = 0; i < allocated.size(); i++) { 55 | size_t num_bytes = allocated[i].first; 56 | const char* p = allocated[i].second; 57 | for (size_t b = 0; b < num_bytes; b++) { 58 | // Check the "i"th allocation for the known bit pattern 59 | ASSERT_EQ(int(p[b]) & 0xff, i % 256); 60 | } 61 | } 62 | } 63 | 64 | } // namespace leveldb 65 | 66 | int main(int argc, char** argv) { 67 | return leveldb::test::RunAllTests(); 68 | } 69 | -------------------------------------------------------------------------------- /src/leveldb/util/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/crc32c_test.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/crc32c.h" 6 | #include "util/testharness.h" 7 | 8 | namespace leveldb { 9 | namespace crc32c { 10 | 11 | class CRC { }; 12 | 13 | TEST(CRC, StandardResults) { 14 | // From rfc3720 section B.4. 15 | char buf[32]; 16 | 17 | memset(buf, 0, sizeof(buf)); 18 | ASSERT_EQ(0x8a9136aa, Value(buf, sizeof(buf))); 19 | 20 | memset(buf, 0xff, sizeof(buf)); 21 | ASSERT_EQ(0x62a8ab43, Value(buf, sizeof(buf))); 22 | 23 | for (int i = 0; i < 32; i++) { 24 | buf[i] = i; 25 | } 26 | ASSERT_EQ(0x46dd794e, Value(buf, sizeof(buf))); 27 | 28 | for (int i = 0; i < 32; i++) { 29 | buf[i] = 31 - i; 30 | } 31 | ASSERT_EQ(0x113fdb5c, Value(buf, sizeof(buf))); 32 | 33 | unsigned char data[48] = { 34 | 0x01, 0xc0, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 38 | 0x14, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x04, 0x00, 40 | 0x00, 0x00, 0x00, 0x14, 41 | 0x00, 0x00, 0x00, 0x18, 42 | 0x28, 0x00, 0x00, 0x00, 43 | 0x00, 0x00, 0x00, 0x00, 44 | 0x02, 0x00, 0x00, 0x00, 45 | 0x00, 0x00, 0x00, 0x00, 46 | }; 47 | ASSERT_EQ(0xd9963a56, Value(reinterpret_cast(data), sizeof(data))); 48 | } 49 | 50 | TEST(CRC, Values) { 51 | ASSERT_NE(Value("a", 1), Value("foo", 3)); 52 | } 53 | 54 | TEST(CRC, Extend) { 55 | ASSERT_EQ(Value("hello world", 11), 56 | Extend(Value("hello ", 6), "world", 5)); 57 | } 58 | 59 | TEST(CRC, Mask) { 60 | uint32_t crc = Value("foo", 3); 61 | ASSERT_NE(crc, Mask(crc)); 62 | ASSERT_NE(crc, Mask(Mask(crc))); 63 | ASSERT_EQ(crc, Unmask(Mask(crc))); 64 | ASSERT_EQ(crc, Unmask(Unmask(Mask(Mask(crc))))); 65 | } 66 | 67 | } // namespace crc32c 68 | } // namespace leveldb 69 | 70 | int main(int argc, char** argv) { 71 | return leveldb::test::RunAllTests(); 72 | } 73 | -------------------------------------------------------------------------------- /src/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/testharness.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #include "util/testharness.h" 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace leveldb { 13 | namespace test { 14 | 15 | namespace { 16 | struct Test { 17 | const char* base; 18 | const char* name; 19 | void (*func)(); 20 | }; 21 | std::vector* tests; 22 | } 23 | 24 | bool RegisterTest(const char* base, const char* name, void (*func)()) { 25 | if (tests == NULL) { 26 | tests = new std::vector; 27 | } 28 | Test t; 29 | t.base = base; 30 | t.name = name; 31 | t.func = func; 32 | tests->push_back(t); 33 | return true; 34 | } 35 | 36 | int RunAllTests() { 37 | const char* matcher = getenv("LEVELDB_TESTS"); 38 | 39 | int num = 0; 40 | if (tests != NULL) { 41 | for (size_t i = 0; i < tests->size(); i++) { 42 | const Test& t = (*tests)[i]; 43 | if (matcher != NULL) { 44 | std::string name = t.base; 45 | name.push_back('.'); 46 | name.append(t.name); 47 | if (strstr(name.c_str(), matcher) == NULL) { 48 | continue; 49 | } 50 | } 51 | fprintf(stderr, "==== Test %s.%s\n", t.base, t.name); 52 | (*t.func)(); 53 | ++num; 54 | } 55 | } 56 | fprintf(stderr, "==== PASSED %d tests\n", num); 57 | return 0; 58 | } 59 | 60 | std::string TmpDir() { 61 | std::string dir; 62 | Status s = Env::Default()->GetTestDirectory(&dir); 63 | ASSERT_TRUE(s.ok()) << s.ToString(); 64 | return dir; 65 | } 66 | 67 | int RandomSeed() { 68 | const char* env = getenv("TEST_RANDOM_SEED"); 69 | int result = (env != NULL ? atoi(env) : 301); 70 | if (result <= 0) { 71 | result = 301; 72 | } 73 | return result; 74 | } 75 | 76 | } // namespace test 77 | } // namespace leveldb 78 | -------------------------------------------------------------------------------- /src/leveldb/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/leveldb/util/testutil.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 6 | #define STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 7 | 8 | #include "leveldb/env.h" 9 | #include "leveldb/slice.h" 10 | #include "util/random.h" 11 | 12 | namespace leveldb { 13 | namespace test { 14 | 15 | // Store in *dst a random string of length "len" and return a Slice that 16 | // references the generated data. 17 | extern Slice RandomString(Random* rnd, int len, std::string* dst); 18 | 19 | // Return a random key with the specified length that may contain interesting 20 | // characters (e.g. \x00, \xff, etc.). 21 | extern std::string RandomKey(Random* rnd, int len); 22 | 23 | // Store in *dst a string of length "len" that will compress to 24 | // "N*compressed_fraction" bytes and return a Slice that references 25 | // the generated data. 26 | extern Slice CompressibleString(Random* rnd, double compressed_fraction, 27 | size_t len, std::string* dst); 28 | 29 | // A wrapper that allows injection of errors. 30 | class ErrorEnv : public EnvWrapper { 31 | public: 32 | bool writable_file_error_; 33 | int num_writable_file_errors_; 34 | 35 | ErrorEnv() : EnvWrapper(Env::Default()), 36 | writable_file_error_(false), 37 | num_writable_file_errors_(0) { } 38 | 39 | virtual Status NewWritableFile(const std::string& fname, 40 | WritableFile** result) { 41 | if (writable_file_error_) { 42 | ++num_writable_file_errors_; 43 | *result = NULL; 44 | return Status::IOError(fname, "fake error"); 45 | } 46 | return target()->NewWritableFile(fname, result); 47 | } 48 | }; 49 | 50 | } // namespace test 51 | } // namespace leveldb 52 | 53 | #endif // STORAGE_LEVELDB_UTIL_TESTUTIL_H_ 54 | -------------------------------------------------------------------------------- /src/liblto_plugin-0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/liblto_plugin-0.dll -------------------------------------------------------------------------------- /src/m4/bitcoin_subdir_to_include.m4: -------------------------------------------------------------------------------- 1 | dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE]) 2 | dnl SUBDIRECTORY-NAME must end with a path separator 3 | AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ 4 | if test "x$2" = "x"; then 5 | AC_MSG_RESULT([default]) 6 | else 7 | echo "#include <$2$3.h>" >conftest.cpp 8 | newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] 9 | AC_MSG_RESULT([${newinclpath}]) 10 | if test "x${newinclpath}" != "x"; then 11 | eval "$1=\"\$$1\"' -I${newinclpath}'" 12 | fi 13 | fi 14 | ]) 15 | -------------------------------------------------------------------------------- /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(CWallet* pwallet, 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 | #include "ui_interface.h" 6 | #include "init.h" 7 | #include "bitcoinrpc.h" 8 | 9 | #include 10 | 11 | static int noui_ThreadSafeMessageBox(const std::string& message, const std::string& caption, int style) 12 | { 13 | printf("%s: %s\n", caption.c_str(), message.c_str()); 14 | fprintf(stderr, "%s: %s\n", caption.c_str(), message.c_str()); 15 | return 4; 16 | } 17 | 18 | static bool noui_ThreadSafeAskFee(int64_t nFeeRequired, const std::string& strCaption) 19 | { 20 | return true; 21 | } 22 | 23 | void noui_connect() 24 | { 25 | // Connect bitcoind signal handlers 26 | uiInterface.ThreadSafeMessageBox.connect(noui_ThreadSafeMessageBox); 27 | uiInterface.ThreadSafeAskFee.connect(noui_ThreadSafeAskFee); 28 | } 29 | -------------------------------------------------------------------------------- /src/obj-test/.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/askpassphrasedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef ASKPASSPHRASEDIALOG_H 2 | #define ASKPASSPHRASEDIALOG_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class AskPassphraseDialog; 8 | } 9 | 10 | class WalletModel; 11 | 12 | /** Multifunctional dialog to ask for passphrases. Used for encryption, unlocking, and changing the passphrase. 13 | */ 14 | class AskPassphraseDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | enum Mode { 20 | Encrypt, /**< Ask passphrase twice and encrypt */ 21 | UnlockStaking, /**< Ask passphrase and unlock */ 22 | Unlock, /**< Ask passphrase and unlock */ 23 | ChangePass, /**< Ask old passphrase + new passphrase twice */ 24 | Decrypt /**< Ask passphrase and decrypt wallet */ 25 | }; 26 | 27 | explicit AskPassphraseDialog(Mode mode, QWidget *parent = 0); 28 | ~AskPassphraseDialog(); 29 | 30 | void accept(); 31 | 32 | void setModel(WalletModel *model); 33 | 34 | private: 35 | Ui::AskPassphraseDialog *ui; 36 | Mode mode; 37 | WalletModel *model; 38 | bool fCapsLock; 39 | 40 | private slots: 41 | void textChanged(); 42 | bool event(QEvent *event); 43 | bool eventFilter(QObject *, QEvent *event); 44 | }; 45 | 46 | #endif // ASKPASSPHRASEDIALOG_H 47 | -------------------------------------------------------------------------------- /src/qt/bitcoinaddressvalidator.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOINADDRESSVALIDATOR_H 2 | #define BITCOINADDRESSVALIDATOR_H 3 | 4 | #include 5 | 6 | /** Base48 entry widget validator. 7 | Corrects near-miss characters and refuses characters that are no part of base48. 8 | */ 9 | class BitcoinAddressValidator : public QValidator 10 | { 11 | Q_OBJECT 12 | public: 13 | explicit BitcoinAddressValidator(QObject *parent = 0); 14 | 15 | State validate(QString &input, int &pos) const; 16 | 17 | static const int MaxAddressLength = 35; 18 | signals: 19 | 20 | public slots: 21 | 22 | }; 23 | 24 | #endif // BITCOINADDRESSVALIDATOR_H 25 | -------------------------------------------------------------------------------- /src/qt/bitcoinamountfield.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOINFIELD_H 2 | #define BITCOINFIELD_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QDoubleSpinBox; 8 | class QValueComboBox; 9 | QT_END_NAMESPACE 10 | 11 | /** Widget for entering bitcoin amounts. 12 | */ 13 | class BitcoinAmountField: public QWidget 14 | { 15 | Q_OBJECT 16 | Q_PROPERTY(qint64 value READ value WRITE setValue NOTIFY textChanged USER true) 17 | public: 18 | explicit BitcoinAmountField(QWidget *parent = 0); 19 | 20 | qint64 value(bool *valid=0) const; 21 | void setValue(qint64 value); 22 | 23 | /** Mark current value as invalid in UI. */ 24 | void setValid(bool valid); 25 | /** Perform input validation, mark field as invalid if entered value is not valid. */ 26 | bool validate(); 27 | 28 | /** Change unit used to display amount. */ 29 | void setDisplayUnit(int unit); 30 | 31 | /** Make field empty and ready for new input. */ 32 | void clear(); 33 | 34 | /** Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907), 35 | in these cases we have to set it up manually. 36 | */ 37 | QWidget *setupTabChain(QWidget *prev); 38 | 39 | signals: 40 | void textChanged(); 41 | 42 | protected: 43 | /** Intercept focus-in event and ',' key presses */ 44 | bool eventFilter(QObject *object, QEvent *event); 45 | 46 | private: 47 | QDoubleSpinBox *amount; 48 | QValueComboBox *unit; 49 | int currentUnit; 50 | 51 | void setText(const QString &text); 52 | QString text() const; 53 | 54 | private slots: 55 | void unitChanged(int idx); 56 | 57 | }; 58 | 59 | 60 | #endif // BITCOINFIELD_H 61 | -------------------------------------------------------------------------------- /src/qt/clientmodel.h: -------------------------------------------------------------------------------- 1 | #ifndef CLIENTMODEL_H 2 | #define CLIENTMODEL_H 3 | 4 | #include 5 | 6 | class OptionsModel; 7 | class AddressTableModel; 8 | class TransactionTableModel; 9 | class CWallet; 10 | 11 | QT_BEGIN_NAMESPACE 12 | class QDateTime; 13 | class QTimer; 14 | QT_END_NAMESPACE 15 | 16 | /** Model for Bitcoin network client. */ 17 | class ClientModel : public QObject 18 | { 19 | Q_OBJECT 20 | public: 21 | explicit ClientModel(OptionsModel *optionsModel, QObject *parent = 0); 22 | ~ClientModel(); 23 | 24 | OptionsModel *getOptionsModel(); 25 | 26 | int getNumConnections() const; 27 | int getNumBlocks() const; 28 | int getNumBlocksAtStartup(); 29 | 30 | QDateTime getLastBlockDate() const; 31 | 32 | //! Return true if client connected to testnet 33 | bool isTestNet() const; 34 | //! Return true if core is doing initial block download 35 | bool inInitialBlockDownload() const; 36 | //! Return conservative estimate of total number of blocks, or 0 if unknown 37 | int getNumBlocksOfPeers() const; 38 | //! Return warnings to be displayed in status bar 39 | QString getStatusBarWarnings() const; 40 | 41 | QString formatFullVersion() const; 42 | QString formatBuildDate() const; 43 | QString clientName() const; 44 | QString formatClientStartupTime() const; 45 | 46 | private: 47 | OptionsModel *optionsModel; 48 | 49 | int cachedNumBlocks; 50 | int cachedNumBlocksOfPeers; 51 | 52 | int numBlocksAtStartup; 53 | 54 | QTimer *pollTimer; 55 | 56 | void subscribeToCoreSignals(); 57 | void unsubscribeFromCoreSignals(); 58 | signals: 59 | void numConnectionsChanged(int count); 60 | void numBlocksChanged(int count, int countOfPeers); 61 | 62 | //! Asynchronous error notification 63 | void error(const QString &title, const QString &message, bool modal); 64 | 65 | public slots: 66 | void updateTimer(); 67 | void updateNumConnections(int numConnections); 68 | void updateAlert(const QString &hash, int status); 69 | }; 70 | 71 | #endif // CLIENTMODEL_H 72 | -------------------------------------------------------------------------------- /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.cpp: -------------------------------------------------------------------------------- 1 | #include "csvmodelwriter.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | CSVModelWriter::CSVModelWriter(const QString &filename, QObject *parent) : 8 | QObject(parent), 9 | filename(filename), model(0) 10 | { 11 | } 12 | 13 | void CSVModelWriter::setModel(const QAbstractItemModel *model) 14 | { 15 | this->model = model; 16 | } 17 | 18 | void CSVModelWriter::addColumn(const QString &title, int column, int role) 19 | { 20 | Column col; 21 | col.title = title; 22 | col.column = column; 23 | col.role = role; 24 | 25 | columns.append(col); 26 | } 27 | 28 | static void writeValue(QTextStream &f, const QString &value) 29 | { 30 | QString escaped = value; 31 | escaped.replace('"', "\"\""); 32 | f << "\"" << escaped << "\""; 33 | } 34 | 35 | static void writeSep(QTextStream &f) 36 | { 37 | f << ","; 38 | } 39 | 40 | static void writeNewline(QTextStream &f) 41 | { 42 | f << "\n"; 43 | } 44 | 45 | bool CSVModelWriter::write() 46 | { 47 | QFile file(filename); 48 | if(!file.open(QIODevice::WriteOnly | QIODevice::Text)) 49 | return false; 50 | QTextStream out(&file); 51 | 52 | int numRows = 0; 53 | if(model) 54 | { 55 | numRows = model->rowCount(); 56 | } 57 | 58 | // Header row 59 | for(int i=0; iindex(j, columns[i].column).data(columns[i].role); 79 | writeValue(out, data.toString()); 80 | } 81 | writeNewline(out); 82 | } 83 | 84 | file.close(); 85 | 86 | return file.error() == QFile::NoError; 87 | } 88 | 89 | -------------------------------------------------------------------------------- /src/qt/csvmodelwriter.h: -------------------------------------------------------------------------------- 1 | #ifndef CSVMODELWRITER_H 2 | #define CSVMODELWRITER_H 3 | 4 | #include 5 | #include 6 | 7 | QT_BEGIN_NAMESPACE 8 | class QAbstractItemModel; 9 | QT_END_NAMESPACE 10 | 11 | /** Export a Qt table model to a CSV file. This is useful for analyzing or post-processing the data in 12 | a spreadsheet. 13 | */ 14 | class CSVModelWriter : public QObject 15 | { 16 | Q_OBJECT 17 | public: 18 | explicit CSVModelWriter(const QString &filename, QObject *parent = 0); 19 | 20 | void setModel(const QAbstractItemModel *model); 21 | void addColumn(const QString &title, int column, int role=Qt::EditRole); 22 | 23 | /** Perform export of the model to CSV. 24 | @returns true on success, false otherwise 25 | */ 26 | bool write(); 27 | 28 | private: 29 | QString filename; 30 | const QAbstractItemModel *model; 31 | 32 | struct Column 33 | { 34 | QString title; 35 | int column; 36 | int role; 37 | }; 38 | QList columns; 39 | 40 | signals: 41 | 42 | public slots: 43 | 44 | }; 45 | 46 | #endif // CSVMODELWRITER_H 47 | -------------------------------------------------------------------------------- /src/qt/editaddressdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef EDITADDRESSDIALOG_H 2 | #define EDITADDRESSDIALOG_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QDataWidgetMapper; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class EditAddressDialog; 12 | } 13 | class AddressTableModel; 14 | 15 | /** Dialog for editing an address and associated information. 16 | */ 17 | class EditAddressDialog : public QDialog 18 | { 19 | Q_OBJECT 20 | 21 | public: 22 | enum Mode { 23 | NewReceivingAddress, 24 | NewSendingAddress, 25 | EditReceivingAddress, 26 | EditSendingAddress 27 | }; 28 | 29 | explicit EditAddressDialog(Mode mode, QWidget *parent = 0); 30 | ~EditAddressDialog(); 31 | 32 | void setModel(AddressTableModel *model); 33 | void loadRow(int row); 34 | 35 | QString getAddress() const; 36 | void setAddress(const QString &address); 37 | 38 | public slots: 39 | void accept(); 40 | 41 | private: 42 | bool saveCurrentRow(); 43 | 44 | Ui::EditAddressDialog *ui; 45 | QDataWidgetMapper *mapper; 46 | Mode mode; 47 | AddressTableModel *model; 48 | 49 | QString address; 50 | }; 51 | 52 | #endif // EDITADDRESSDIALOG_H 53 | -------------------------------------------------------------------------------- /src/qt/forms/transactiondescdialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | TransactionDescDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 620 10 | 250 11 | 12 | 13 | 14 | Transaction details 15 | 16 | 17 | 18 | 19 | 20 | This pane shows a detailed description of the transaction 21 | 22 | 23 | true 24 | 25 | 26 | 27 | 28 | 29 | 30 | Qt::Horizontal 31 | 32 | 33 | QDialogButtonBox::Close 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | buttonBox 43 | accepted() 44 | TransactionDescDialog 45 | accept() 46 | 47 | 48 | 248 49 | 254 50 | 51 | 52 | 157 53 | 274 54 | 55 | 56 | 57 | 58 | buttonBox 59 | rejected() 60 | TransactionDescDialog 61 | reject() 62 | 63 | 64 | 316 65 | 260 66 | 67 | 68 | 286 69 | 274 70 | 71 | 72 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /src/qt/guiconstants.h: -------------------------------------------------------------------------------- 1 | #ifndef GUICONSTANTS_H 2 | #define GUICONSTANTS_H 3 | 4 | /* Milliseconds between model updates */ 5 | static const int MODEL_UPDATE_DELAY = 500; 6 | 7 | /* 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/locale/bitcoin_af_ZA.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_af_ZA.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ar.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ar.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_be_BY.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_be_BY.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_bg.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_bg.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_bs.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_bs.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ca.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ca.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ca@valencia.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ca@valencia.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ca_ES.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ca_ES.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_cs.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_cs.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_cy.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_cy.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_da.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_da.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_de.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_de.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_el_GR.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_el_GR.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_en.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_eo.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_eo.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_es.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_es.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_es_CL.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_es_CL.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_es_DO.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_es_DO.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_es_MX.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_es_MX.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_es_UY.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_es_UY.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_et.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_et.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_eu_ES.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_eu_ES.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_fa.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_fa.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_fa_IR.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_fa_IR.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_fi.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_fi.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_fr.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_fr_CA.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_fr_CA.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_gl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_gl.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_he.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_he.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_hi_IN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_hi_IN.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_hr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_hr.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_hu.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_hu.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_id_ID.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_id_ID.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_it.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_it.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ja.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ja.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ka.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ka.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_kk_KZ.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_kk_KZ.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ko_KR.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ko_KR.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ky.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ky.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_la.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_la.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_lt.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_lt.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_lv_LV.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_lv_LV.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ms_MY.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ms_MY.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_nb.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_nb.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_nl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_nl.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_pam.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_pam.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_pl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_pl.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_pt_BR.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_pt_BR.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_pt_PT.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_pt_PT.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ro_RO.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ro_RO.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ru.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ru.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sah.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sah.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sk.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sk.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sl_SI.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sl_SI.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sq.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sq.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sr.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_sv.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_sv.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_th_TH.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_th_TH.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_tr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_tr.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_uk.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_uk.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_ur_PK.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_ur_PK.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_vi.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_vi.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_vi_VN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_vi_VN.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_zh_CN.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_zh_CN.qm -------------------------------------------------------------------------------- /src/qt/locale/bitcoin_zh_TW.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/locale/bitcoin_zh_TW.qm -------------------------------------------------------------------------------- /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/monitoreddatamapper.cpp: -------------------------------------------------------------------------------- 1 | #include "monitoreddatamapper.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | MonitoredDataMapper::MonitoredDataMapper(QObject *parent) : 8 | QDataWidgetMapper(parent) 9 | { 10 | } 11 | 12 | 13 | void MonitoredDataMapper::addMapping(QWidget *widget, int section) 14 | { 15 | QDataWidgetMapper::addMapping(widget, section); 16 | addChangeMonitor(widget); 17 | } 18 | 19 | void MonitoredDataMapper::addMapping(QWidget *widget, int section, const QByteArray &propertyName) 20 | { 21 | QDataWidgetMapper::addMapping(widget, section, propertyName); 22 | addChangeMonitor(widget); 23 | } 24 | 25 | void MonitoredDataMapper::addChangeMonitor(QWidget *widget) 26 | { 27 | // Watch user property of widget for changes, and connect 28 | // the signal to our viewModified signal. 29 | QMetaProperty prop = widget->metaObject()->userProperty(); 30 | int signal = prop.notifySignalIndex(); 31 | int method = this->metaObject()->indexOfMethod("viewModified()"); 32 | if(signal != -1 && method != -1) 33 | { 34 | QMetaObject::connect(widget, signal, this, method); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/qt/monitoreddatamapper.h: -------------------------------------------------------------------------------- 1 | #ifndef MONITOREDDATAMAPPER_H 2 | #define MONITOREDDATAMAPPER_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QWidget; 8 | QT_END_NAMESPACE 9 | 10 | /** Data to Widget mapper that watches for edits and notifies listeners when a field is edited. 11 | This can be used, for example, to enable a commit/apply button in a configuration dialog. 12 | */ 13 | class MonitoredDataMapper : public QDataWidgetMapper 14 | { 15 | Q_OBJECT 16 | public: 17 | explicit MonitoredDataMapper(QObject *parent=0); 18 | 19 | void addMapping(QWidget *widget, int section); 20 | void addMapping(QWidget *widget, int section, const QByteArray &propertyName); 21 | private: 22 | void addChangeMonitor(QWidget *widget); 23 | 24 | signals: 25 | void viewModified(); 26 | 27 | }; 28 | 29 | 30 | 31 | #endif // MONITOREDDATAMAPPER_H 32 | -------------------------------------------------------------------------------- /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/overviewpage.h: -------------------------------------------------------------------------------- 1 | #ifndef OVERVIEWPAGE_H 2 | #define OVERVIEWPAGE_H 3 | 4 | #include 5 | 6 | QT_BEGIN_NAMESPACE 7 | class QModelIndex; 8 | QT_END_NAMESPACE 9 | 10 | namespace Ui { 11 | class OverviewPage; 12 | } 13 | class WalletModel; 14 | class TxViewDelegate; 15 | class TransactionFilterProxy; 16 | 17 | /** Overview ("home") page widget */ 18 | class OverviewPage : public QWidget 19 | { 20 | Q_OBJECT 21 | 22 | public: 23 | explicit OverviewPage(QWidget *parent = 0); 24 | ~OverviewPage(); 25 | 26 | void setModel(WalletModel *model); 27 | void showOutOfSyncWarning(bool fShow); 28 | 29 | public slots: 30 | void setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBalance, qint64 immatureBalance); 31 | 32 | signals: 33 | void transactionClicked(const QModelIndex &index); 34 | 35 | private: 36 | Ui::OverviewPage *ui; 37 | WalletModel *model; 38 | qint64 currentBalance; 39 | qint64 currentStake; 40 | qint64 currentUnconfirmedBalance; 41 | qint64 currentImmatureBalance; 42 | 43 | TxViewDelegate *txdelegate; 44 | TransactionFilterProxy *filter; 45 | 46 | private slots: 47 | void updateDisplayUnit(); 48 | void handleTransactionClicked(const QModelIndex &index); 49 | }; 50 | 51 | #endif // OVERVIEWPAGE_H 52 | -------------------------------------------------------------------------------- /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/qtipcserver.h: -------------------------------------------------------------------------------- 1 | #ifndef QTIPCSERVER_H 2 | #define QTIPCSERVER_H 3 | 4 | // Define BitcoinDark-Qt message queue name 5 | #define BITCOINURI_QUEUE_NAME "BitcoinDarkURI" 6 | 7 | void ipcScanRelay(int argc, char *argv[]); 8 | void ipcInit(int argc, char *argv[]); 9 | 10 | #endif // QTIPCSERVER_H 11 | -------------------------------------------------------------------------------- /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 | public: 13 | explicit QValidatedLineEdit(QWidget *parent = 0); 14 | void clear(); 15 | 16 | protected: 17 | void focusInEvent(QFocusEvent *evt); 18 | 19 | private: 20 | bool valid; 21 | 22 | public slots: 23 | void setValid(bool valid); 24 | 25 | private slots: 26 | void markValid(); 27 | }; 28 | 29 | #endif // QVALIDATEDLINEEDIT_H 30 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.cpp: -------------------------------------------------------------------------------- 1 | #include "qvaluecombobox.h" 2 | 3 | QValueComboBox::QValueComboBox(QWidget *parent) : 4 | QComboBox(parent), role(Qt::UserRole) 5 | { 6 | connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(handleSelectionChanged(int))); 7 | } 8 | 9 | QVariant QValueComboBox::value() const 10 | { 11 | return itemData(currentIndex(), role); 12 | } 13 | 14 | void QValueComboBox::setValue(const QVariant &value) 15 | { 16 | setCurrentIndex(findData(value, role)); 17 | } 18 | 19 | void QValueComboBox::setRole(int role) 20 | { 21 | this->role = role; 22 | } 23 | 24 | void QValueComboBox::handleSelectionChanged(int idx) 25 | { 26 | emit valueChanged(); 27 | } 28 | -------------------------------------------------------------------------------- /src/qt/qvaluecombobox.h: -------------------------------------------------------------------------------- 1 | #ifndef QVALUECOMBOBOX_H 2 | #define QVALUECOMBOBOX_H 3 | 4 | #include 5 | #include 6 | 7 | /* QComboBox that can be used with QDataWidgetMapper to select ordinal values from a model. */ 8 | class QValueComboBox : public QComboBox 9 | { 10 | Q_OBJECT 11 | Q_PROPERTY(QVariant value READ value WRITE setValue NOTIFY valueChanged USER true) 12 | public: 13 | explicit QValueComboBox(QWidget *parent = 0); 14 | 15 | QVariant value() const; 16 | void setValue(const QVariant &value); 17 | 18 | /** Specify model role to use as ordinal value (defaults to Qt::UserRole) */ 19 | void setRole(int role); 20 | 21 | signals: 22 | void valueChanged(); 23 | 24 | public slots: 25 | 26 | private: 27 | int role; 28 | 29 | private slots: 30 | void handleSelectionChanged(int idx); 31 | }; 32 | 33 | #endif // QVALUECOMBOBOX_H 34 | -------------------------------------------------------------------------------- /src/qt/res/bitcoin-qt.rc: -------------------------------------------------------------------------------- 1 | IDI_ICON1 ICON DISCARDABLE "icons/novacoin.ico" 2 | 3 | #include // needed for VERSIONINFO 4 | #include "../../clientversion.h" // holds the needed client version information 5 | 6 | #define VER_PRODUCTVERSION CLIENT_VERSION_MAJOR,CLIENT_VERSION_MINOR,CLIENT_VERSION_REVISION,CLIENT_VERSION_BUILD 7 | #define VER_PRODUCTVERSION_STR STRINGIZE(CLIENT_VERSION_MAJOR) "." STRINGIZE(CLIENT_VERSION_MINOR) "." STRINGIZE(CLIENT_VERSION_REVISION) "." STRINGIZE(CLIENT_VERSION_BUILD) 8 | #define VER_FILEVERSION VER_PRODUCTVERSION 9 | #define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR 10 | 11 | VS_VERSION_INFO VERSIONINFO 12 | FILEVERSION VER_FILEVERSION 13 | PRODUCTVERSION VER_PRODUCTVERSION 14 | FILEOS VOS_NT_WINDOWS32 15 | FILETYPE VFT_APP 16 | BEGIN 17 | BLOCK "StringFileInfo" 18 | BEGIN 19 | BLOCK "040904E4" // U.S. English - multilingual (hex) 20 | BEGIN 21 | VALUE "CompanyName", "BitcoinDark" 22 | VALUE "FileDescription", "BitcoinDark-Qt (OSS GUI client for BitcoinDark)" 23 | VALUE "FileVersion", VER_FILEVERSION_STR 24 | VALUE "InternalName", "BitcoinDark-qt" 25 | VALUE "LegalCopyright", "2009-2014 The Bitcoin developers, 2012-2014 The NovaCoin & PPCoin developers, 2014 The BitcoinDark developers" 26 | VALUE "LegalTrademarks1", "Distributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php." 27 | VALUE "OriginalFilename", "BitcoinDark-qt.exe" 28 | VALUE "ProductName", "BitcoinDark-Qt" 29 | VALUE "ProductVersion", VER_PRODUCTVERSION_STR 30 | END 31 | END 32 | 33 | BLOCK "VarFileInfo" 34 | BEGIN 35 | VALUE "Translation", 0x0, 1252 // language neutral - multilingual (decimal) 36 | END 37 | END 38 | -------------------------------------------------------------------------------- /src/qt/res/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/add.png -------------------------------------------------------------------------------- /src/qt/res/icons/address-book.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/address-book.png -------------------------------------------------------------------------------- /src/qt/res/icons/bitcoin.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/bitcoin.icns -------------------------------------------------------------------------------- /src/qt/res/icons/bitcoin_testnet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/bitcoin_testnet.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/clock1.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/clock2.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/clock3.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/clock4.png -------------------------------------------------------------------------------- /src/qt/res/icons/clock5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/clock5.png -------------------------------------------------------------------------------- /src/qt/res/icons/configure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/configure.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect0_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/connect0_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect1_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/connect1_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect2_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/connect2_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect3_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/connect3_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/connect4_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/connect4_16.png -------------------------------------------------------------------------------- /src/qt/res/icons/debugwindow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/debugwindow.png -------------------------------------------------------------------------------- /src/qt/res/icons/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/edit.png -------------------------------------------------------------------------------- /src/qt/res/icons/editcopy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/editcopy.png -------------------------------------------------------------------------------- /src/qt/res/icons/editpaste.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/editpaste.png -------------------------------------------------------------------------------- /src/qt/res/icons/export.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/export.png -------------------------------------------------------------------------------- /src/qt/res/icons/filesave.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/filesave.png -------------------------------------------------------------------------------- /src/qt/res/icons/history.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/history.png -------------------------------------------------------------------------------- /src/qt/res/icons/key.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/key.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/lock_closed.png -------------------------------------------------------------------------------- /src/qt/res/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/lock_open.png -------------------------------------------------------------------------------- /src/qt/res/icons/notsynced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/notsynced.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin-128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin-128.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin-16.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin-32.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin-48.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin-80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin-80.png -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin.ico -------------------------------------------------------------------------------- /src/qt/res/icons/novacoin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/novacoin.png -------------------------------------------------------------------------------- /src/qt/res/icons/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/overview.png -------------------------------------------------------------------------------- /src/qt/res/icons/qrcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/qrcode.png -------------------------------------------------------------------------------- /src/qt/res/icons/quit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/quit.png -------------------------------------------------------------------------------- /src/qt/res/icons/receive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/receive.png -------------------------------------------------------------------------------- /src/qt/res/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/remove.png -------------------------------------------------------------------------------- /src/qt/res/icons/send.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/send.png -------------------------------------------------------------------------------- /src/qt/res/icons/staking_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/staking_off.png -------------------------------------------------------------------------------- /src/qt/res/icons/staking_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/staking_on.png -------------------------------------------------------------------------------- /src/qt/res/icons/synced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/synced.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/transaction0.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/transaction2.png -------------------------------------------------------------------------------- /src/qt/res/icons/transaction_conflicted.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/transaction_conflicted.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_inout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/tx_inout.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/tx_input.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_mined.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/tx_mined.png -------------------------------------------------------------------------------- /src/qt/res/icons/tx_output.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/icons/tx_output.png -------------------------------------------------------------------------------- /src/qt/res/images/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/images/about.png -------------------------------------------------------------------------------- /src/qt/res/images/splash2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/images/splash2.jpg -------------------------------------------------------------------------------- /src/qt/res/images/splash3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/images/splash3.png -------------------------------------------------------------------------------- /src/qt/res/movies/update_spinner.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laowais/bitcoindark/6278bb569039e174c9848034b57e9febf7ed8bb6/src/qt/res/movies/update_spinner.mng -------------------------------------------------------------------------------- /src/qt/rpcconsole.h: -------------------------------------------------------------------------------- 1 | #ifndef RPCCONSOLE_H 2 | #define RPCCONSOLE_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class RPCConsole; 8 | } 9 | class ClientModel; 10 | 11 | /** Local Bitcoin RPC console. */ 12 | class RPCConsole: public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | explicit RPCConsole(QWidget *parent = 0); 18 | ~RPCConsole(); 19 | 20 | void setClientModel(ClientModel *model); 21 | 22 | enum MessageClass { 23 | MC_ERROR, 24 | MC_DEBUG, 25 | CMD_REQUEST, 26 | CMD_REPLY, 27 | CMD_ERROR 28 | }; 29 | 30 | protected: 31 | virtual bool eventFilter(QObject* obj, QEvent *event); 32 | 33 | private slots: 34 | void on_lineEdit_returnPressed(); 35 | void on_tabWidget_currentChanged(int index); 36 | /** open the debug.log from the current datadir */ 37 | void on_openDebugLogfileButton_clicked(); 38 | /** display messagebox with program parameters (same as bitcoin-qt --help) */ 39 | void on_showCLOptionsButton_clicked(); 40 | 41 | public slots: 42 | void clear(); 43 | void message(int category, const QString &message, bool html = false); 44 | /** Set number of connections shown in the UI */ 45 | void setNumConnections(int count); 46 | /** Set number of blocks shown in the UI */ 47 | void setNumBlocks(int count, int countOfPeers); 48 | /** Go forward or back in history */ 49 | void browseHistory(int offset); 50 | /** Scroll console view to end */ 51 | void scrollToEnd(); 52 | signals: 53 | // For RPC command executor 54 | void stopExecutor(); 55 | void cmdRequest(const QString &command); 56 | 57 | private: 58 | Ui::RPCConsole *ui; 59 | ClientModel *clientModel; 60 | QStringList history; 61 | int historyPtr; 62 | 63 | void startExecutor(); 64 | }; 65 | 66 | #endif // RPCCONSOLE_H 67 | -------------------------------------------------------------------------------- /src/qt/sendcoinsdialog.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDCOINSDIALOG_H 2 | #define SENDCOINSDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class SendCoinsDialog; 9 | } 10 | class WalletModel; 11 | class SendCoinsEntry; 12 | class SendCoinsRecipient; 13 | 14 | QT_BEGIN_NAMESPACE 15 | class QUrl; 16 | QT_END_NAMESPACE 17 | 18 | /** Dialog for sending bitcoins */ 19 | class SendCoinsDialog : public QDialog 20 | { 21 | Q_OBJECT 22 | 23 | public: 24 | explicit SendCoinsDialog(QWidget *parent = 0); 25 | ~SendCoinsDialog(); 26 | 27 | void setModel(WalletModel *model); 28 | 29 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 30 | */ 31 | QWidget *setupTabChain(QWidget *prev); 32 | 33 | void pasteEntry(const SendCoinsRecipient &rv); 34 | bool handleURI(const QString &uri); 35 | 36 | public slots: 37 | void clear(); 38 | void reject(); 39 | void accept(); 40 | SendCoinsEntry *addEntry(); 41 | void updateRemoveEnabled(); 42 | void setBalance(qint64 balance, qint64 stake, qint64 unconfirmedBalance, qint64 immatureBalance); 43 | 44 | private: 45 | Ui::SendCoinsDialog *ui; 46 | WalletModel *model; 47 | bool fNewRecipientAllowed; 48 | 49 | private slots: 50 | void on_sendButton_clicked(); 51 | void removeEntry(SendCoinsEntry* entry); 52 | void updateDisplayUnit(); 53 | void coinControlFeatureChanged(bool); 54 | void coinControlButtonClicked(); 55 | void coinControlChangeChecked(int); 56 | void coinControlChangeEdited(const QString &); 57 | void coinControlUpdateLabels(); 58 | void coinControlClipboardQuantity(); 59 | void coinControlClipboardAmount(); 60 | void coinControlClipboardFee(); 61 | void coinControlClipboardAfterFee(); 62 | void coinControlClipboardBytes(); 63 | void coinControlClipboardPriority(); 64 | void coinControlClipboardLowOutput(); 65 | void coinControlClipboardChange(); 66 | }; 67 | 68 | #endif // SENDCOINSDIALOG_H 69 | -------------------------------------------------------------------------------- /src/qt/sendcoinsentry.h: -------------------------------------------------------------------------------- 1 | #ifndef SENDCOINSENTRY_H 2 | #define SENDCOINSENTRY_H 3 | 4 | #include 5 | 6 | namespace Ui { 7 | class SendCoinsEntry; 8 | } 9 | class WalletModel; 10 | class SendCoinsRecipient; 11 | 12 | /** A single entry in the dialog for sending bitcoins. */ 13 | class SendCoinsEntry : public QFrame 14 | { 15 | Q_OBJECT 16 | 17 | public: 18 | explicit SendCoinsEntry(QWidget *parent = 0); 19 | ~SendCoinsEntry(); 20 | 21 | void setModel(WalletModel *model); 22 | bool validate(); 23 | SendCoinsRecipient getValue(); 24 | 25 | /** Return whether the entry is still empty and unedited */ 26 | bool isClear(); 27 | 28 | void setValue(const SendCoinsRecipient &value); 29 | 30 | /** Set up the tab chain manually, as Qt messes up the tab chain by default in some cases (issue https://bugreports.qt-project.org/browse/QTBUG-10907). 31 | */ 32 | QWidget *setupTabChain(QWidget *prev); 33 | 34 | void setFocus(); 35 | 36 | public slots: 37 | void setRemoveEnabled(bool enabled); 38 | void clear(); 39 | 40 | signals: 41 | void removeEntry(SendCoinsEntry *entry); 42 | void payAmountChanged(); 43 | 44 | private slots: 45 | void on_deleteButton_clicked(); 46 | void on_payTo_textChanged(const QString &address); 47 | void on_addressBookButton_clicked(); 48 | void on_pasteButton_clicked(); 49 | void updateDisplayUnit(); 50 | 51 | private: 52 | Ui::SendCoinsEntry *ui; 53 | WalletModel *model; 54 | }; 55 | 56 | #endif // SENDCOINSENTRY_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 | QT_BEGIN_NAMESPACE 12 | QT_END_NAMESPACE 13 | 14 | class SignVerifyMessageDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit SignVerifyMessageDialog(QWidget *parent = 0); 20 | ~SignVerifyMessageDialog(); 21 | 22 | void setModel(WalletModel *model); 23 | void setAddress_SM(QString address); 24 | void setAddress_VM(QString address); 25 | 26 | void showTab_SM(bool fShow); 27 | void showTab_VM(bool fShow); 28 | 29 | protected: 30 | bool eventFilter(QObject *object, QEvent *event); 31 | 32 | private: 33 | Ui::SignVerifyMessageDialog *ui; 34 | WalletModel *model; 35 | 36 | private slots: 37 | /* sign message */ 38 | void on_addressBookButton_SM_clicked(); 39 | void on_pasteButton_SM_clicked(); 40 | void on_signMessageButton_SM_clicked(); 41 | void on_copySignatureButton_SM_clicked(); 42 | void on_clearButton_SM_clicked(); 43 | /* verify message */ 44 | void on_addressBookButton_VM_clicked(); 45 | void on_verifyMessageButton_VM_clicked(); 46 | void on_clearButton_VM_clicked(); 47 | }; 48 | 49 | #endif // SIGNVERIFYMESSAGEDIALOG_H 50 | -------------------------------------------------------------------------------- /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/transactiondesc.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONDESC_H 2 | #define TRANSACTIONDESC_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class CWallet; 9 | class CWalletTx; 10 | 11 | /** Provide a human-readable extended HTML description of a transaction. 12 | */ 13 | class TransactionDesc: public QObject 14 | { 15 | Q_OBJECT 16 | public: 17 | static QString toHTML(CWallet *wallet, CWalletTx &wtx); 18 | private: 19 | TransactionDesc() {} 20 | 21 | static QString FormatTxStatus(const CWalletTx& wtx); 22 | }; 23 | 24 | #endif // TRANSACTIONDESC_H 25 | -------------------------------------------------------------------------------- /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 | QT_BEGIN_NAMESPACE 10 | class QModelIndex; 11 | QT_END_NAMESPACE 12 | 13 | /** Dialog showing transaction details. */ 14 | class TransactionDescDialog : public QDialog 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | explicit TransactionDescDialog(const QModelIndex &idx, QWidget *parent = 0); 20 | ~TransactionDescDialog(); 21 | 22 | private: 23 | Ui::TransactionDescDialog *ui; 24 | }; 25 | 26 | #endif // TRANSACTIONDESCDIALOG_H 27 | -------------------------------------------------------------------------------- /src/qt/transactionfilterproxy.h: -------------------------------------------------------------------------------- 1 | #ifndef TRANSACTIONFILTERPROXY_H 2 | #define TRANSACTIONFILTERPROXY_H 3 | 4 | #include 5 | #include 6 | 7 | /** Filter the transaction list according to pre-specified rules. */ 8 | class TransactionFilterProxy : public QSortFilterProxyModel 9 | { 10 | Q_OBJECT 11 | public: 12 | explicit TransactionFilterProxy(QObject *parent = 0); 13 | 14 | /** Earliest date that can be represented (far in the past) */ 15 | static const QDateTime MIN_DATE; 16 | /** Last date that can be represented (far in the future) */ 17 | static const QDateTime MAX_DATE; 18 | /** Type filter bit field (all types) */ 19 | static const quint32 ALL_TYPES = 0xFFFFFFFF; 20 | 21 | static quint32 TYPE(int type) { return 1< 5 | 6 | class WalletModel; 7 | class TransactionFilterProxy; 8 | 9 | QT_BEGIN_NAMESPACE 10 | class QTableView; 11 | class QComboBox; 12 | class QLineEdit; 13 | class QModelIndex; 14 | class QMenu; 15 | class QFrame; 16 | class QDateTimeEdit; 17 | QT_END_NAMESPACE 18 | 19 | /** Widget showing the transaction list for a wallet, including a filter row. 20 | Using the filter row, the user can view or export a subset of the transactions. 21 | */ 22 | class TransactionView : public QWidget 23 | { 24 | Q_OBJECT 25 | public: 26 | explicit TransactionView(QWidget *parent = 0); 27 | 28 | void setModel(WalletModel *model); 29 | 30 | // Date ranges for filter 31 | enum DateEnum 32 | { 33 | All, 34 | Today, 35 | ThisWeek, 36 | ThisMonth, 37 | LastMonth, 38 | ThisYear, 39 | Range 40 | }; 41 | 42 | private: 43 | WalletModel *model; 44 | TransactionFilterProxy *transactionProxyModel; 45 | QTableView *transactionView; 46 | 47 | QComboBox *dateWidget; 48 | QComboBox *typeWidget; 49 | QLineEdit *addressWidget; 50 | QLineEdit *amountWidget; 51 | 52 | QMenu *contextMenu; 53 | 54 | QFrame *dateRangeWidget; 55 | QDateTimeEdit *dateFrom; 56 | QDateTimeEdit *dateTo; 57 | 58 | QWidget *createDateRangeWidget(); 59 | 60 | private slots: 61 | void contextualMenu(const QPoint &); 62 | void dateRangeChanged(); 63 | void showDetails(); 64 | void copyAddress(); 65 | void editLabel(); 66 | void copyLabel(); 67 | void copyAmount(); 68 | void copyTxID(); 69 | 70 | signals: 71 | void doubleClicked(const QModelIndex&); 72 | 73 | public slots: 74 | void chooseDate(int idx); 75 | void chooseType(int idx); 76 | void changedPrefix(const QString &prefix); 77 | void changedAmount(const QString &amount); 78 | void exportClicked(); 79 | void focusTransaction(const QModelIndex&); 80 | 81 | }; 82 | 83 | #endif // TRANSACTIONVIEW_H 84 | -------------------------------------------------------------------------------- /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/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 | #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); 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/test_bitcoin.cpp: -------------------------------------------------------------------------------- 1 | #define BOOST_TEST_MODULE Bitcoin Test Suite 2 | #include 3 | 4 | #include "db.h" 5 | #include "main.h" 6 | #include "wallet.h" 7 | 8 | CWallet* pwalletMain; 9 | CClientUIInterface uiInterface; 10 | 11 | extern bool fPrintToConsole; 12 | extern void noui_connect(); 13 | 14 | struct TestingSetup { 15 | TestingSetup() { 16 | fPrintToDebugger = true; // don't want to write to debug.log file 17 | noui_connect(); 18 | bitdb.MakeMock(); 19 | LoadBlockIndex(true); 20 | bool fFirstRun; 21 | pwalletMain = new CWallet("wallet.dat"); 22 | pwalletMain->LoadWallet(fFirstRun); 23 | RegisterWallet(pwalletMain); 24 | } 25 | ~TestingSetup() 26 | { 27 | delete pwalletMain; 28 | pwalletMain = NULL; 29 | bitdb.Flush(true); 30 | } 31 | }; 32 | 33 | BOOST_GLOBAL_FIXTURE(TestingSetup); 34 | 35 | void Shutdown(void* parg) 36 | { 37 | exit(0); 38 | } 39 | 40 | void StartShutdown() 41 | { 42 | exit(0); 43 | } 44 | 45 | -------------------------------------------------------------------------------- /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/version.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 The Bitcoin developers 2 | // Distributed under the MIT/X11 software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | #ifndef BITCOIN_VERSION_H 5 | #define BITCOIN_VERSION_H 6 | 7 | #include "clientversion.h" 8 | #include 9 | 10 | // 11 | // client versioning 12 | // 13 | 14 | static const int CLIENT_VERSION = 15 | 1000000 * CLIENT_VERSION_MAJOR 16 | + 10000 * CLIENT_VERSION_MINOR 17 | + 100 * CLIENT_VERSION_REVISION 18 | + 1 * CLIENT_VERSION_BUILD; 19 | 20 | extern const std::string CLIENT_NAME; 21 | extern const std::string CLIENT_BUILD; 22 | extern const std::string CLIENT_DATE; 23 | 24 | // 25 | // database format versioning 26 | // 27 | static const int DATABASE_VERSION = 70509; 28 | 29 | // 30 | // network protocol versioning 31 | // 32 | 33 | static const int PROTOCOL_VERSION = 60013; 34 | 35 | // intial proto version, to be increased after version/verack negotiation 36 | static const int INIT_PROTO_VERSION = 209; 37 | 38 | // disconnect from peers older than this proto version 39 | static const int MIN_PEER_PROTO_VERSION = 209; 40 | 41 | // nTime field added to CAddress, starting with this version; 42 | // if possible, avoid requesting addresses nodes older than this 43 | static const int CADDR_TIME_VERSION = 31402; 44 | 45 | // only request blocks from nodes outside this range of versions 46 | static const int NOBLKS_VERSION_START = 60002; 47 | static const int NOBLKS_VERSION_END = 60006; 48 | 49 | // BIP 0031, pong message, is enabled for all versions AFTER this one 50 | static const int BIP0031_VERSION = 60000; 51 | 52 | // "mempool" command, enhanced "getdata" behavior starts with this version: 53 | static const int MEMPOOL_GD_VERSION = 60002; 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/zerocoin/Params.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file Params.cpp 3 | * 4 | * @brief Parameter class for Zerocoin. 5 | * 6 | * @author Ian Miers, Christina Garman and Matthew Green 7 | * @date June 2013 8 | * 9 | * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green 10 | * @license This project is released under the MIT license. 11 | **/ 12 | #include "Zerocoin.h" 13 | 14 | namespace libzerocoin { 15 | 16 | Params::Params(Bignum N, uint32_t securityLevel) { 17 | this->zkp_hash_len = securityLevel; 18 | this->zkp_iterations = securityLevel; 19 | 20 | this->accumulatorParams.k_prime = ACCPROOF_KPRIME; 21 | this->accumulatorParams.k_dprime = ACCPROOF_KDPRIME; 22 | 23 | // Generate the parameters 24 | CalculateParams(*this, N, ZEROCOIN_PROTOCOL_VERSION, securityLevel); 25 | 26 | this->accumulatorParams.initialized = true; 27 | this->initialized = true; 28 | } 29 | 30 | AccumulatorAndProofParams::AccumulatorAndProofParams() { 31 | this->initialized = false; 32 | } 33 | 34 | IntegerGroupParams::IntegerGroupParams() { 35 | this->initialized = false; 36 | } 37 | 38 | Bignum IntegerGroupParams::randomElement() const { 39 | // The generator of the group raised 40 | // to a random number less than the order of the group 41 | // provides us with a uniformly distributed random number. 42 | return this->g.pow_mod(Bignum::randBignum(this->groupOrder),this->modulus); 43 | } 44 | 45 | } /* namespace libzerocoin */ 46 | -------------------------------------------------------------------------------- /src/zerocoin/SpendMetaData.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SpendMetaData.cpp 3 | * 4 | * @brief SpendMetaData class for the Zerocoin library. 5 | * 6 | * @author Ian Miers, Christina Garman and Matthew Green 7 | * @date June 2013 8 | * 9 | * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green 10 | * @license This project is released under the MIT license. 11 | **/ 12 | 13 | #include "Zerocoin.h" 14 | 15 | namespace libzerocoin { 16 | 17 | SpendMetaData::SpendMetaData(uint256 accumulatorId, uint256 txHash): accumulatorId(accumulatorId), txHash(txHash) {} 18 | 19 | } /* namespace libzerocoin */ 20 | -------------------------------------------------------------------------------- /src/zerocoin/SpendMetaData.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file SpendMetaData.h 3 | * 4 | * @brief SpendMetaData class for the Zerocoin library. 5 | * 6 | * @author Ian Miers, Christina Garman and Matthew Green 7 | * @date June 2013 8 | * 9 | * @copyright Copyright 2013 Ian Miers, Christina Garman and Matthew Green 10 | * @license This project is released under the MIT license. 11 | **/ 12 | 13 | #ifndef SPENDMETADATA_H_ 14 | #define SPENDMETADATA_H_ 15 | 16 | #include "../uint256.h" 17 | #include "../serialize.h" 18 | 19 | using namespace std; 20 | namespace libzerocoin { 21 | 22 | /** Any meta data needed for actual bitcoin integration. 23 | * Can extended provided the getHash() function is updated 24 | */ 25 | class SpendMetaData { 26 | public: 27 | /** 28 | * Creates meta data associated with a coin spend 29 | * @param accumulatorId hash of block containing accumulator 30 | * @param txHash hash of transaction 31 | */ 32 | SpendMetaData(uint256 accumulatorId, uint256 txHash); 33 | 34 | /** 35 | * The hash of the block containing the accumulator CoinSpend 36 | * proves membership in. 37 | */ 38 | uint256 accumulatorId; // The block the accumulator is in 39 | /**Contains the hash of the rest of transaction 40 | * spending a zerocoin (excluding the coinspend proof) 41 | */ 42 | uint256 txHash; // The Hash of the rest of the transaction the spend proof is n. 43 | // Allows us to sign the transaction. 44 | IMPLEMENT_SERIALIZE 45 | ( 46 | READWRITE(accumulatorId); 47 | READWRITE(txHash); 48 | ) 49 | }; 50 | 51 | } /* namespace libzerocoin */ 52 | #endif /* SPENDMETADATA_H_ */ 53 | -------------------------------------------------------------------------------- /src/zerocoin/ZeroTest.h: -------------------------------------------------------------------------------- 1 | #ifndef ZEROTEST_H_ 2 | #define ZEROTEST_H_ 3 | 4 | void Test_RunAllTests(); 5 | 6 | #endif 7 | --------------------------------------------------------------------------------