├── .gitattributes ├── .github └── ISSUE_TEMPLATE.md ├── .gitignore ├── .travis.yml ├── COPYING ├── Dockerfile ├── INSTALL ├── Makefile.am ├── Makefile.am.patch ├── README-mac.md ├── README.md ├── autogen.sh ├── boost.mk.patch ├── build-aux └── 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_gcc_func_attribute.m4 │ ├── ax_pthread.m4 │ ├── bitcoin_find_bdb.m4 │ └── bitcoin_subdir_to_include.m4 ├── code_of_conduct.md ├── configure.ac ├── configure.ac.patch ├── contrib ├── README.md ├── bitcoin-cli.bash-completion ├── bitcoin-tx.bash-completion ├── bitcoind.bash-completion ├── bitrpc │ ├── README.md │ └── bitrpc.py ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── examples │ │ └── zcash.conf │ ├── postinst │ ├── postrm │ ├── preinst │ ├── prerm │ ├── rules │ ├── zcash.examples │ ├── zcash.install │ └── zcash.manpages ├── devtools │ ├── README.md │ ├── fix-copyright-headers.py │ ├── gen-manpages.sh │ ├── git-subtree-check.sh │ ├── github-merge.sh │ ├── optimize-pngs.py │ ├── security-check.py │ ├── split-debug.sh │ ├── symbol-check.py │ └── test-security-check.py ├── gitian-descriptors │ ├── README.md │ ├── gitian-linux.yml │ ├── gitian-osx-signer.yml │ ├── gitian-osx.yml │ ├── gitian-win-signer.yml │ └── gitian-win.yml ├── gitian-downloader │ ├── daira.asc │ ├── jack.asc │ ├── kevin.asc │ ├── nathan.asc │ ├── sean.asc │ └── simon.asc ├── init │ ├── README.md │ ├── bitcoind.conf │ ├── bitcoind.init │ ├── bitcoind.openrc │ ├── bitcoind.openrcconf │ └── bitcoind.service ├── linearize │ ├── README.md │ ├── example-linearize.cfg │ ├── linearize-data.py │ └── linearize-hashes.py ├── macdeploy │ ├── Base.lproj │ │ └── InfoPlist.strings │ ├── DS_Store │ ├── LICENSE │ ├── README.md │ ├── background.png │ ├── background.psd │ ├── background.tiff │ ├── background@2x.png │ ├── detached-sig-apply.sh │ ├── detached-sig-create.sh │ └── fancy.plist ├── qos │ ├── README.md │ └── tc.sh ├── seeds │ ├── README.md │ ├── generate-seeds.py │ ├── makeseeds.py │ ├── nodes_main.txt │ └── nodes_test.txt ├── spendfrom │ ├── README.md │ ├── setup.py │ └── spendfrom.py ├── test-patches │ ├── README.md │ └── temp-revert-2.patch ├── testgen │ ├── README.md │ ├── base58.py │ └── gen_base58_test_vectors.py ├── tidy_datadir.sh ├── verify-commits │ ├── gpg.sh │ ├── pre-push-hook.sh │ ├── trusted-git-root │ ├── trusted-keys │ └── verify-commits.sh ├── verifysfbinaries │ ├── README.md │ └── verify.sh └── zmq │ └── zmq_sub.py ├── darwin.host.mk.patch ├── darwin.mk.patch ├── depends ├── .gitignore ├── Makefile ├── README.md ├── builders │ ├── darwin.mk │ ├── default.mk │ └── linux.mk ├── config.guess ├── config.site.in ├── config.sub ├── description.md ├── funcs.mk ├── hosts │ ├── darwin.mk │ ├── default.mk │ ├── linux.mk │ └── mingw32.mk ├── packages.md ├── packages │ ├── bdb.mk │ ├── boost.mk │ ├── googlemock.mk │ ├── googletest.mk │ ├── libcurl.mk │ ├── libevent.mk │ ├── libgmp.mk │ ├── librustzcash.mk │ ├── libsnark.mk │ ├── libsodium.mk │ ├── miniupnpc.mk │ ├── native_ccache.mk │ ├── openssl.mk │ ├── packages.mk │ ├── rust.mk │ └── zeromq.mk └── patches │ ├── boost │ ├── deprecated_auto_ptr.patch │ └── include_poll.patch │ └── miniupnpc │ ├── fix-solaris-compilation.patch │ ├── patch-strlen-patch.patch │ └── strlen-before-memcmp.patch ├── doc ├── Doxyfile ├── authors.md ├── bitcoin-release-notes │ ├── release-notes-0.10.0.md │ ├── release-notes-0.10.1.md │ ├── release-notes-0.10.2.md │ ├── release-notes-0.10.3.md │ ├── release-notes-0.11.1.md │ ├── release-notes-0.11.2.md │ ├── release-notes-0.3.12.md │ ├── release-notes-0.3.13.md │ ├── release-notes-0.3.14.md │ ├── release-notes-0.3.15.md │ ├── release-notes-0.3.16.md │ ├── release-notes-0.3.17.md │ ├── release-notes-0.3.18.md │ ├── release-notes-0.3.19.md │ ├── release-notes-0.3.20.1.md │ ├── release-notes-0.3.20.2.md │ ├── release-notes-0.3.20.md │ ├── release-notes-0.3.21.md │ ├── release-notes-0.3.22.md │ ├── release-notes-0.3.23.md │ ├── release-notes-0.3.24.md │ ├── release-notes-0.4.0.md │ ├── release-notes-0.4.1.md │ ├── release-notes-0.4.2.md │ ├── release-notes-0.4.3.md │ ├── release-notes-0.4.4.md │ ├── release-notes-0.4.5.md │ ├── release-notes-0.4.6.md │ ├── release-notes-0.5.0.md │ ├── release-notes-0.5.1.md │ ├── release-notes-0.5.2.md │ ├── release-notes-0.5.3.md │ ├── release-notes-0.5.4.md │ ├── release-notes-0.5.5.md │ ├── release-notes-0.6.0.md │ ├── release-notes-0.6.1.md │ ├── release-notes-0.6.2.md │ ├── release-notes-0.6.3.md │ ├── release-notes-0.7.0.md │ ├── release-notes-0.7.1.md │ ├── release-notes-0.7.2.md │ ├── release-notes-0.8.0.md │ ├── release-notes-0.8.1.md │ ├── release-notes-0.8.2.md │ ├── release-notes-0.8.3.md │ ├── release-notes-0.8.4.md │ ├── release-notes-0.8.5.md │ ├── release-notes-0.8.6.md │ ├── release-notes-0.9.0.md │ ├── release-notes-0.9.1.md │ ├── release-notes-0.9.2.1.md │ ├── release-notes-0.9.2.md │ ├── release-notes-0.9.3.md │ ├── release-notes-0.9.4.md │ └── release-notes-0.9.5.md ├── developer-notes.md ├── dnsseed-policy.md ├── files.md ├── init.md ├── man │ ├── Makefile.am │ ├── zcash-cli.1 │ ├── zcash-fetch-params.1 │ ├── zcash-tx.1 │ └── zcashd.1 ├── payment-api.md ├── release-notes │ ├── release-notes-0.11.2.z2.md │ ├── release-notes-0.11.2.z3.md │ ├── release-notes-0.11.2.z4.md │ ├── release-notes-0.11.2.z5.md │ ├── release-notes-0.11.2.z6.md │ ├── release-notes-0.11.2.z7.md │ ├── release-notes-0.11.2.z8.md │ ├── release-notes-0.11.2.z9.md │ ├── release-notes-1.0.0-beta1.md │ ├── release-notes-1.0.0-beta2.md │ ├── release-notes-1.0.0-rc1.md │ ├── release-notes-1.0.0-rc2.md │ ├── release-notes-1.0.0-rc3.md │ ├── release-notes-1.0.0-rc4.md │ ├── release-notes-1.0.0.md │ ├── release-notes-1.0.1.md │ ├── release-notes-1.0.2.md │ ├── release-notes-1.0.3.md │ ├── release-notes-1.0.4.md │ ├── release-notes-1.0.5.md │ ├── release-notes-1.0.6.md │ ├── release-notes-1.0.7-1.md │ ├── release-notes-1.0.7.md │ └── release-notes-1.0.8.md ├── release-process.md ├── security-warnings.md ├── tor.md ├── translation_strings_policy.md ├── unit-tests.md └── zmq.md ├── equihash.cpp.patch ├── libsnark.mk.patch ├── libzcashconsensus.pc.in ├── makeDistrib.sh ├── makeRelease.sh ├── packages.mk.patch ├── patches ├── qa ├── pull-tester │ ├── rpc-tests.sh │ ├── run-bitcoin-cli │ ├── run-bitcoind-for-test.sh.in │ └── tests-config.sh.in ├── rpc-tests │ ├── .gitignore │ ├── README.md │ ├── bip65-cltv-p2p.py │ ├── bip65-cltv.py │ ├── bipdersig-p2p.py │ ├── bipdersig.py │ ├── decodescript.py │ ├── disablewallet.py │ ├── forknotify.py │ ├── fundrawtransaction.py │ ├── getblocktemplate.py │ ├── getblocktemplate_longpoll.py │ ├── getblocktemplate_proposals.py │ ├── getchaintips.py │ ├── hardforkdetection.py │ ├── httpbasics.py │ ├── invalidateblock.py │ ├── invalidblockrequest.py │ ├── keypool.py │ ├── listtransactions.py │ ├── maxblocksinflight.py │ ├── mempool_coinbase_spends.py │ ├── mempool_resurrect_test.py │ ├── mempool_spendcoinbase.py │ ├── merkle_blocks.py │ ├── nodehandling.py │ ├── p2p-acceptblock.py │ ├── prioritisetransaction.py │ ├── proxy_test.py │ ├── pruning.py │ ├── rawtransactions.py │ ├── receivedby.py │ ├── reindex.py │ ├── rest.py │ ├── rpcbind_test.py │ ├── script_test.py │ ├── signrawtransactions.py │ ├── smartfees.py │ ├── test_framework │ │ ├── __init__.py │ │ ├── authproxy.py │ │ ├── bignum.py │ │ ├── blockstore.py │ │ ├── blocktools.py │ │ ├── comptool.py │ │ ├── mininode.py │ │ ├── netutil.py │ │ ├── script.py │ │ ├── socks5.py │ │ ├── test_framework.py │ │ └── util.py │ ├── txn_doublespend.py │ ├── wallet.py │ ├── wallet_1941.py │ ├── wallet_nullifiers.py │ ├── wallet_protectcoinbase.py │ ├── wallet_treestate.py │ ├── walletbackup.py │ ├── zapwallettxes.py │ ├── zcjoinsplit.py │ ├── zcjoinsplitdoublespend.py │ └── zmq_test.py └── zcash │ ├── check-security-hardening.sh │ ├── checksec.sh │ ├── ensure-no-dot-so-in-depends.py │ ├── full-test-suite.sh │ ├── performance-measurements.sh │ └── test-depends-sources-mirror.py ├── share ├── certs │ ├── BitcoinFoundation_Apple_Cert.pem │ ├── BitcoinFoundation_Comodo_Cert.pem │ └── PrivateKeyNotes.md ├── genbuild.sh ├── pixmaps │ ├── addressbook16.bmp │ ├── addressbook16mask.bmp │ ├── addressbook20.bmp │ ├── addressbook20mask.bmp │ ├── bitcoin-bc.ico │ ├── bitcoin.ico │ ├── bitcoin128.png │ ├── bitcoin128.xpm │ ├── bitcoin16.png │ ├── bitcoin16.xpm │ ├── bitcoin256.png │ ├── bitcoin256.xpm │ ├── bitcoin32.png │ ├── bitcoin32.xpm │ ├── bitcoin64.png │ ├── bitcoin64.xpm │ ├── check.ico │ ├── favicon.ico │ ├── nsis-header.bmp │ ├── nsis-wizard.bmp │ ├── send16.bmp │ ├── send16mask.bmp │ ├── send16masknoshadow.bmp │ ├── send20.bmp │ └── send20mask.bmp ├── setup.nsi.in └── ui.rc ├── src ├── .clang-format ├── KMD.batch0 ├── KMD.batch0.listunspent ├── KMD.batch0.txids ├── KMD.batch1 ├── KMD.batch1.txids ├── KMD.batch2 ├── KMD.batch2.txids ├── KMD.batch3 ├── KMD.batch3.utxo ├── KMD.batch4 ├── KMD.batch4.txids ├── Makefile.am ├── Makefile.gtest.include ├── Makefile.qt.include ├── Makefile.qttest.include ├── Makefile.test.include ├── Makefile.zcash.include ├── REVS.batch0 ├── REVS.batch1 ├── REVS.batch1.txids ├── REVS.batch2 ├── REVS.batch2.txids ├── REVS.batch3 ├── REVS.batch3.txids ├── REVS.batch4 ├── REVS.batchtxids0 ├── REVS.raw ├── REVS.rawtxids ├── REVS.snapshot ├── REVS.txids ├── REVS.txids0 ├── addrman.cpp ├── addrman.h ├── alert.cpp ├── alert.h ├── alertkeys.h ├── amount.cpp ├── amount.h ├── arith_uint256.cpp ├── arith_uint256.h ├── assetchains ├── assetchains.old ├── assetfunds ├── asyncrpcoperation.cpp ├── asyncrpcoperation.h ├── asyncrpcqueue.cpp ├── asyncrpcqueue.h ├── base58.cpp ├── base58.h ├── bitcoin-cli-res.rc ├── bitcoin-cli.cpp ├── bitcoin-tx-res.rc ├── bitcoind-res.rc ├── bitcoind.cpp ├── bloom.cpp ├── bloom.h ├── cJSON.c ├── cJSON.h ├── chain.cpp ├── chain.h ├── chainparams.cpp ├── chainparams.h ├── chainparamsbase.cpp ├── chainparamsbase.h ├── chainparamsseeds.h ├── checkpoints.cpp ├── checkpoints.h ├── checkqueue.h ├── clearassets ├── clientversion.cpp ├── clientversion.h ├── coincontrol.h ├── coins.cpp ├── coins.h ├── compat.h ├── compat │ ├── byteswap.h │ ├── endian.h │ ├── glibc_compat.cpp │ ├── glibc_sanity.cpp │ ├── glibcxx_sanity.cpp │ ├── sanity.h │ └── strnlen.cpp ├── compressor.cpp ├── compressor.h ├── config │ └── .empty ├── consensus │ ├── consensus.h │ ├── params.h │ └── validation.h ├── core_io.h ├── core_memusage.h ├── core_read.cpp ├── core_write.cpp ├── crypto │ ├── common.h │ ├── equihash.cpp │ ├── equihash.h │ ├── equihash.tcc │ ├── hmac_sha256.cpp │ ├── hmac_sha256.h │ ├── hmac_sha512.cpp │ ├── hmac_sha512.h │ ├── ripemd160.cpp │ ├── ripemd160.h │ ├── sha1.cpp │ ├── sha1.h │ ├── sha256.cpp │ ├── sha256.h │ ├── sha512.cpp │ └── sha512.h ├── dpowassets ├── eccryptoverify.cpp ├── eccryptoverify.h ├── ecwrapper.cpp ├── ecwrapper.h ├── fiat-cli ├── fiat │ ├── aud │ ├── bet │ ├── bgn │ ├── bots │ ├── brl │ ├── cad │ ├── ceal │ ├── chf │ ├── cny │ ├── coqui │ ├── crypto │ ├── czk │ ├── dex │ ├── dkk │ ├── eur │ ├── gbp │ ├── hkd │ ├── hodl │ ├── hrk │ ├── huf │ ├── idr │ ├── ils │ ├── inr │ ├── jpy │ ├── jumblr │ ├── krw │ ├── kv │ ├── mesh │ ├── mgw │ ├── mnz │ ├── mshark │ ├── mvp │ ├── mxn │ ├── myr │ ├── nok │ ├── nzd │ ├── pangea │ ├── php │ ├── pln │ ├── revs │ ├── ron │ ├── rub │ ├── sek │ ├── sgd │ ├── shark │ ├── supernet │ ├── thb │ ├── try │ ├── usd │ ├── wlc │ └── zar ├── fundnotaries ├── gtest │ ├── json_test_vectors.cpp │ ├── json_test_vectors.h │ ├── main.cpp │ ├── test_block.cpp │ ├── test_checkblock.cpp │ ├── test_checktransaction.cpp │ ├── test_circuit.cpp │ ├── test_equihash.cpp │ ├── test_foundersreward.cpp │ ├── test_joinsplit.cpp │ ├── test_keystore.cpp │ ├── test_libzcash_utils.cpp │ ├── test_mempool.cpp │ ├── test_merkletree.cpp │ ├── test_metrics.cpp │ ├── test_miner.cpp │ ├── test_noteencryption.cpp │ ├── test_pow.cpp │ ├── test_proofs.cpp │ ├── test_random.cpp │ ├── test_rpc.cpp │ ├── test_tautology.cpp │ ├── test_transaction.cpp │ ├── test_txid.cpp │ └── utils.cpp ├── hash.cpp ├── hash.h ├── httprpc.cpp ├── httprpc.h ├── httpserver.cpp ├── httpserver.h ├── init.cpp ├── init.h ├── key.cpp ├── key.h ├── keystore.cpp ├── keystore.h ├── komodo-tx.cpp ├── komodo.h ├── komodo_bitcoind.h ├── komodo_cJSON.c ├── komodo_cJSON.h ├── komodo_curve25519.h ├── komodo_defs.h ├── komodo_events.h ├── komodo_gateway.h ├── komodo_globals.h ├── komodo_interest.h ├── komodo_jumblr.h ├── komodo_kv.h ├── komodo_notary.h ├── komodo_pax.h ├── komodo_structs.h ├── komodo_utils.h ├── leveldb │ ├── .gitignore │ ├── AUTHORS │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── Makefile │ ├── NEWS │ ├── README │ ├── README.md │ ├── 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 │ │ ├── dumpfile.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 │ │ │ ├── dumpfile.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 │ │ ├── hash_test.cc │ │ ├── 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 ├── leveldbwrapper.cpp ├── leveldbwrapper.h ├── limitedmap.h ├── main.cpp ├── main.h ├── memusage.h ├── merkleblock.cpp ├── merkleblock.h ├── metrics.cpp ├── metrics.h ├── miner.cpp ├── miner.h ├── mini-gmp.c ├── mini-gmp.h ├── mruset.h ├── net.cpp ├── net.h ├── netbase.cpp ├── netbase.h ├── noui.cpp ├── noui.h ├── obj-test │ └── .gitignore ├── obj │ └── .gitignore ├── policy │ ├── fees.cpp │ └── fees.h ├── pow.cpp ├── pow.h ├── pow │ └── tromp │ │ ├── equi.h │ │ ├── equi_miner.h │ │ └── osx_barrier.h ├── primitives │ ├── block.cpp │ ├── block.h │ ├── transaction.cpp │ └── transaction.h ├── protocol.cpp ├── protocol.h ├── pubkey.cpp ├── pubkey.h ├── purge ├── qt │ ├── Makefile │ ├── bitcoin.cpp │ ├── bitcoinstrings.cpp │ ├── guiconstants.h │ ├── intro.cpp │ ├── macnotificationhandler.mm │ ├── res │ │ └── bitcoin-qt-res.rc │ ├── test │ │ └── test_main.cpp │ ├── transactiondesc.cpp │ └── utilitydialog.cpp ├── random.cpp ├── random.h ├── rest.cpp ├── reverselock.h ├── revs ├── rpcblockchain.cpp ├── rpcclient.cpp ├── rpcclient.h ├── rpcmining.cpp ├── rpcmisc.cpp ├── rpcnet.cpp ├── rpcprotocol.cpp ├── rpcprotocol.h ├── rpcrawtransaction.cpp ├── rpcserver.cpp ├── rpcserver.h ├── scheduler.cpp ├── scheduler.h ├── script │ ├── interpreter.cpp │ ├── interpreter.h │ ├── script.cpp │ ├── script.h │ ├── script_error.cpp │ ├── script_error.h │ ├── sigcache.cpp │ ├── sigcache.h │ ├── sign.cpp │ ├── sign.h │ ├── standard.cpp │ ├── standard.h │ ├── zcashconsensus.cpp │ └── zcashconsensus.h ├── secp256k1 │ ├── .gitignore │ ├── .travis.yml │ ├── COPYING │ ├── Makefile.am │ ├── README.md │ ├── TODO │ ├── autogen.sh │ ├── build-aux │ │ └── m4 │ │ │ └── bitcoin_secp.m4 │ ├── configure.ac │ ├── include │ │ └── secp256k1.h │ ├── libsecp256k1.pc.in │ ├── obj │ │ └── .gitignore │ └── src │ │ ├── bench.h │ │ ├── bench_internal.c │ │ ├── bench_recover.c │ │ ├── bench_sign.c │ │ ├── bench_verify.c │ │ ├── ecdsa.h │ │ ├── ecdsa_impl.h │ │ ├── eckey.h │ │ ├── eckey_impl.h │ │ ├── ecmult.h │ │ ├── ecmult_gen.h │ │ ├── ecmult_gen_impl.h │ │ ├── ecmult_impl.h │ │ ├── field.h │ │ ├── field_10x26.h │ │ ├── field_10x26_impl.h │ │ ├── field_5x52.h │ │ ├── field_5x52_asm_impl.h │ │ ├── field_5x52_impl.h │ │ ├── field_5x52_int128_impl.h │ │ ├── field_impl.h │ │ ├── group.h │ │ ├── group_impl.h │ │ ├── hash.h │ │ ├── hash_impl.h │ │ ├── java │ │ ├── org │ │ │ └── bitcoin │ │ │ │ └── NativeSecp256k1.java │ │ ├── org_bitcoin_NativeSecp256k1.c │ │ └── org_bitcoin_NativeSecp256k1.h │ │ ├── num.h │ │ ├── num_gmp.h │ │ ├── num_gmp_impl.h │ │ ├── num_impl.h │ │ ├── scalar.h │ │ ├── scalar_4x64.h │ │ ├── scalar_4x64_impl.h │ │ ├── scalar_8x32.h │ │ ├── scalar_8x32_impl.h │ │ ├── scalar_impl.h │ │ ├── secp256k1.c │ │ ├── testrand.h │ │ ├── testrand_impl.h │ │ ├── tests.c │ │ └── util.h ├── sendalert.cpp ├── serialize.h ├── streams.h ├── support │ ├── allocators │ │ ├── secure.h │ │ └── zeroafterfree.h │ ├── cleanse.cpp │ ├── cleanse.h │ ├── events.h │ ├── pagelocker.cpp │ └── pagelocker.h ├── sync.cpp ├── sync.h ├── test │ ├── Checkpoints_tests.cpp │ ├── DoS_tests.cpp │ ├── Makefile │ ├── README.md │ ├── accounting_tests.cpp │ ├── addrman_tests.cpp │ ├── alert_tests.cpp │ ├── allocator_tests.cpp │ ├── arith_uint256_tests.cpp │ ├── base32_tests.cpp │ ├── base58_tests.cpp │ ├── base64_tests.cpp │ ├── bctest.py │ ├── bignum.h │ ├── bip32_tests.cpp │ ├── bitcoin-util-test.py │ ├── bloom_tests.cpp │ ├── buildenv.py.in │ ├── checkblock_tests.cpp │ ├── coins_tests.cpp │ ├── compress_tests.cpp │ ├── crypto_tests.cpp │ ├── data │ │ ├── README.md │ │ ├── alertTests.raw │ │ ├── base58_encode_decode.json │ │ ├── base58_keys_invalid.json │ │ ├── base58_keys_valid.json │ │ ├── bitcoin-util-test.json │ │ ├── blanktx.hex │ │ ├── g1_compressed.json │ │ ├── g2_compressed.json │ │ ├── merkle_commitments.json │ │ ├── merkle_path.json │ │ ├── merkle_roots.json │ │ ├── merkle_roots_empty.json │ │ ├── merkle_serialization.json │ │ ├── merkle_witness_serialization.json │ │ ├── script_invalid.json │ │ ├── script_valid.json │ │ ├── sighash.json │ │ ├── tt-delin1-out.hex │ │ ├── tt-delout1-out.hex │ │ ├── tt-locktime317000-out.hex │ │ ├── tx394b54bb.hex │ │ ├── tx_invalid.json │ │ ├── tx_valid.json │ │ ├── txcreate1.hex │ │ ├── txcreate2.hex │ │ └── txcreatesign.hex │ ├── equihash_tests.cpp │ ├── getarg_tests.cpp │ ├── hash_tests.cpp │ ├── key_tests.cpp │ ├── main_tests.cpp │ ├── mempool_tests.cpp │ ├── miner_tests.cpp │ ├── mruset_tests.cpp │ ├── multisig_tests.cpp │ ├── netbase_tests.cpp │ ├── pmt_tests.cpp │ ├── policyestimator_tests.cpp │ ├── pow_tests.cpp │ ├── raii_event_tests.cpp │ ├── reverselock_tests.cpp │ ├── rpc_tests.cpp │ ├── rpc_wallet_tests.cpp │ ├── sanity_tests.cpp │ ├── scheduler_tests.cpp │ ├── script_P2SH_tests.cpp │ ├── script_tests.cpp │ ├── scriptnum_tests.cpp │ ├── serialize_tests.cpp │ ├── sha256compress_tests.cpp │ ├── sighash_tests.cpp │ ├── sigopcount_tests.cpp │ ├── skiplist_tests.cpp │ ├── test_bitcoin.cpp │ ├── test_bitcoin.h │ ├── timedata_tests.cpp │ ├── torcontrol_tests.cpp │ ├── transaction_tests.cpp │ ├── uint256_tests.cpp │ ├── univalue_tests.cpp │ └── util_tests.cpp ├── threadsafety.h ├── timedata.cpp ├── timedata.h ├── tinyformat.h ├── torcontrol.cpp ├── torcontrol.h ├── txdb.cpp ├── txdb.h ├── txmempool.cpp ├── txmempool.h ├── ui_interface.h ├── uint252.h ├── uint256.cpp ├── uint256.h ├── undo.h ├── univalue │ ├── .gitignore │ ├── .travis.yml │ ├── COPYING │ ├── Makefile.am │ ├── README │ ├── TODO │ ├── autogen.sh │ ├── build-aux │ │ └── m4 │ │ │ └── .gitignore │ ├── configure.ac │ ├── gen │ │ └── gen.cpp │ ├── include │ │ └── univalue.h │ ├── lib │ │ ├── .gitignore │ │ ├── univalue.cpp │ │ ├── univalue_escapes.h │ │ ├── univalue_read.cpp │ │ ├── univalue_utffilter.h │ │ └── univalue_write.cpp │ ├── pc │ │ ├── libunivalue-uninstalled.pc.in │ │ └── libunivalue.pc.in │ └── test │ │ ├── .gitignore │ │ ├── fail1.json │ │ ├── fail10.json │ │ ├── fail11.json │ │ ├── fail12.json │ │ ├── fail13.json │ │ ├── fail14.json │ │ ├── fail15.json │ │ ├── fail16.json │ │ ├── fail17.json │ │ ├── fail18.json │ │ ├── fail19.json │ │ ├── fail2.json │ │ ├── fail20.json │ │ ├── fail21.json │ │ ├── fail22.json │ │ ├── fail23.json │ │ ├── fail24.json │ │ ├── fail25.json │ │ ├── fail26.json │ │ ├── fail27.json │ │ ├── fail28.json │ │ ├── fail29.json │ │ ├── fail3.json │ │ ├── fail30.json │ │ ├── fail31.json │ │ ├── fail32.json │ │ ├── fail33.json │ │ ├── fail34.json │ │ ├── fail35.json │ │ ├── fail36.json │ │ ├── fail37.json │ │ ├── fail38.json │ │ ├── fail39.json │ │ ├── fail4.json │ │ ├── fail40.json │ │ ├── fail41.json │ │ ├── fail42.json │ │ ├── fail5.json │ │ ├── fail6.json │ │ ├── fail7.json │ │ ├── fail8.json │ │ ├── fail9.json │ │ ├── no_nul.cpp │ │ ├── pass1.json │ │ ├── pass2.json │ │ ├── pass3.json │ │ ├── round1.json │ │ ├── round2.json │ │ ├── round3.json │ │ ├── round4.json │ │ ├── round5.json │ │ ├── round6.json │ │ ├── round7.json │ │ ├── test_json.cpp │ │ └── unitester.cpp ├── uthash.h ├── util.cpp ├── util.h ├── utilmoneystr.cpp ├── utilmoneystr.h ├── utilstrencodings.cpp ├── utilstrencodings.h ├── utiltest.cpp ├── utiltest.h ├── utiltime.cpp ├── utiltime.h ├── utlist.h ├── validationinterface.cpp ├── validationinterface.h ├── version.h ├── wallet │ ├── asyncrpcoperation_sendmany.cpp │ ├── asyncrpcoperation_sendmany.h │ ├── crypter.cpp │ ├── crypter.h │ ├── db.cpp │ ├── db.h │ ├── gtest │ │ ├── test_transaction.cpp │ │ ├── test_wallet.cpp │ │ └── test_wallet_zkeys.cpp │ ├── rpcdump.cpp │ ├── rpcwallet.cpp │ ├── test │ │ └── wallet_tests.cpp │ ├── wallet.cpp │ ├── wallet.h │ ├── wallet_ismine.cpp │ ├── wallet_ismine.h │ ├── walletdb.cpp │ └── walletdb.h ├── zcash │ ├── Address.cpp │ ├── Address.hpp │ ├── CreateJoinSplit.cpp │ ├── GenerateParams.cpp │ ├── IncrementalMerkleTree.cpp │ ├── IncrementalMerkleTree.hpp │ ├── JoinSplit.cpp │ ├── JoinSplit.hpp │ ├── Note.cpp │ ├── Note.hpp │ ├── NoteEncryption.cpp │ ├── NoteEncryption.hpp │ ├── Proof.cpp │ ├── Proof.hpp │ ├── Zcash.h │ ├── circuit │ │ ├── commitment.tcc │ │ ├── gadget.tcc │ │ ├── merkle.tcc │ │ ├── note.tcc │ │ ├── prfs.tcc │ │ └── utils.tcc │ ├── prf.cpp │ ├── prf.h │ ├── util.cpp │ └── util.h ├── zcbenchmarks.cpp ├── zcbenchmarks.h └── zmq │ ├── zmqabstractnotifier.cpp │ ├── zmqabstractnotifier.h │ ├── zmqconfig.h │ ├── zmqnotificationinterface.cpp │ ├── zmqnotificationinterface.h │ ├── zmqpublishnotifier.cpp │ └── zmqpublishnotifier.h ├── toolchain-info.sh ├── user-config.jam └── zcutil ├── build-debian-package.sh ├── build-mac.sh ├── build-win.sh ├── build.sh ├── cleanup-tags.sh ├── docker-entrypoint.sh ├── docker-komodo-cli.sh ├── fetch-params.sh └── release-notes.py /.gitattributes: -------------------------------------------------------------------------------- 1 | src/clientversion.cpp export-subst 2 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM kolobus/ubuntu:komodo 2 | MAINTAINER Mihail Fedorov 3 | 4 | ADD ./ /komodo 5 | ENV HOME /komodo 6 | WORKDIR /komodo 7 | 8 | # configure || true or it WILL halt 9 | RUN cd /komodo && \ 10 | ./autogen.sh && \ 11 | ./configure --with-incompatible-bdb --with-gui || true && \ 12 | ./zcutil/build.sh -j$(nproc) 13 | 14 | # Unknown stuff goes here 15 | 16 | RUN ln -sf /komodo/src/komodod /usr/bin/komodod && \ 17 | ln -sf /komodo/zcutil/docker-entrypoint.sh /usr/bin/entrypoint && \ 18 | ln -sf /komodo/zcutil/docker-komodo-cli.sh /usr/bin/komodo-cli 19 | 20 | CMD ["entrypoint"] 21 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Building Zcash 2 | 3 | See the Zcash github wiki (https://github.com/zcash/zcash/wiki) for instructions on building zcashd, 4 | the intended-for-services, no-graphical-interface, reference 5 | implementation of Zcash. 6 | -------------------------------------------------------------------------------- /README-mac.md: -------------------------------------------------------------------------------- 1 | First off you need Apple's Xcode (at least version 7, preferably 8.x) and the Xcode Command Line Tools: 2 | 3 | https://itunes.apple.com/us/app/xcode/id497799835?mt=12 4 | 5 | And Homebrew: 6 | 7 | http://brew.sh/ 8 | 9 | And this is the list of brew packages you'll need installed: 10 | 11 | ```shell 12 | brew tap discoteq/discoteq; brew install flock 13 | brew install autoconf autogen automake 14 | brew tap homebrew/versions; brew install homebrew/versions/gcc5 15 | brew install binutils 16 | brew install protobuf 17 | brew install coreutils 18 | brew install wget 19 | ``` 20 | 21 | Get all that installed, then run: 22 | 23 | ```shell 24 | git clone https://github.com/j-cimb-barker/komodo.git 25 | cd komodo 26 | git checkout dev 27 | ./zcutil/build-mac.sh 28 | ``` 29 | 30 | To build a distributable version of komodo then run the makeDistrib.sh script after building. 31 | 32 | When you are done building, you need to do a few things in the [Configuration](https://github.com/zcash/zcash/wiki/1.0-User-Guide#configuration) section of the Zcash User Guide differently because we are on the Mac. All instances of `~/.zcash` need to be replaced by `~/Library/Application\ Support/Zcash` 33 | The fetch-params.sh script, however, has already been altered to fetch the proving keys into the correct directory to conform to Mac specific naming conventions. 34 | 35 | Happy Building 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Deprecated, please use https://github.com/KomodoPlatform/komodo/ instead. 2 | 3 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | srcdir="$(dirname $0)" 4 | cd "$srcdir" 5 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 6 | LIBTOOLIZE="${GLIBTOOLIZE}" 7 | export LIBTOOLIZE 8 | fi 9 | autoreconf --install --force --warnings=all 10 | -------------------------------------------------------------------------------- /build-aux/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 | -------------------------------------------------------------------------------- /contrib/bitrpc/README.md: -------------------------------------------------------------------------------- 1 | ### BitRPC 2 | Allows for sending of all standard Bitcoin commands via RPC rather than as command line args. 3 | 4 | ### Looking for Wallet Tools? 5 | BitRPC.py is able to do the exact same thing as `walletchangepass.py` and `walletunlock.py`. Their respective commands in BitRPC.py are: 6 | 7 | bitrpc.py walletpassphrasechange 8 | bitrpc.py walletpassphrase -------------------------------------------------------------------------------- /contrib/debian/compat: -------------------------------------------------------------------------------- 1 | 9 2 | -------------------------------------------------------------------------------- /contrib/debian/control: -------------------------------------------------------------------------------- 1 | Source: zcash 2 | Section: utils 3 | Priority: optional 4 | Maintainer: Zcash Company 5 | Homepage: https://z.cash 6 | Build-Depends: autoconf, automake, bsdmainutils, build-essential, 7 | git, g++-multilib, libc6-dev, libtool, 8 | m4, ncurses-dev, pkg-config, python, 9 | unzip, wget, zlib1g-dev 10 | Vcs-Git: https://github.com/zcash/zcash.git 11 | Vcs-Browser: https://github.com/zcash/zcash 12 | 13 | Package: zcash 14 | Architecture: amd64 15 | Depends: ${shlibs:Depends} 16 | Description: HTTPS for money. 17 | Based on Bitcoin's code, it intends to offer a far higher standard 18 | of privacy and anonymity through a sophisticiated zero-knowledge 19 | proving scheme which preserves confidentiality of transaction metadata. 20 | This package provides the daemon, zcashd, and the CLI tool, 21 | zcash-cli, to interact with the daemon. 22 | -------------------------------------------------------------------------------- /contrib/debian/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postinst script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `configure' 10 | # * `abort-upgrade' 11 | # * `abort-remove' `in-favour' 12 | # 13 | # * `abort-remove' 14 | # * `abort-deconfigure' `in-favour' 15 | # `removing' 16 | # 17 | # for details, see https://www.debian.org/doc/debian-policy/ or 18 | # the debian-policy package 19 | 20 | 21 | case "$1" in 22 | configure) 23 | ;; 24 | 25 | abort-upgrade|abort-remove|abort-deconfigure) 26 | ;; 27 | 28 | *) 29 | echo "postinst called with unknown argument \`$1'" >&2 30 | exit 1 31 | ;; 32 | esac 33 | 34 | # dh_installdeb will replace this with shell code automatically 35 | # generated by other debhelper scripts. 36 | 37 | #DEBHELPER# 38 | 39 | exit 0 40 | -------------------------------------------------------------------------------- /contrib/debian/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # postrm script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `purge' 11 | # * `upgrade' 12 | # * `failed-upgrade' 13 | # * `abort-install' 14 | # * `abort-install' 15 | # * `abort-upgrade' 16 | # * `disappear' 17 | # 18 | # for details, see https://www.debian.org/doc/debian-policy/ or 19 | # the debian-policy package 20 | 21 | 22 | case "$1" in 23 | purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) 24 | ;; 25 | 26 | *) 27 | echo "postrm called with unknown argument \`$1'" >&2 28 | exit 1 29 | ;; 30 | esac 31 | 32 | # dh_installdeb will replace this with shell code automatically 33 | # generated by other debhelper scripts. 34 | 35 | #DEBHELPER# 36 | 37 | exit 0 38 | -------------------------------------------------------------------------------- /contrib/debian/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # preinst script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `install' 10 | # * `install' 11 | # * `upgrade' 12 | # * `abort-upgrade' 13 | # for details, see https://www.debian.org/doc/debian-policy/ or 14 | # the debian-policy package 15 | 16 | 17 | case "$1" in 18 | install|upgrade) 19 | ;; 20 | 21 | abort-upgrade) 22 | ;; 23 | 24 | *) 25 | echo "preinst called with unknown argument \`$1'" >&2 26 | exit 1 27 | ;; 28 | esac 29 | 30 | # dh_installdeb will replace this with shell code automatically 31 | # generated by other debhelper scripts. 32 | 33 | #DEBHELPER# 34 | 35 | exit 0 36 | -------------------------------------------------------------------------------- /contrib/debian/prerm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # prerm script for zcash 3 | # 4 | # see: dh_installdeb(1) 5 | 6 | set -e 7 | 8 | # summary of how this script can be called: 9 | # * `remove' 10 | # * `upgrade' 11 | # * `failed-upgrade' 12 | # * `remove' `in-favour' 13 | # * `deconfigure' `in-favour' 14 | # `removing' 15 | # 16 | # for details, see https://www.debian.org/doc/debian-policy/ or 17 | # the debian-policy package 18 | 19 | 20 | case "$1" in 21 | remove|upgrade|deconfigure) 22 | ;; 23 | 24 | failed-upgrade) 25 | ;; 26 | 27 | *) 28 | echo "prerm called with unknown argument \`$1'" >&2 29 | exit 1 30 | ;; 31 | esac 32 | 33 | # dh_installdeb will replace this with shell code automatically 34 | # generated by other debhelper scripts. 35 | 36 | #DEBHELPER# 37 | 38 | exit 0 39 | -------------------------------------------------------------------------------- /contrib/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # See debhelper(7) (uncomment to enable) 3 | # output every command that modifies files on the build system. 4 | #export DH_VERBOSE = 1 5 | 6 | 7 | # see FEATURE AREAS in dpkg-buildflags(1) 8 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 9 | 10 | # see ENVIRONMENT in dpkg-buildflags(1) 11 | # package maintainers to append CFLAGS 12 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 13 | # package maintainers to append LDFLAGS 14 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 15 | 16 | 17 | %: 18 | dh $@ --with autotools_dev 19 | 20 | 21 | # dh_make generated override targets 22 | # This is example for Cmake (See https://bugs.debian.org/641051 ) 23 | #override_dh_auto_configure: 24 | # dh_auto_configure -- # -DCMAKE_LIBRARY_PATH=$(DEB_HOST_MULTIARCH) 25 | 26 | -------------------------------------------------------------------------------- /contrib/debian/zcash.examples: -------------------------------------------------------------------------------- 1 | DEBIAN/examples/zcash.conf 2 | -------------------------------------------------------------------------------- /contrib/debian/zcash.install: -------------------------------------------------------------------------------- 1 | usr/bin/zcashd 2 | usr/bin/zcash-cli 3 | usr/bin/zcash-fetch-params 4 | -------------------------------------------------------------------------------- /contrib/debian/zcash.manpages: -------------------------------------------------------------------------------- 1 | DEBIAN/manpages/zcash-cli.1 2 | DEBIAN/manpages/zcashd.1 3 | -------------------------------------------------------------------------------- /contrib/devtools/gen-manpages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} 4 | SRCDIR=${SRCDIR:-$TOPDIR/src} 5 | MANDIR=${MANDIR:-$TOPDIR/doc/man} 6 | 7 | ZCASHD=${ZCASHD:-$SRCDIR/zcashd} 8 | ZCASHCLI=${ZCASHCLI:-$SRCDIR/zcash-cli} 9 | ZCASHTX=${ZCASHTX:-$SRCDIR/zcash-tx} 10 | 11 | [ ! -x $ZCASHD ] && echo "$ZCASHD not found or not executable." && exit 1 12 | 13 | # The autodetected version git tag can screw up manpage output a little bit 14 | ZECVER=($($ZCASHCLI --version | head -n1 | awk -F'[ -]' '{ print $5, $6 }')) 15 | 16 | # Create a footer file with copyright content. 17 | # This gets autodetected fine for zcashd if --version-string is not set, 18 | # but has different outcomes for zcash-cli. 19 | echo "[COPYRIGHT]" > footer.h2m 20 | $ZCASHD --version | sed -n '1!p' >> footer.h2m 21 | 22 | for cmd in $ZCASHD $ZCASHCLI $ZCASHTX; do 23 | cmdname="${cmd##*/}" 24 | help2man -N --version-string=${ZECVER[0]} --include=footer.h2m -o ${MANDIR}/${cmdname}.1 ${cmd} 25 | sed -i "s/\\\-${ZECVER[1]}//g" ${MANDIR}/${cmdname}.1 26 | done 27 | 28 | rm -f footer.h2m 29 | -------------------------------------------------------------------------------- /contrib/devtools/split-debug.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 3 ]; 4 | then echo "usage: $0 " 5 | fi 6 | 7 | /usr/bin/objcopy --enable-deterministic-archives -p --only-keep-debug $1 $3 8 | /usr/bin/objcopy --enable-deterministic-archives -p --strip-debug $1 $2 9 | /usr/bin/strip --enable-deterministic-archives -p -s $2 10 | /usr/bin/objcopy --enable-deterministic-archives -p --add-gnu-debuglink=$3 $2 11 | -------------------------------------------------------------------------------- /contrib/gitian-descriptors/gitian-osx-signer.yml: -------------------------------------------------------------------------------- 1 | --- 2 | name: "bitcoin-dmg-signer" 3 | suites: 4 | - "trusty" 5 | architectures: 6 | - "amd64" 7 | packages: 8 | - "libc6:i386" 9 | - "faketime" 10 | remotes: 11 | - "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git" 12 | "dir": "signature" 13 | files: 14 | - "bitcoin-osx-unsigned.tar.gz" 15 | script: | 16 | WRAP_DIR=$HOME/wrapped 17 | mkdir -p ${WRAP_DIR} 18 | export PATH=`pwd`:$PATH 19 | FAKETIME_PROGS="dmg genisoimage" 20 | 21 | # Create global faketime wrappers 22 | for prog in ${FAKETIME_PROGS}; do 23 | echo '#!/bin/bash' > ${WRAP_DIR}/${prog} 24 | echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog} 25 | echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog} 26 | echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog} 27 | echo "\$REAL \$@" >> $WRAP_DIR/${prog} 28 | chmod +x ${WRAP_DIR}/${prog} 29 | done 30 | 31 | UNSIGNED=bitcoin-osx-unsigned.tar.gz 32 | SIGNED=bitcoin-osx-signed.dmg 33 | 34 | tar -xf ${UNSIGNED} 35 | ./detached-sig-apply.sh ${UNSIGNED} signature/osx 36 | ${WRAP_DIR}/genisoimage -no-cache-inodes -D -l -probe -V "Bitcoin-Core" -no-pad -r -apple -o uncompressed.dmg signed-app 37 | ${WRAP_DIR}/dmg dmg uncompressed.dmg ${OUTDIR}/${SIGNED} 38 | -------------------------------------------------------------------------------- /contrib/init/README.md: -------------------------------------------------------------------------------- 1 | Sample configuration files for: 2 | 3 | SystemD: bitcoind.service 4 | Upstart: bitcoind.conf 5 | OpenRC: bitcoind.openrc 6 | bitcoind.openrcconf 7 | CentOS: bitcoind.init 8 | 9 | have been made available to assist packagers in creating node packages here. 10 | 11 | See doc/init.md for more information. 12 | -------------------------------------------------------------------------------- /contrib/init/bitcoind.openrcconf: -------------------------------------------------------------------------------- 1 | # /etc/conf.d/bitcoind: config file for /etc/init.d/bitcoind 2 | 3 | # Config file location 4 | #BITCOIND_CONFIGFILE="/etc/bitcoin/bitcoin.conf" 5 | 6 | # What directory to write pidfile to? (created and owned by $BITCOIND_USER) 7 | #BITCOIND_PIDDIR="/var/run/bitcoind" 8 | 9 | # What filename to give the pidfile 10 | #BITCOIND_PIDFILE="${BITCOIND_PIDDIR}/bitcoind.pid" 11 | 12 | # Where to write bitcoind data (be mindful that the blockchain is large) 13 | #BITCOIND_DATADIR="/var/lib/bitcoind" 14 | 15 | # User and group to own bitcoind process 16 | #BITCOIND_USER="bitcoin" 17 | #BITCOIND_GROUP="bitcoin" 18 | 19 | # Path to bitcoind executable 20 | #BITCOIND_BIN="/usr/bin/bitcoind" 21 | 22 | # Nice value to run bitcoind under 23 | #BITCOIND_NICE=0 24 | 25 | # Additional options (avoid -conf and -datadir, use flags above) 26 | BITCOIND_OPTS="-disablewallet" 27 | 28 | # The timeout in seconds OpenRC will wait for bitcoind to terminate 29 | # after a SIGTERM has been raised. 30 | # Note that this will be mapped as argument to start-stop-daemon's 31 | # '--retry' option, which means you can specify a retry schedule 32 | # here. For more information see man 8 start-stop-daemon. 33 | BITCOIND_SIGTERM_TIMEOUT=60 34 | -------------------------------------------------------------------------------- /contrib/init/bitcoind.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Bitcoin's distributed currency daemon 3 | After=network.target 4 | 5 | [Service] 6 | User=bitcoin 7 | Group=bitcoin 8 | 9 | Type=forking 10 | PIDFile=/var/lib/bitcoind/bitcoind.pid 11 | ExecStart=/usr/bin/bitcoind -daemon -pid=/var/lib/bitcoind/bitcoind.pid \ 12 | -conf=/etc/bitcoin/bitcoin.conf -datadir=/var/lib/bitcoind -disablewallet 13 | 14 | Restart=always 15 | PrivateTmp=true 16 | TimeoutStopSec=60s 17 | TimeoutStartSec=2s 18 | StartLimitInterval=120s 19 | StartLimitBurst=5 20 | 21 | [Install] 22 | WantedBy=multi-user.target 23 | -------------------------------------------------------------------------------- /contrib/linearize/README.md: -------------------------------------------------------------------------------- 1 | # Linearize 2 | Construct a linear, no-fork, best version of the blockchain. 3 | 4 | ## Step 1: Download hash list 5 | 6 | $ ./linearize-hashes.py linearize.cfg > hashlist.txt 7 | 8 | Required configuration file settings for linearize-hashes: 9 | * RPC: rpcuser, rpcpassword 10 | 11 | Optional config file setting for linearize-hashes: 12 | * RPC: host, port 13 | * Block chain: min_height, max_height 14 | 15 | ## Step 2: Copy local block data 16 | 17 | $ ./linearize-data.py linearize.cfg 18 | 19 | Required configuration file settings: 20 | * "input": bitcoind blocks/ directory containing blkNNNNN.dat 21 | * "hashlist": text file containing list of block hashes, linearized-hashes.py 22 | output. 23 | * "output_file": bootstrap.dat 24 | or 25 | * "output": output directory for linearized blocks/blkNNNNN.dat output 26 | 27 | Optional config file setting for linearize-data: 28 | * "netmagic": network magic number 29 | * "max_out_sz": maximum output file size (default `1000*1000*1000`) 30 | * "split_timestamp": Split files when a new month is first seen, in addition to 31 | reaching a maximum file size. 32 | * "file_timestamp": Set each file's last-modified time to that of the 33 | most recent block in that file. 34 | -------------------------------------------------------------------------------- /contrib/linearize/example-linearize.cfg: -------------------------------------------------------------------------------- 1 | 2 | # bitcoind RPC settings (linearize-hashes) 3 | rpcuser=someuser 4 | rpcpassword=somepassword 5 | host=127.0.0.1 6 | port=8232 7 | #port=18232 8 | 9 | # bootstrap.dat hashlist settings (linearize-hashes) 10 | max_height=313000 11 | 12 | # bootstrap.dat input/output settings (linearize-data) 13 | 14 | # mainnet 15 | netmagic=f9beb4d9 16 | genesis=000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f 17 | input=/home/example/.bitcoin/blocks 18 | 19 | # testnet 20 | #netmagic=0b110907 21 | #genesis=000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943 22 | #input=/home/example/.bitcoin/testnet3/blocks 23 | 24 | output_file=/home/example/Downloads/bootstrap.dat 25 | hashlist=hashlist.txt 26 | split_year=1 27 | 28 | # Maxmimum size in bytes of out-of-order blocks cache in memory 29 | out_of_order_cache_sz = 100000000 30 | -------------------------------------------------------------------------------- /contrib/macdeploy/Base.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | { CFBundleDisplayName = "Bitcoin Core"; CFBundleName = "Bitcoin Core"; } 2 | -------------------------------------------------------------------------------- /contrib/macdeploy/DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/contrib/macdeploy/DS_Store -------------------------------------------------------------------------------- /contrib/macdeploy/README.md: -------------------------------------------------------------------------------- 1 | ### MacDeploy ### 2 | 3 | For Snow Leopard (which uses [Python 2.6](http://www.python.org/download/releases/2.6/)), you will need the param_parser package: 4 | 5 | sudo easy_install argparse 6 | 7 | This script should not be run manually, instead, after building as usual: 8 | 9 | make deploy 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 | When finished, it will produce `Bitcoin-Core.dmg`. 15 | 16 | -------------------------------------------------------------------------------- /contrib/macdeploy/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/contrib/macdeploy/background.png -------------------------------------------------------------------------------- /contrib/macdeploy/background.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/contrib/macdeploy/background.psd -------------------------------------------------------------------------------- /contrib/macdeploy/background.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/contrib/macdeploy/background.tiff -------------------------------------------------------------------------------- /contrib/macdeploy/background@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/contrib/macdeploy/background@2x.png -------------------------------------------------------------------------------- /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.tiff 14 | icon_size 15 | 96 16 | applications_symlink 17 | 18 | items_position 19 | 20 | Applications 21 | 22 | 370 23 | 156 24 | 25 | Bitcoin-Qt.app 26 | 27 | 128 28 | 156 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /contrib/qos/README.md: -------------------------------------------------------------------------------- 1 | ### Qos ### 2 | 3 | This is a Linux bash script that will set up tc to limit the outgoing bandwidth for connections to the Bitcoin network. It limits outbound TCP traffic with a source or destination port of 8233, but not if the destination IP is within a LAN (defined as 192.168.x.x). 4 | 5 | This means one can have an always-on bitcoind instance running, and another local bitcoind/bitcoin-qt instance which connects to this node and receives blocks from it. 6 | -------------------------------------------------------------------------------- /contrib/seeds/README.md: -------------------------------------------------------------------------------- 1 | ### Seeds ### 2 | 3 | Utility to generate the seeds.txt list that is compiled into the client 4 | (see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)). 5 | 6 | The 512 seeds compiled into the 0.10 release were created from sipa's DNS seed data, like this: 7 | 8 | curl -s http://bitcoin.sipa.be/seeds.txt | makeseeds.py 9 | -------------------------------------------------------------------------------- /contrib/seeds/nodes_test.txt: -------------------------------------------------------------------------------- 1 | # List of fixed seed nodes for testnet 2 | 3 | # Onion nodes 4 | thfsmmn2jbitcoin.onion 5 | it2pj4f7657g3rhi.onion 6 | nkf5e6b7pl4jfd4a.onion 7 | 4zhkir2ofl7orfom.onion 8 | t6xj6wilh4ytvcs7.onion 9 | i6y6ivorwakd7nw3.onion 10 | ubqj4rsu3nqtxmtp.onion 11 | 12 | -------------------------------------------------------------------------------- /contrib/spendfrom/setup.py: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | setup(name='btcspendfrom', 3 | version='1.0', 4 | description='Command-line utility for bitcoin "coin control"', 5 | author='Gavin Andresen', 6 | author_email='gavin@bitcoinfoundation.org', 7 | requires=['jsonrpc'], 8 | scripts=['spendfrom.py'], 9 | ) 10 | -------------------------------------------------------------------------------- /contrib/test-patches/README.md: -------------------------------------------------------------------------------- 1 | ### Test Patches ### 2 | 3 | These patches are applied when the automated pull-tester 4 | tests each pull and when master is tested using jenkins. 5 | You can find more information about the tests run at 6 | [http://jenkins.bluematt.me/pull-tester/files/ 7 | ](http://jenkins.bluematt.me/pull-tester/files/) -------------------------------------------------------------------------------- /contrib/test-patches/temp-revert-2.patch: -------------------------------------------------------------------------------- 1 | commit cfae26916dba311f6f75d444301c1f9362267c3e 2 | Author: Matt Corallo 3 | Date: Sun Mar 24 20:45:50 2013 -0400 4 | 5 | Revert "Checkpoint at first block in 11 March chain fork" 6 | 7 | This reverts commit f817c496a1482d05b22c8e539de67f07db1c09d9. 8 | 9 | diff --git a/src/checkpoints.cpp b/src/checkpoints.cpp 10 | index 62234b9..9b11f0b 100644 11 | --- a/src/checkpoints.cpp 12 | +++ b/src/checkpoints.cpp 13 | @@ -44,7 +44,6 @@ namespace Checkpoints 14 | (193000, uint256("0x000000000000059f452a5f7340de6682a977387c17010ff6e6c3bd83ca8b1317")) 15 | (210000, uint256("0x000000000000048b95347e83192f69cf0366076336c639f9b7228e9ba171342e")) 16 | (216116, uint256("0x00000000000001b4f4b433e81ee46494af945cf96014816a4e2370f11b23df4e")) 17 | - (225430, uint256("0x00000000000001c108384350f74090433e7fcf79a606b8e797f065b130575932")) 18 | ; 19 | static const CCheckpointData data = { 20 | &mapCheckpoints, 21 | -------------------------------------------------------------------------------- /contrib/testgen/README.md: -------------------------------------------------------------------------------- 1 | ### TestGen ### 2 | 3 | Utilities to generate test vectors for the data-driven Bitcoin tests. 4 | 5 | Usage: 6 | 7 | gen_base58_test_vectors.py valid 50 > ../../src/test/data/base58_keys_valid.json 8 | gen_base58_test_vectors.py invalid 50 > ../../src/test/data/base58_keys_invalid.json -------------------------------------------------------------------------------- /contrib/verify-commits/gpg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | INPUT=$(/dev/null); do 6 | case "$LINE" in "[GNUPG:] VALIDSIG"*) 7 | while read KEY; do 8 | case "$LINE" in "[GNUPG:] VALIDSIG $KEY "*) VALID=true;; esac 9 | done < ./contrib/verify-commits/trusted-keys 10 | esac 11 | done 12 | if ! $VALID; then 13 | exit 1 14 | fi 15 | echo "$INPUT" | gpg --trust-model always "$@" 2>/dev/null 16 | -------------------------------------------------------------------------------- /contrib/verify-commits/pre-push-hook.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if ! [[ "$2" =~ [git@]?[www.]?github.com[:|/]bitcoin/bitcoin[.git]? ]]; then 3 | exit 0 4 | fi 5 | 6 | while read LINE; do 7 | set -- A $LINE 8 | if [ "$4" != "refs/heads/master" ]; then 9 | continue 10 | fi 11 | if ! ./contrib/verify-commits/verify-commits.sh $3 > /dev/null 2>&1; then 12 | echo "ERROR: A commit is not signed, can't push" 13 | ./contrib/verify-commits/verify-commits.sh 14 | exit 1 15 | fi 16 | done < /dev/stdin 17 | -------------------------------------------------------------------------------- /contrib/verify-commits/trusted-git-root: -------------------------------------------------------------------------------- 1 | 053038e5ba116cb319fb85f3cb3e062cf1b3df15 2 | -------------------------------------------------------------------------------- /contrib/verify-commits/trusted-keys: -------------------------------------------------------------------------------- 1 | 71A3B16735405025D447E8F274810B012346C9A6 2 | 1F4410F6A89268CE3197A84C57896D2FF8F0B657 3 | 01CDF4627A3B88AAE4A571C87588242FBE38D3A8 4 | AF8BE07C7049F3A26B239D5325B3083201782B2F 5 | 81291FA67D2C379A006A053FEAB5AF94D9E9ABE7 6 | -------------------------------------------------------------------------------- /contrib/verify-commits/verify-commits.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | DIR=$(dirname "$0") 4 | 5 | echo "Please verify all commits in the following list are not evil:" 6 | git log "$DIR" 7 | 8 | VERIFIED_ROOT=$(cat "${DIR}/trusted-git-root") 9 | 10 | HAVE_FAILED=false 11 | IS_SIGNED () { 12 | if [ $1 = $VERIFIED_ROOT ]; then 13 | return 0; 14 | fi 15 | if ! git -c "gpg.program=${DIR}/gpg.sh" verify-commit $1 > /dev/null 2>&1; then 16 | return 1; 17 | fi 18 | local PARENTS=$(git show -s --format=format:%P $1) 19 | for PARENT in $PARENTS; do 20 | if IS_SIGNED $PARENT > /dev/null; then 21 | return 0; 22 | fi 23 | done 24 | if ! "$HAVE_FAILED"; then 25 | echo "No parent of $1 was signed with a trusted key!" > /dev/stderr 26 | echo "Parents are:" > /dev/stderr 27 | for PARENT in $PARENTS; do 28 | git show -s $PARENT > /dev/stderr 29 | done 30 | HAVE_FAILED=true 31 | fi 32 | return 1; 33 | } 34 | 35 | if [ x"$1" = "x" ]; then 36 | TEST_COMMIT="HEAD" 37 | else 38 | TEST_COMMIT="$1" 39 | fi 40 | 41 | IS_SIGNED "$TEST_COMMIT" 42 | RES=$? 43 | if [ "$RES" = 1 ]; then 44 | if ! "$HAVE_FAILED"; then 45 | echo "$TEST_COMMIT was not signed with a trusted key!" 46 | fi 47 | else 48 | echo "There is a valid path from $TEST_COMMIT to $VERIFIED_ROOT where all commits are signed!" 49 | fi 50 | 51 | exit $RES 52 | -------------------------------------------------------------------------------- /contrib/verifysfbinaries/README.md: -------------------------------------------------------------------------------- 1 | ### Verify SF Binaries ### 2 | This script attempts to download the signature file `SHA256SUMS.asc` from https://bitcoin.org. 3 | 4 | It first checks if the signature passes, and then downloads the files specified in the file, and checks if the hashes of these files match those that are specified in the signature file. 5 | 6 | The script returns 0 if everything passes the checks. It returns 1 if either the signature check or the hash check doesn't pass. If an error occurs the return value is 2. -------------------------------------------------------------------------------- /darwin.host.mk.patch: -------------------------------------------------------------------------------- 1 | *** depends/hosts/darwin.mk 2017-01-03 10:53:52.440371182 +0000 2 | --- ../../komodo-jl777/depends/hosts/darwin.mk 2017-01-03 09:48:21.650035146 +0000 3 | *************** 4 | *** 2,9 **** 5 | OSX_SDK_VERSION=10.9 6 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 7 | LD64_VERSION=241.9 8 | ! darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 9 | ! darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 10 | 11 | darwin_CFLAGS=-pipe 12 | darwin_CXXFLAGS=$(darwin_CFLAGS) 13 | --- 2,9 ---- 14 | OSX_SDK_VERSION=10.9 15 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 16 | LD64_VERSION=241.9 17 | ! darwin_CC=clang -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 18 | ! darwin_CXX=clang++ -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 19 | 20 | darwin_CFLAGS=-pipe 21 | darwin_CXXFLAGS=$(darwin_CFLAGS) 22 | -------------------------------------------------------------------------------- /depends/.gitignore: -------------------------------------------------------------------------------- 1 | SDKs/ 2 | work/ 3 | built/ 4 | sources/ 5 | config.site 6 | x86_64* 7 | i686* 8 | mips* 9 | arm* 10 | -------------------------------------------------------------------------------- /depends/builders/darwin.mk: -------------------------------------------------------------------------------- 1 | build_darwin_CC = gcc-5 2 | build_darwin_CXX = g++-5 3 | build_darwin_AR: = $(shell xcrun -f ar) 4 | build_darwin_RANLIB: = $(shell xcrun -f ranlib) 5 | build_darwin_STRIP: = $(shell xcrun -f strip) 6 | build_darwin_OTOOL: = $(shell xcrun -f otool) 7 | build_darwin_NM: = $(shell xcrun -f nm) 8 | build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 9 | build_darwin_SHA256SUM = shasum -a 256 10 | build_darwin_DOWNLOAD = curl --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -L -f -o 11 | 12 | #darwin host on darwin builder. overrides darwin host preferences. 13 | darwin_CC= gcc-5 14 | darwin_CXX= g++-5 15 | darwin_AR:=$(shell xcrun -f ar) 16 | darwin_RANLIB:=$(shell xcrun -f ranlib) 17 | darwin_STRIP:=$(shell xcrun -f strip) 18 | darwin_LIBTOOL:=$(shell xcrun -f libtool) 19 | darwin_OTOOL:=$(shell xcrun -f otool) 20 | darwin_NM:=$(shell xcrun -f nm) 21 | darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) 22 | darwin_native_toolchain= 23 | -------------------------------------------------------------------------------- /depends/builders/default.mk: -------------------------------------------------------------------------------- 1 | default_build_CC = gcc 2 | default_build_CXX = g++ 3 | default_build_AR = ar 4 | default_build_RANLIB = ranlib 5 | default_build_STRIP = strip 6 | default_build_NM = nm 7 | default_build_OTOOL = otool 8 | default_build_INSTALL_NAME_TOOL = install_name_tool 9 | 10 | define add_build_tool_func 11 | build_$(build_os)_$1 ?= $$(default_build_$1) 12 | build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) 13 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 14 | endef 15 | $(foreach var,CC CXX AR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL,$(eval $(call add_build_tool_func,$(var)))) 16 | define add_build_flags_func 17 | build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) 18 | build_$1=$$(build_$(build_arch)_$(build_os)_$1) 19 | endef 20 | $(foreach flags, CFLAGS CXXFLAGS LDFLAGS, $(eval $(call add_build_flags_func,$(flags)))) 21 | -------------------------------------------------------------------------------- /depends/builders/linux.mk: -------------------------------------------------------------------------------- 1 | build_linux_SHA256SUM = sha256sum 2 | build_linux_DOWNLOAD = wget --timeout=$(DOWNLOAD_CONNECT_TIMEOUT) --tries=$(DOWNLOAD_RETRIES) -nv -O 3 | -------------------------------------------------------------------------------- /depends/hosts/darwin.mk: -------------------------------------------------------------------------------- 1 | OSX_MIN_VERSION=10.7 2 | OSX_SDK_VERSION=10.9 3 | OSX_SDK=$(SDK_PATH)/MacOSX$(OSX_SDK_VERSION).sdk 4 | LD64_VERSION=241.9 5 | darwin_CC=gcc-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 6 | darwin_CXX=g++-5 -target $(host) -mmacosx-version-min=$(OSX_MIN_VERSION) --sysroot $(OSX_SDK) -mlinker-version=$(LD64_VERSION) 7 | 8 | darwin_CFLAGS=-pipe 9 | darwin_CXXFLAGS=$(darwin_CFLAGS) 10 | 11 | darwin_release_CFLAGS=-O2 12 | darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) 13 | 14 | darwin_debug_CFLAGS=-O1 15 | darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) 16 | 17 | darwin_native_toolchain=native_cctools 18 | -------------------------------------------------------------------------------- /depends/hosts/default.mk: -------------------------------------------------------------------------------- 1 | default_host_CC = $(host_toolchain)gcc 2 | default_host_CXX = $(host_toolchain)g++ 3 | default_host_AR = $(host_toolchain)ar 4 | default_host_RANLIB = $(host_toolchain)ranlib 5 | default_host_STRIP = $(host_toolchain)strip 6 | default_host_LIBTOOL = $(host_toolchain)libtool 7 | default_host_INSTALL_NAME_TOOL = $(host_toolchain)install_name_tool 8 | default_host_OTOOL = $(host_toolchain)otool 9 | default_host_NM = $(host_toolchain)nm 10 | 11 | define add_host_tool_func 12 | $(host_os)_$1?=$$(default_host_$1) 13 | $(host_arch)_$(host_os)_$1?=$$($(host_os)_$1) 14 | $(host_arch)_$(host_os)_$(release_type)_$1?=$$($(host_os)_$1) 15 | host_$1=$$($(host_arch)_$(host_os)_$1) 16 | endef 17 | 18 | define add_host_flags_func 19 | $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) 20 | $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) 21 | host_$1 = $$($(host_arch)_$(host_os)_$1) 22 | host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) 23 | endef 24 | 25 | $(foreach tool,CC CXX AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL,$(eval $(call add_host_tool_func,$(tool)))) 26 | $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) 27 | -------------------------------------------------------------------------------- /depends/hosts/linux.mk: -------------------------------------------------------------------------------- 1 | linux_CFLAGS=-pipe 2 | linux_CXXFLAGS=$(linux_CFLAGS) 3 | 4 | linux_release_CFLAGS=-O1 5 | linux_release_CXXFLAGS=$(linux_release_CFLAGS) 6 | 7 | linux_debug_CFLAGS=-O1 8 | linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) 9 | 10 | linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 11 | 12 | ifeq (86,$(findstring 86,$(build_arch))) 13 | i686_linux_CC=gcc -m32 14 | i686_linux_CXX=g++ -m32 15 | i686_linux_AR=ar 16 | i686_linux_RANLIB=ranlib 17 | i686_linux_NM=nm 18 | i686_linux_STRIP=strip 19 | 20 | x86_64_linux_CC=gcc -m64 21 | x86_64_linux_CXX=g++ -m64 22 | x86_64_linux_AR=ar 23 | x86_64_linux_RANLIB=ranlib 24 | x86_64_linux_NM=nm 25 | x86_64_linux_STRIP=strip 26 | else 27 | i686_linux_CC=$(default_host_CC) -m32 28 | i686_linux_CXX=$(default_host_CXX) -m32 29 | x86_64_linux_CC=$(default_host_CC) -m64 30 | x86_64_linux_CXX=$(default_host_CXX) -m64 31 | endif 32 | -------------------------------------------------------------------------------- /depends/hosts/mingw32.mk: -------------------------------------------------------------------------------- 1 | mingw32_CC=x86_64-w64-mingw32-gcc-posix 2 | mingw32_CXX=x86_64-w64-mingw32-g++-posix 3 | mingw32_CFLAGS=-pipe -std=c11 4 | mingw32_CXXFLAGS=$(mingw32_CFLAGS) -std=c++11 5 | 6 | mingw32_release_CFLAGS=-O2 7 | mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) 8 | 9 | mingw32_debug_CFLAGS=-O1 10 | mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) 11 | 12 | mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC 13 | -------------------------------------------------------------------------------- /depends/packages/bdb.mk: -------------------------------------------------------------------------------- 1 | package=bdb 2 | $(package)_version=6.2.23 3 | $(package)_download_path=http://download.oracle.com/berkeley-db 4 | $(package)_file_name=db-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=47612c8991aa9ac2f6be721267c8d3cdccf5ac83105df8e50809daea24e95dc7 6 | $(package)_build_subdir=build_unix 7 | 8 | define $(package)_set_vars 9 | $(package)_config_opts=--disable-shared --enable-cxx --disable-replication 10 | $(package)_config_opts_mingw32=--enable-mingw 11 | $(package)_config_opts_linux=--with-pic 12 | endef 13 | 14 | define $(package)_config_cmds 15 | ../dist/$($(package)_autoconf) 16 | endef 17 | 18 | 19 | ifeq ($(build_os),darwin) 20 | define $(package)_preprocess_cmds 21 | sed -i -e "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h 22 | endef 23 | else ifeq ($(host_os),mingw32) 24 | define $(package)_preprocess_cmds 25 | sed -i "s/WinIoCtl.h/winioctl.h/g" src/dbinc/win_db.h 26 | endef 27 | endif 28 | 29 | define $(package)_build_cmds 30 | $(MAKE) libdb_cxx-6.2.a libdb-6.2.a 31 | endef 32 | 33 | define $(package)_stage_cmds 34 | $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include 35 | endef 36 | -------------------------------------------------------------------------------- /depends/packages/googlemock.mk: -------------------------------------------------------------------------------- 1 | # url=https://github.com/google/googlemock/archive/release-1.7.0.tar.gz 2 | 3 | package=googlemock 4 | $(package)_version=1.7.0 5 | $(package)_dependencies=googletest 6 | 7 | $(package)_download_path=https://github.com/google/$(package)/archive/ 8 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 9 | $(package)_download_file=release-$($(package)_version).tar.gz 10 | $(package)_sha256_hash=3f20b6acb37e5a98e8c4518165711e3e35d47deb6cdb5a4dd4566563b5efd232 11 | 12 | ifeq ($(build_os),darwin) 13 | define $(package)_set_vars 14 | $(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" 15 | endef 16 | endif 17 | 18 | ifeq ($(build_os),darwin) 19 | $(package)_install=ginstall 20 | define $(package)_build_cmds 21 | $(MAKE) -C make GTEST_DIR='$(host_prefix)' gmock-all.o 22 | endef 23 | else 24 | $(package)_install=install 25 | define $(package)_build_cmds 26 | $(MAKE) -C make GTEST_DIR='$(host_prefix)' CXXFLAGS='-fPIC' gmock-all.o 27 | endef 28 | endif 29 | 30 | 31 | 32 | 33 | 34 | define $(package)_stage_cmds 35 | $($(package)_install) -D ./make/gmock-all.o $($(package)_staging_dir)$(host_prefix)/lib/libgmock.a && \ 36 | cp -a ./include $($(package)_staging_dir)$(host_prefix)/include 37 | endef 38 | -------------------------------------------------------------------------------- /depends/packages/googletest.mk: -------------------------------------------------------------------------------- 1 | package=googletest 2 | $(package)_version=1.7.0 3 | $(package)_download_path=https://github.com/google/$(package)/archive/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_download_file=release-$($(package)_version).tar.gz 6 | $(package)_sha256_hash=f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc 7 | 8 | ifeq ($(build_os),darwin) 9 | define $(package)_set_vars 10 | $(package)_build_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" 11 | endef 12 | endif 13 | 14 | ifeq ($(build_os),darwin) 15 | $(package)_install=ginstall 16 | define $(package)_build_cmds 17 | $(MAKE) -C make gtest.a 18 | endef 19 | else 20 | $(package)_install=install 21 | define $(package)_build_cmds 22 | $(MAKE) -C make CXXFLAGS=-fPIC gtest.a 23 | endef 24 | endif 25 | 26 | define $(package)_stage_cmds 27 | $($(package)_install) -D ./make/gtest.a $($(package)_staging_dir)$(host_prefix)/lib/libgtest.a && \ 28 | cp -a ./include $($(package)_staging_dir)$(host_prefix)/include 29 | endef 30 | -------------------------------------------------------------------------------- /depends/packages/libcurl.mk: -------------------------------------------------------------------------------- 1 | package=libcurl 2 | $(package)_version=7.54.0 3 | $(package)_download_path=https://curl.haxx.se/download 4 | $(package)_file_name=curl-$($(package)_version).tar.gz 5 | $(package)_sha256_hash=a84b635941c74e26cce69dd817489bec687eb1f230e7d1897fc5b5f108b59adf 6 | $(package)_config_opts_linux=--disable-shared --enable-static --prefix=$(host_prefix) 7 | $(package)_config_opts_mingw32=--enable-mingw --disable-shared --enable-static --prefix=$(host_prefix) --host=x86_64-w64-mingw32 8 | $(package)_config_opts_darwin=--disable-shared --enable-static --prefix=$(host_prefix) 9 | $(package)_cflags_darwin=-mmacosx-version-min=10.9 10 | $(package)_conf_tool=./configure 11 | 12 | ifeq ($(build_os),darwin) 13 | define $(package)_set_vars 14 | $(package)_build_env=MACOSX_DEPLOYMENT_TARGET="10.9" 15 | endef 16 | endif 17 | 18 | define $(package)_config_cmds 19 | $($(package)_conf_tool) $($(package)_config_opts) 20 | endef 21 | 22 | 23 | ifeq ($(build_os),darwin) 24 | define $(package)_build_cmds 25 | $(MAKE) CPPFLAGS='-fPIC' CFLAGS='-mmacosx-version-min=10.9' 26 | endef 27 | else 28 | define $(package)_build_cmds 29 | $(MAKE) 30 | endef 31 | endif 32 | 33 | define $(package)_stage_cmds 34 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 35 | endef 36 | -------------------------------------------------------------------------------- /depends/packages/libevent.mk: -------------------------------------------------------------------------------- 1 | package=libevent 2 | $(package)_version=2.1.8 3 | $(package)_download_path=https://github.com/libevent/libevent/archive/ 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz 5 | $(package)_download_file=release-$($(package)_version)-stable.tar.gz 6 | $(package)_sha256_hash=316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d 7 | 8 | define $(package)_preprocess_cmds 9 | ./autogen.sh 10 | endef 11 | 12 | define $(package)_set_vars 13 | $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress 14 | $(package)_config_opts_release=--disable-debug-mode 15 | $(package)_config_opts_linux=--with-pic 16 | endef 17 | 18 | define $(package)_config_cmds 19 | $($(package)_autoconf) 20 | endef 21 | 22 | define $(package)_build_cmds 23 | $(MAKE) 24 | endef 25 | 26 | define $(package)_stage_cmds 27 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 28 | endef 29 | 30 | define $(package)_postprocess_cmds 31 | endef 32 | -------------------------------------------------------------------------------- /depends/packages/libsodium.mk: -------------------------------------------------------------------------------- 1 | package=libsodium 2 | $(package)_version=1.0.11 3 | $(package)_download_path=https://supernetorg.bintray.com/misc 4 | $(package)_file_name=libsodium-1.0.11.tar.gz 5 | $(package)_sha256_hash=a14549db3c49f6ae2170cbbf4664bd48ace50681045e8dbea7c8d9fb96f9c765 6 | $(package)_dependencies= 7 | $(package)_config_opts= 8 | 9 | define $(package)_preprocess_cmds 10 | cd $($(package)_build_subdir); ./autogen.sh 11 | endef 12 | 13 | define $(package)_config_cmds 14 | $($(package)_autoconf) --enable-static --disable-shared 15 | endef 16 | 17 | define $(package)_build_cmds 18 | $(MAKE) 19 | endef 20 | 21 | define $(package)_stage_cmds 22 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 23 | endef 24 | -------------------------------------------------------------------------------- /depends/packages/native_ccache.mk: -------------------------------------------------------------------------------- 1 | package=native_ccache 2 | $(package)_version=3.3.1 3 | $(package)_download_path=https://www.samba.org/ftp/ccache 4 | $(package)_file_name=ccache-$($(package)_version).tar.bz2 5 | $(package)_sha256_hash=cb6e4bafbb19ba0a2ec43386b123a5f92a20e1e3384c071d5d13e0cb3c84bf73 6 | 7 | define $(package)_set_vars 8 | $(package)_config_opts= 9 | endef 10 | 11 | define $(package)_config_cmds 12 | $($(package)_autoconf) 13 | endef 14 | 15 | define $(package)_build_cmds 16 | $(MAKE) 17 | endef 18 | 19 | define $(package)_stage_cmds 20 | $(MAKE) DESTDIR=$($(package)_staging_dir) install 21 | endef 22 | 23 | define $(package)_postprocess_cmds 24 | rm -rf lib include 25 | endef 26 | -------------------------------------------------------------------------------- /depends/packages/packages.mk: -------------------------------------------------------------------------------- 1 | rust_packages := rust librustzcash 2 | zcash_packages := libsnark libgmp libsodium 3 | 4 | ifeq ($(host_os),linux) 5 | packages := boost openssl libevent zeromq $(zcash_packages) googletest googlemock 6 | else 7 | packages := boost openssl libevent zeromq $(zcash_packages) googletest googlemock libcurl 8 | endif 9 | 10 | 11 | native_packages := native_ccache 12 | 13 | wallet_packages=bdb 14 | 15 | upnp_packages=miniupnpc 16 | -------------------------------------------------------------------------------- /depends/packages/rust.mk: -------------------------------------------------------------------------------- 1 | package=rust 2 | $(package)_version=1.16.0 3 | $(package)_download_path=https://static.rust-lang.org/dist 4 | ifeq ($(build_os),darwin) 5 | $(package)_file_name=rust-$($(package)_version)-x86_64-apple-darwin.tar.gz 6 | $(package)_sha256_hash=2d08259ee038d3a2c77a93f1a31fc59e7a1d6d1bbfcba3dba3c8213b2e5d1926 7 | else ifeq ($(host_os),mingw32) 8 | $(package)_file_name=rust-$($(package)_version)-i686-unknown-linux-gnu.tar.gz 9 | $(package)_sha256_hash=b5859161ebb182d3b75fa14a5741e5de87b088146fb0ef4a30f3b2439c6179c5 10 | else 11 | $(package)_file_name=rust-$($(package)_version)-x86_64-unknown-linux-gnu.tar.gz 12 | $(package)_sha256_hash=48621912c242753ba37cad5145df375eeba41c81079df46f93ffb4896542e8fd 13 | endif 14 | 15 | define $(package)_stage_cmds 16 | ./install.sh --destdir=$($(package)_staging_dir) --prefix=$(host_prefix)/native --disable-ldconfig 17 | endef 18 | -------------------------------------------------------------------------------- /depends/patches/boost/deprecated_auto_ptr.patch: -------------------------------------------------------------------------------- 1 | --- boost_1_62_0-orig/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp 2016-09-29 14:03:47.317997658 +1300 2 | +++ boost_1_62_0/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp 2016-09-29 14:07:41.308726372 +1300 3 | @@ -13,10 +13,16 @@ 4 | 5 | #if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) 6 | #include 7 | +#include 8 | #include 9 | #include 10 | #include // for std::auto_ptr 11 | #include 12 | + 13 | +#if defined( BOOST_SP_DISABLE_DEPRECATED ) 14 | +#pragma GCC diagnostic push 15 | +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" 16 | +#endif 17 | #endif 18 | 19 | #ifdef BOOST_SPIRIT_THREADSAFE 20 | @@ -370,4 +376,10 @@ 21 | 22 | }} // namespace boost::spirit 23 | 24 | +#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) 25 | +#if defined( BOOST_SP_DISABLE_DEPRECATED ) 26 | +#pragma GCC diagnostic pop 27 | +#endif 28 | +#endif 29 | + 30 | #endif 31 | -------------------------------------------------------------------------------- /depends/patches/boost/include_poll.patch: -------------------------------------------------------------------------------- 1 | --- boost_1_62_0-orig/boost/asio/detail/socket_types.hpp 2016-09-21 15:33:21.000000000 +0100 2 | +++ boost_1_62_0/boost/asio/detail/socket_types.hpp 2016-10-18 03:08:41.712254217 +0100 3 | @@ -58,7 +58,7 @@ 4 | #else 5 | # include 6 | # if !defined(__SYMBIAN32__) 7 | -# include 8 | +# include 9 | # endif 10 | # include 11 | # include 12 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/fix-solaris-compilation.patch: -------------------------------------------------------------------------------- 1 | From 71ce1d6dfa5424f8fe8633e23494c7638ea2c79e Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Thu, 10 Nov 2016 21:55:33 +0100 4 | Subject: [PATCH] fix for Solaris 11 compilation 5 | 6 | see #216 7 | --- 8 | miniupnpc/Makefile | 2 ++ 9 | miniupnpc/minissdpc.c | 3 +++ 10 | 2 files changed, 5 insertions(+) 11 | 12 | diff --git a/miniupnpc/Makefile b/miniupnpc/Makefile 13 | index 5c23000..72cdc0f 100644 14 | --- a/miniupnpc/Makefile 15 | +++ b/miniupnpc/Makefile 16 | @@ -43,10 +43,12 @@ CFLAGS += -D_NETBSD_SOURCE 17 | endif 18 | ifneq ($(OS), FreeBSD) 19 | ifneq ($(OS), Darwin) 20 | +ifneq ($(OS), SunOS) 21 | #CFLAGS += -D_POSIX_C_SOURCE=200112L 22 | CFLAGS += -D_XOPEN_SOURCE=600 23 | endif 24 | endif 25 | +endif 26 | #CFLAGS += -ansi 27 | # -DNO_GETADDRINFO 28 | INSTALL = install 29 | diff --git a/miniupnpc/minissdpc.c b/miniupnpc/minissdpc.c 30 | index f200f07..263160e 100644 31 | --- a/miniupnpc/minissdpc.c 32 | +++ b/miniupnpc/minissdpc.c 33 | @@ -73,6 +73,9 @@ struct sockaddr_un { 34 | 35 | #if !defined(HAS_IP_MREQN) && !defined(_WIN32) 36 | #include 37 | +#if defined(__sun) 38 | +#include 39 | +#endif 40 | #endif 41 | 42 | #if defined(HAS_IP_MREQN) && defined(NEED_STRUCT_IP_MREQN) 43 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/patch-strlen-patch.patch: -------------------------------------------------------------------------------- 1 | From 0aa7c46227acd8ddb135c577674ad454bf2fba86 Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Fri, 11 Nov 2016 17:53:21 +0100 4 | Subject: [PATCH] remove unsigned/signed comparison 5 | 6 | --- 7 | miniupnpc/portlistingparse.c | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c 11 | index 1bed763..07f3f87 100644 12 | --- a/miniupnpc/portlistingparse.c 13 | +++ b/miniupnpc/portlistingparse.c 14 | @@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l) 15 | pdata->curelt = PortMappingEltNone; 16 | for(i = 0; elements[i].str; i++) 17 | { 18 | - if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0) 19 | + if(strlen(elements[i].str) == (size_t)l && memcmp(name, elements[i].str, l) == 0) 20 | { 21 | pdata->curelt = elements[i].code; 22 | break; 23 | -------------------------------------------------------------------------------- /depends/patches/miniupnpc/strlen-before-memcmp.patch: -------------------------------------------------------------------------------- 1 | From ec1c49bb0cd5e448e6f0adee7de3a831c4869bdd Mon Sep 17 00:00:00 2001 2 | From: Thomas Bernard 3 | Date: Fri, 11 Nov 2016 17:24:39 +0100 4 | Subject: [PATCH] check strlen before memcmp 5 | 6 | 1st try to fix #220 7 | --- 8 | miniupnpc/portlistingparse.c | 2 +- 9 | 1 file changed, 1 insertion(+), 1 deletion(-) 10 | 11 | diff --git a/miniupnpc/portlistingparse.c b/miniupnpc/portlistingparse.c 12 | index 0e09278..1bed763 100644 13 | --- a/miniupnpc/portlistingparse.c 14 | +++ b/miniupnpc/portlistingparse.c 15 | @@ -55,7 +55,7 @@ startelt(void * d, const char * name, int l) 16 | pdata->curelt = PortMappingEltNone; 17 | for(i = 0; elements[i].str; i++) 18 | { 19 | - if(memcmp(name, elements[i].str, l) == 0) 20 | + if(strlen(elements[i].str) == l && memcmp(name, elements[i].str, l) == 0) 21 | { 22 | pdata->curelt = elements[i].code; 23 | break; 24 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.12.md: -------------------------------------------------------------------------------- 1 | Version 0.3.12 is now available. 2 | 3 | Features: 4 | * json-rpc errors return a more standard error object. (thanks to Gavin Andresen) 5 | * json-rpc command line returns exit codes. 6 | * json-rpc "backupwallet" command. 7 | * Recovers and continues if an exception is caused by a message you received. Other nodes shouldn't be able to cause an exception, and it hasn't happened before, but if a way is found to cause an exception, this would keep it from being used to stop network nodes. 8 | 9 | If you have json-rpc code that checks the contents of the error string, you need to change it to expect error objects of the form {"code":,"message":}, which is the standard. See this thread: 10 | http://www.bitcoin.org/smf/index.php?topic=969.0 11 | 12 | Download: 13 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.12/ 14 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.14.md: -------------------------------------------------------------------------------- 1 | Version 0.3.14 is now available 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.14/ 3 | 4 | Changes: 5 | * Key pool feature for safer wallet backup 6 | Gavin Andresen: 7 | * TEST network mode with switch -testnet 8 | * Option to use SSL for JSON-RPC connections on unix/osx 9 | * validateaddress RPC command 10 | eurekafag: 11 | * Russian translation 12 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.15.md: -------------------------------------------------------------------------------- 1 | * paytxfee switch is now per KB, so it adds the correct fee for large transactions 2 | * sending avoids using coins with less than 6 confirmations if it can 3 | * BitcoinMiner processes transactions in priority order based on age of dependencies 4 | * make sure generation doesn't start before block 74000 downloaded 5 | * bugfixes by Dean Gores 6 | * testnet, keypoololdest and paytxfee added to getinfo 7 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.16.md: -------------------------------------------------------------------------------- 1 | Never released. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.17.md: -------------------------------------------------------------------------------- 1 | Version 0.3.17 is now available. 2 | 3 | Changes: 4 | * new getwork, thanks m0mchil 5 | * added transaction fee setting in UI options menu 6 | * free transaction limits 7 | * sendtoaddress returns transaction id instead of "sent" 8 | * getaccountaddress 9 | 10 | The UI transaction fee setting was easy since it was still there from 0.1.5 and all I had to do was re-enable it. 11 | 12 | The accounts-based commands: move, sendfrom and getbalance will be in the next release. We still have some more changes to make first. 13 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.18.md: -------------------------------------------------------------------------------- 1 | Changes: 2 | * Fixed a wallet.dat compatibility problem if you downgraded from 0.3.17 and then upgraded again 3 | * IsStandard() check to only include known transaction types in blocks 4 | * Jgarzik's optimisation to speed up the initial block download a little 5 | 6 | The main addition in this release is the Accounts-Based JSON-RPC commands that Gavin's been working on (more details at http://www.bitcoin.org/smf/index.php?topic=1886.0). 7 | * getaccountaddress 8 | * sendfrom 9 | * move 10 | * getbalance 11 | * listtransactions 12 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.19.md: -------------------------------------------------------------------------------- 1 | There's more work to do on DoS, but I'm doing a quick build of what I have so far in case it's needed, before venturing into more complex ideas. The build for this is version 0.3.19. 2 | 3 | - Added some DoS controls 4 | As Gavin and I have said clearly before, the software is not at all resistant to DoS attack. This is one improvement, but there are still more ways to attack than I can count. 5 | 6 | I'm leaving the -limitfreerelay part as a switch for now and it's there if you need it. 7 | 8 | - Removed "safe mode" alerts 9 | "safe mode" alerts was a temporary measure after the 0.3.9 overflow bug. We can say all we want that users can just run with "-disablesafemode", but it's better just not to have it for the sake of appearances. It was never intended as a long term feature. Safe mode can still be triggered by seeing a longer (greater total PoW) invalid block chain. 10 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.1.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.2.md: -------------------------------------------------------------------------------- 1 | The maxsendbuffer bug (0.3.20.1 clients not being able to download the block chain from other 0.3.20.1 clients) was only going to get 2 | worse as people upgraded, so I cherry-picked the bug fix and created a minor release yesterday. 3 | 4 | The Amazon Machine Images I used to do the builds are available: 5 | 6 | ami-38a05251 Bitcoin-v0.3.20.2 Mingw (Windows; Administrator password 'bitcoin development') 7 | ami-30a05259 Bitcoin_0.3.20.2 Linux32 8 | ami-8abc4ee3 Bitcoin_0.3.20.2 Linux64 9 | 10 | (mac build will be done soon) 11 | 12 | If you have already downloaded version 0.3.20.1, please either add this to your bitcoin.conf file: 13 | 14 | maxsendbuffer=10000 15 | maxreceivebuffer=10000 16 | 17 | ... or download the new version. 18 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.20.md: -------------------------------------------------------------------------------- 1 | Please checkout the git integration branch from: 2 | 3 | https://github.com/bitcoin/bitcoin 4 | 5 | ... and help test. The new features that need testing are: 6 | 7 | * -nolisten : https://github.com/bitcoin/bitcoin/pull/11 8 | * -rescan : scan block chain for missing wallet transactions 9 | * -printtoconsole : https://github.com/bitcoin/bitcoin/pull/37 10 | * RPC gettransaction details : https://github.com/bitcoin/bitcoin/pull/24 11 | * listtransactions new features : https://github.com/bitcoin/bitcoin/pull/10 12 | 13 | Bug fixes that also need testing: 14 | 15 | * -maxconnections= : https://github.com/bitcoin/bitcoin/pull/42 16 | * RPC listaccounts minconf : https://github.com/bitcoin/bitcoin/pull/27 17 | * RPC move, add time to output : https://github.com/bitcoin/bitcoin/pull/21 18 | * ...and several improvements to --help output. 19 | 20 | This needs more testing on Windows! Please drop me a quick private message, email, or IRC message if you are able to do some testing. If you find bugs, please open an issue at: 21 | 22 | https://github.com/bitcoin/bitcoin/issues 23 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.21.md: -------------------------------------------------------------------------------- 1 | Binaries for Bitcoin version 0.3.21 are available at: 2 | https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.21/ 3 | 4 | Changes and new features from the 0.3.20 release include: 5 | 6 | * Universal Plug and Play support. Enable automatic opening of a port for incoming connections by running bitcoin or bitcoind with the - -upnp=1 command line switch or using the Options dialog box. 7 | 8 | * Support for full-precision bitcoin amounts. You can now send, and bitcoin will display, bitcoin amounts smaller than 0.01. However, sending fewer than 0.01 bitcoins still requires a 0.01 bitcoin fee (so you can send 1.0001 bitcoins without a fee, but you will be asked to pay a fee if you try to send 0.0001). 9 | 10 | * A new method of finding bitcoin nodes to connect with, via DNS A records. Use the -dnsseed option to enable. 11 | 12 | For developers, changes to bitcoin's remote-procedure-call API: 13 | 14 | * New rpc command "sendmany" to send bitcoins to more than one address in a single transaction. 15 | 16 | * Several bug fixes, including a serious intermittent bug that would sometimes cause bitcoind to stop accepting rpc requests. 17 | 18 | * -logtimestamps option, to add a timestamp to each line in debug.log. 19 | 20 | * Immature blocks (newly generated, under 120 confirmations) are now shown in listtransactions. 21 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.22.md: -------------------------------------------------------------------------------- 1 | Download URL: https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.22/ 2 | 3 | This is largely a bugfix and TX fee schedule release. We also hope to make 0.3.23 a quick release, to fix problems that the network has seen due to explosive growth in the past week. 4 | 5 | Notable changes: 6 | * Client will accept and relay TX's with 0.0005 BTC fee schedule (users still pay 0.01 BTC per kb, until next version) 7 | * Non-standard transactions accepted on testnet 8 | * Source code tree reorganized (prep for autotools build) 9 | * Remove "Generate Coins" option from GUI, and remove 4way SSE miner. Internal reference CPU miner remains available, but users are directed to external miners for best hash production. 10 | * IRC is overflowing. Client now bootstraps to channels #bitcoin00 - #bitcoin99 11 | * DNS names now may be used with -addnode, -connect (requires -dns to enable) 12 | 13 | RPC changes: 14 | * 'listtransactions' adds 'from' param, for range queries 15 | * 'move' may take account balances negative 16 | * 'settxfee' added, to manually set TX fee 17 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.3.23.md: -------------------------------------------------------------------------------- 1 | Win32, Linux, MacOSX and source releases for bitcoin v0.3.23 have been uploaded to 2 | https://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.3.23/ 3 | 4 | This is another quick bugfix release, trying to deal with the influx of new bitcoin users. 5 | 6 | Main items of note: 7 | 8 | * P2P connect-to-node logic changed to reduce timeout a bit. The network saw a huge influx of new users, who do not permit incoming connections. This change is a short-term hack, to more quickly hunt for useful P2P connections. Better "leaf node" logic is in the works, but this should let us limp along until then. One may use -upnp to properly forward ports, and help the network. 9 | * Transaction fee reduced to 0.0005 for new transactions 10 | * Client will relay transactions with fees as low as 0.0001 BTC 11 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.2.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.3.md: -------------------------------------------------------------------------------- 1 | bitcoind version 0.4.3 is now available for download at: 2 | http://luke.dashjr.org/programs/bitcoin/files/bitcoind-0.4.3/ (until Gavin uploads to SourceForge) 3 | 4 | This is a bugfix-only release based on 0.4.0. 5 | 6 | Please note that the wxBitcoin GUI client is no longer maintained nor supported. If someone would like to step up to maintain this, they should contact Luke-Jr. 7 | 8 | Please report bugs for the daemon only using the issue tracker at github: 9 | https://github.com/bitcoin/bitcoin/issues 10 | 11 | Stable source code is hosted at Gitorious: 12 | http://gitorious.org/bitcoin/bitcoind-stable/archive-tarball/v0.4.3#.tar.gz 13 | 14 | BUG FIXES 15 | 16 | Cease locking memory used by non-sensitive information (this caused a huge performance hit on some platforms, especially noticable during initial blockchain download). 17 | Fixed some address-handling deadlocks (client freezes). 18 | No longer accept inbound connections over the internet when Bitcoin is being used with Tor (identity leak). 19 | Use the correct base transaction fee of 0.0005 BTC for accepting transactions into mined blocks (since 0.4.0, it was incorrectly accepting 0.0001 BTC which was only meant to be relayed). 20 | Add new DNS seeds (maintained by Pieter Wuille and Luke Dashjr). 21 | 22 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.4.5.md: -------------------------------------------------------------------------------- 1 | Never released or release notes were lost. 2 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.6.1.md: -------------------------------------------------------------------------------- 1 | Never released 2 | 3 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.6.3.md: -------------------------------------------------------------------------------- 1 | Bitcoin version 0.6.3 is now available for download at: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.6.3/ 3 | 4 | This is a bug-fix release, with no new features. 5 | 6 | Please report bugs using the issue tracker at github: 7 | https://github.com/bitcoin/bitcoin/issues 8 | 9 | CHANGE SUMMARY 10 | 11 | Fixed a serious denial-of-service attack that could cause the 12 | bitcoin process to become unresponsive. Thanks to Sergio Lerner 13 | for finding and responsibly reporting the problem. (CVE-2012-3789) 14 | 15 | Optimized the process of checking transaction signatures, to 16 | speed up processing of new block messages and make propagating 17 | blocks across the network faster. 18 | 19 | Fixed an obscure bug that could cause the bitcoin process to get 20 | stuck on an invalid block-chain, if the invalid chain was 21 | hundreds of blocks long. 22 | 23 | Bitcoin-Qt no longer automatically selects the first address 24 | in the address book (Issue #1384). 25 | 26 | Fixed minimize-to-dock behavior of Bitcon-Qt on the Mac. 27 | 28 | Added a block checkpoint at block 185,333 to speed up initial 29 | blockchain download. 30 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.8.1.md: -------------------------------------------------------------------------------- 1 | Bitcoin-Qt/bitcoind version 0.8.1 is now available from: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.1/ 3 | 4 | This is a maintenance release that adds a new network rule to avoid 5 | a chain-forking incompatibility with versions 0.7.2 and earlier. 6 | 7 | Please report bugs using the issue tracker at github: 8 | https://github.com/bitcoin/bitcoin/issues 9 | 10 | 11 | How to Upgrade 12 | -------------- 13 | 14 | If you are running an older version, shut it down. Wait 15 | until it has completely shut down (which might take a few minutes for older 16 | versions), then run the installer (on Windows) or just copy over 17 | /Applications/Bitcoin-Qt (on Mac) or bitcoind/bitcoin-qt (on Linux). 18 | 19 | If you are upgrading from version 0.7.2 or earlier, the first time you 20 | run 0.8.1 your blockchain files will be re-indexed, which will take 21 | anywhere from 30 minutes to several hours, depending on the speed of 22 | your machine. 23 | -------------------------------------------------------------------------------- /doc/bitcoin-release-notes/release-notes-0.8.3.md: -------------------------------------------------------------------------------- 1 | Bitcoin-Qt version 0.8.3 is now available from: 2 | http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.3/ 3 | 4 | This is a maintenance release to fix a denial-of-service attack that 5 | can cause nodes to crash. 6 | 7 | Please report bugs using the issue tracker at github: 8 | https://github.com/bitcoin/bitcoin/issues 9 | 10 | 0.8.3 Release notes 11 | 12 | Truncate over-size messages to prevent a memory exhaustion attack. 13 | 14 | Fix a regression that causes excessive re-writing of the 'peers.dat' file. 15 | 16 | 17 | Thanks to Peter Todd for responsibly disclosing the vulnerability 18 | ( CVE-2013-4627 ) and creating a fix. 19 | -------------------------------------------------------------------------------- /doc/files.md: -------------------------------------------------------------------------------- 1 | * zcash.conf: contains configuration settings for zcashd 2 | * zcashd.pid: stores the process id of zcashd while running 3 | * blocks/blk000??.dat: block data (custom, 128 MiB per file) 4 | * blocks/rev000??.dat; block undo data (custom) 5 | * blocks/index/*; block index (LevelDB) 6 | * chainstate/*; block chain state database (LevelDB) 7 | * database/*: BDB database environment 8 | * db.log: wallet database log file 9 | * debug.log: contains debug information and general logging generated by zcashd 10 | * fee_estimates.dat: stores statistics used to estimate minimum transaction fees and priorities required for confirmation 11 | * peers.dat: peer IP address database (custom format) 12 | * wallet.dat: personal wallet (BDB) with keys and transactions 13 | * .cookie: session RPC authentication cookie (written at start when cookie authentication is used, deleted on shutdown): since 0.12.0 14 | * onion_private_key: cached Tor hidden service private key for `-listenonion`: since 0.12.0 15 | -------------------------------------------------------------------------------- /doc/man/Makefile.am: -------------------------------------------------------------------------------- 1 | dist_man1_MANS=zcashd.1 zcash-cli.1 zcash-fetch-params.1 zcash-tx.1 2 | -------------------------------------------------------------------------------- /doc/man/zcash-fetch-params.1: -------------------------------------------------------------------------------- 1 | .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. 2 | .TH ZCASH-FETCH-PARAMS "1" "January 2017" "Zcash - zcash-fetch-params" "User Commands" 3 | .SH NAME 4 | zcash-fetch-params \- Downloads the Zcash network parameters 5 | .SH DESCRIPTION 6 | Zcash \- zcash-fetch\-params 7 | .PP 8 | This script will fetch the Zcash zkSNARK parameters and verify their 9 | integrity with sha256sum. 10 | .PP 11 | If they already exist locally, it will exit now and do nothing else. 12 | .PP 13 | This script will fetch the Zcash zkSNARK parameters and verify their 14 | integrity with sha256sum. 15 | .PP 16 | If they already exist locally, it will exit now and do nothing else. 17 | .SH "SEE ALSO" 18 | The full documentation for 19 | .B Zcash 20 | is maintained as a Texinfo manual. If the 21 | .B info 22 | and 23 | .B Zcash 24 | programs are properly installed at your site, the command 25 | .IP 26 | .B info Zcash 27 | .PP 28 | should give you access to the complete manual. 29 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-0.11.2.z6.md: -------------------------------------------------------------------------------- 1 | Jack Grigg (4): 2 | Equihash: Only compare the first n/(k+1) bits when sorting. 3 | Randomise the nonce in the block header. 4 | Clear mempool before using it for benchmark test, fix parameter name. 5 | Fix memory leak in large tx benchmark. 6 | 7 | Sean Bowe (5): 8 | Increase block size to 2MB and update performance test. 9 | Make sigop limit `20000` just as in Bitcoin, ignoring our change to the blocksize limit. 10 | Remove the mainnet checkpoints. 11 | Fix performance test for block verification. 12 | Make `validatelargetx` test more accurate. 13 | 14 | Taylor Hornby (1): 15 | Add example mock test of CheckTransaction. 16 | 17 | aniemerg (1): 18 | Suppress Libsnark Debugging Info. 19 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.0-rc4.md: -------------------------------------------------------------------------------- 1 | Daira Hopwood (3): 2 | Update pchMessageStart for mainnet and testnet. 3 | Update version numbers for 1.0.0-rc4. 4 | Add release notes for 1.0.0-rc4. 5 | 6 | Jack Grigg (4): 7 | Integrate production Founders' Reward keys 8 | Remove Founders' Reward override from #1398 9 | Regenerate mainnet and testnet genesis blocks for nMaxTipAge change 10 | Update tests for new genesis blocks 11 | 12 | Sean Bowe (1): 13 | Zcash zk-SNARK public parameters for 1.0 "Sprout". 14 | 15 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.0.md: -------------------------------------------------------------------------------- 1 | Jack Grigg (8): 2 | Rework zcutil/build-debian-package.sh to place files correctly 3 | Add lintian check to zcutil/build-debian-package.sh 4 | Fix DEBIAN/control errors raised by lintian 5 | Build libsnark with -march=x86-64 instead of -march=native 6 | Disable the metrics screen on regtest 7 | Add the Zcash genesis blocks 8 | Update tests for new genesis blocks 9 | Update version strings to 1.0.0 10 | 11 | Kevin Gallagher (6): 12 | Use fakeroot to build Debian package 13 | Update Debian package maintainer scripts 14 | Fixes executable mode of maintainer scripts 15 | Add DEBIAN/rules file (required by policy) 16 | Adds zcash.examples and zcash.manpages 17 | Run Lintian after built package is copied to $SRC_PATH 18 | 19 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.2.md: -------------------------------------------------------------------------------- 1 | ITH4Coinomia (2): 2 | Update security-warnings.md 3 | Update init.cpp 4 | 5 | S. Matthew English (1): 6 | enforcing consistency 'tor' to 'Tor' 7 | 8 | Sean Bowe (1): 9 | Write R1CS output to file in GenerateParams. 10 | 11 | Simon (4): 12 | Fixes #1762 segfault when miner is interrupted. 13 | Fixes #1779 so that sending to multiple zaddrs no longer fails. 14 | Add GenIdentity, an identity function for MappedShuffle. 15 | Add transaction size and zaddr output limit checks to z_sendmany. 16 | 17 | -------------------------------------------------------------------------------- /doc/release-notes/release-notes-1.0.7-1.md: -------------------------------------------------------------------------------- 1 | Jay Graber (3): 2 | Add -t to git fetch for release-notes.py 3 | Update version to 1.0.7-1 4 | Update auto-generated manpages to 1.0.7-1 5 | -------------------------------------------------------------------------------- /doc/unit-tests.md: -------------------------------------------------------------------------------- 1 | Compiling/running automated tests 2 | --------------------------------- 3 | 4 | Automated tests will be automatically compiled if dependencies were met in configure 5 | and tests weren't explicitly disabled. 6 | 7 | There are two scripts for running tests: 8 | 9 | * ``qa/zcash/full-test-suite.sh``, to run the main test suite 10 | * ``qa/pull-tester/rpc-tests.sh``, to run the RPC tests. 11 | 12 | The main test suite uses two different testing frameworks. Tests using the Boost 13 | framework are under ``src/test/``; tests using the Google Test/Google Mock 14 | framework are under ``src/gtest/`` and ``src/wallet/gtest/``. The latter framework 15 | is preferred for new Zcash unit tests. 16 | 17 | RPC tests are implemented in Python under the ``qa/rpc-tests/`` directory. 18 | -------------------------------------------------------------------------------- /equihash.cpp.patch: -------------------------------------------------------------------------------- 1 | *** src/crypto/equihash.cpp 2017-01-03 10:53:52.444371361 +0000 2 | --- ../../komodo-jl777/src/crypto/equihash.cpp 2017-01-03 09:48:21.690037241 +0000 3 | *************** 4 | *** 21,50 **** 5 | 6 | #include 7 | 8 | - #ifdef __APPLE__ 9 | - #include 10 | - #include 11 | - 12 | - #define htobe16(x) OSSwapHostToBigInt16(x) 13 | - #define htole16(x) OSSwapHostToLittleInt16(x) 14 | - #define be16toh(x) OSSwapBigToHostInt16(x) 15 | - #define le16toh(x) OSSwapLittleToHostInt16(x) 16 | - 17 | - #define htobe32(x) OSSwapHostToBigInt32(x) 18 | - #define htole32(x) OSSwapHostToLittleInt32(x) 19 | - #define be32toh(x) OSSwapBigToHostInt32(x) 20 | - #define le32toh(x) OSSwapLittleToHostInt32(x) 21 | - 22 | - #define htobe64(x) OSSwapHostToBigInt64(x) 23 | - #define htole64(x) OSSwapHostToLittleInt64(x) 24 | - #define be64toh(x) OSSwapBigToHostInt64(x) 25 | - #define le64toh(x) OSSwapLittleToHostInt64(x) 26 | - 27 | - #define __BIG_ENDIAN BIG_ENDIAN 28 | - #define __LITTLE_ENDIAN LITTLE_ENDIAN 29 | - #define __BYTE_ORDER BYTE_ORDER 30 | - #endif 31 | - 32 | EhSolverCancelledException solver_cancelled; 33 | 34 | template 35 | --- 21,26 ---- 36 | -------------------------------------------------------------------------------- /libzcashconsensus.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: Zcash consensus library 7 | Description: Library for the Zcash consensus protocol. 8 | Version: @PACKAGE_VERSION@ 9 | Libs: -L${libdir} -lzcashconsensus 10 | Cflags: -I${includedir} 11 | Requires.private: libcrypto 12 | -------------------------------------------------------------------------------- /makeDistrib.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TMP_DIR=~/tmp/komodo 4 | 5 | # make a tmp directory 6 | mkdir -p $TMP_DIR 7 | echo "making $TMP_DIR" 8 | 9 | binaries=("komodo-cli" "komodod") 10 | 11 | for binary in "${binaries[@]}"; 12 | do 13 | echo "copying $binary to $TMP_DIR" 14 | 15 | cp src/$binary $TMP_DIR 16 | 17 | # find the dylibs to copy for komodod 18 | DYLIBS=`otool -L $TMP_DIR/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` 19 | echo "copying $DYLIBS to $TMP_DIR" 20 | 21 | # copy the dylibs to the tmpdir 22 | for dylib in $DYLIBS; do cp -rf $dylib $TMP_DIR/; done 23 | 24 | # modify komodod to point to dylibs 25 | echo "modifying $binary to use local libraries" 26 | for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` $TMP_DIR/$binary; done; 27 | done 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /makeRelease.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | binaries=("komodo-cli" "komodod") 4 | 5 | for binary in "${binaries[@]}"; 6 | do 7 | # find the dylibs to copy for komodod 8 | DYLIBS=`otool -L src/$binary | grep "/usr/local" | awk -F' ' '{ print $1 }'` 9 | echo "copying $DYLIBS to $src" 10 | # copy the dylibs to the srcdir 11 | for dylib in $DYLIBS; do cp -rf $dylib src/; done 12 | 13 | # modify komodod to point to dylibs 14 | echo "modifying $binary to use local libraries" 15 | for dylib in $DYLIBS; do install_name_tool -change $dylib @executable_path/`basename $dylib` src/$binary; done; 16 | chmod +x src/$binary 17 | done 18 | -------------------------------------------------------------------------------- /packages.mk.patch: -------------------------------------------------------------------------------- 1 | *** depends/packages/packages.mk 2017-01-03 10:53:52.440371182 +0000 2 | --- ../../komodo-jl777/depends/packages/packages.mk 2017-01-03 09:48:21.650035146 +0000 3 | *************** 4 | *** 1,12 **** 5 | zcash_packages := libsnark libgmp libsodium 6 | - 7 | - ifeq ($(build_os),darwin) 8 | - packages := boost openssl $(zcash_packages) 9 | - else 10 | packages := boost openssl $(zcash_packages) googletest googlemock 11 | - endif 12 | - 13 | - 14 | native_packages := native_ccache 15 | 16 | wallet_packages=bdb 17 | --- 1,5 ---- 18 | -------------------------------------------------------------------------------- /qa/pull-tester/run-bitcoin-cli: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a thin wrapper around bitcoin-cli that strips the Windows-style EOLs 4 | # from the output if present. It is necessary when using bitcoin-cli.exe on 5 | # Linux since shells will interpret the line-endings as part of the result. 6 | 7 | CURDIR=$(cd $(dirname "$0"); pwd) 8 | # Get BUILDDIR and REAL_BITCOIND 9 | 10 | # Grab the value of $REAL_BITCOINCLI which may be bitcoin-cli.exe. 11 | . "${CURDIR}/tests-config.sh" 12 | 13 | "${REAL_BITCOINCLI}" "$@" | sed 's/\r//' 14 | -------------------------------------------------------------------------------- /qa/pull-tester/tests-config.sh.in: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2013-2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | BUILDDIR="@abs_top_builddir@" 7 | EXEEXT="@EXEEXT@" 8 | 9 | # These will turn into comments if they were disabled when configuring. 10 | @ENABLE_WALLET_TRUE@ENABLE_WALLET=1 11 | @BUILD_BITCOIN_UTILS_TRUE@ENABLE_UTILS=1 12 | @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=1 13 | @ENABLE_ZMQ_TRUE@ENABLE_ZMQ=1 14 | 15 | REAL_BITCOIND="$BUILDDIR/src/zcashd${EXEEXT}" 16 | REAL_BITCOINCLI="$BUILDDIR/src/zcash-cli${EXEEXT}" 17 | 18 | -------------------------------------------------------------------------------- /qa/rpc-tests/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | cache 3 | -------------------------------------------------------------------------------- /qa/rpc-tests/disablewallet.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # Copyright (c) 2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | # 7 | # Exercise API with -disablewallet. 8 | # 9 | 10 | from test_framework.test_framework import BitcoinTestFramework 11 | from test_framework.util import * 12 | 13 | class DisableWalletTest (BitcoinTestFramework): 14 | 15 | def setup_chain(self): 16 | print("Initializing test directory "+self.options.tmpdir) 17 | initialize_chain_clean(self.options.tmpdir, 1) 18 | 19 | def setup_network(self, split=False): 20 | self.nodes = start_nodes(1, self.options.tmpdir, [['-disablewallet']]) 21 | self.is_network_split = False 22 | self.sync_all() 23 | 24 | def run_test (self): 25 | # Check regression: https://github.com/bitcoin/bitcoin/issues/6963#issuecomment-154548880 26 | x = self.nodes[0].validateaddress('t3b1jtLvxCstdo1pJs9Tjzc5dmWyvGQSZj8') 27 | assert(x['isvalid'] == False) 28 | x = self.nodes[0].validateaddress('tmGqwWtL7RsbxikDSN26gsbicxVr2xJNe86') 29 | assert(x['isvalid'] == True) 30 | 31 | if __name__ == '__main__': 32 | DisableWalletTest ().main () 33 | -------------------------------------------------------------------------------- /qa/rpc-tests/reindex.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | # Copyright (c) 2014 The Bitcoin Core developers 3 | # Distributed under the MIT software license, see the accompanying 4 | # file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | # 7 | # Test -reindex with CheckBlockIndex 8 | # 9 | from test_framework.test_framework import BitcoinTestFramework 10 | from test_framework.util import * 11 | import os.path 12 | 13 | class ReindexTest(BitcoinTestFramework): 14 | 15 | def setup_chain(self): 16 | print("Initializing test directory "+self.options.tmpdir) 17 | initialize_chain_clean(self.options.tmpdir, 1) 18 | 19 | def setup_network(self): 20 | self.nodes = [] 21 | self.is_network_split = False 22 | self.nodes.append(start_node(0, self.options.tmpdir)) 23 | 24 | def run_test(self): 25 | self.nodes[0].generate(3) 26 | stop_node(self.nodes[0], 0) 27 | wait_bitcoinds() 28 | self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug", "-reindex", "-checkblockindex=1"]) 29 | assert_equal(self.nodes[0].getblockcount(), 3) 30 | print "Success" 31 | 32 | if __name__ == '__main__': 33 | ReindexTest().main() 34 | -------------------------------------------------------------------------------- /qa/rpc-tests/test_framework/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/qa/rpc-tests/test_framework/__init__.py -------------------------------------------------------------------------------- /qa/zcash/ensure-no-dot-so-in-depends.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python2 2 | 3 | import sys 4 | import os 5 | 6 | def main(): 7 | this_script = os.path.abspath(sys.argv[0]) 8 | basedir = os.path.dirname(this_script) 9 | arch_dir = os.path.join( 10 | basedir, 11 | '..', 12 | '..', 13 | 'depends', 14 | 'x86_64-unknown-linux-gnu', 15 | ) 16 | 17 | exit_code = 0 18 | 19 | if os.path.isdir(arch_dir): 20 | lib_dir = os.path.join(arch_dir, 'lib') 21 | libraries = os.listdir(lib_dir) 22 | 23 | for lib in libraries: 24 | if lib.find(".so") != -1: 25 | print lib 26 | exit_code = 1 27 | else: 28 | exit_code = 2 29 | print "arch-specific build dir not present: {}".format(arch_dir) 30 | print "Did you build the ./depends tree?" 31 | print "Are you on a currently unsupported architecture?" 32 | 33 | if exit_code == 0: 34 | print "PASS." 35 | else: 36 | print "FAIL." 37 | 38 | sys.exit(exit_code) 39 | 40 | if __name__ == '__main__': 41 | main() 42 | -------------------------------------------------------------------------------- /qa/zcash/full-test-suite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Execute all of the automated tests related to Zcash. 4 | # 5 | 6 | set -eu 7 | 8 | SUITE_EXIT_STATUS=0 9 | REPOROOT="$(readlink -f "$(dirname "$0")"/../../)" 10 | 11 | function run_test_phase 12 | { 13 | echo "===== BEGIN: $*" 14 | set +e 15 | eval "$@" 16 | if [ $? -eq 0 ] 17 | then 18 | echo "===== PASSED: $*" 19 | else 20 | echo "===== FAILED: $*" 21 | SUITE_EXIT_STATUS=1 22 | fi 23 | set -e 24 | } 25 | 26 | cd "${REPOROOT}" 27 | 28 | # Test phases: 29 | run_test_phase "${REPOROOT}/qa/zcash/check-security-hardening.sh" 30 | run_test_phase "${REPOROOT}/qa/zcash/ensure-no-dot-so-in-depends.py" 31 | 32 | # If make check fails, show test-suite.log as part of our run_test_phase 33 | # output (and fail the phase with false): 34 | run_test_phase make check '||' \ 35 | '{' \ 36 | echo '=== ./src/test-suite.log ===' ';' \ 37 | cat './src/test-suite.log' ';' \ 38 | false ';' \ 39 | '}' 40 | 41 | exit $SUITE_EXIT_STATUS 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /share/pixmaps/addressbook16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/addressbook16.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/addressbook16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/addressbook20.bmp -------------------------------------------------------------------------------- /share/pixmaps/addressbook20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/addressbook20mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/bitcoin-bc.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin-bc.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin.ico -------------------------------------------------------------------------------- /share/pixmaps/bitcoin128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin128.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin16.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin256.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin32.png -------------------------------------------------------------------------------- /share/pixmaps/bitcoin64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/bitcoin64.png -------------------------------------------------------------------------------- /share/pixmaps/check.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/check.ico -------------------------------------------------------------------------------- /share/pixmaps/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/favicon.ico -------------------------------------------------------------------------------- /share/pixmaps/nsis-header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/nsis-header.bmp -------------------------------------------------------------------------------- /share/pixmaps/nsis-wizard.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/nsis-wizard.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/send16.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/send16mask.bmp -------------------------------------------------------------------------------- /share/pixmaps/send16masknoshadow.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/send16masknoshadow.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/send20.bmp -------------------------------------------------------------------------------- /share/pixmaps/send20mask.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/share/pixmaps/send20mask.bmp -------------------------------------------------------------------------------- /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/Makefile.zcash.include: -------------------------------------------------------------------------------- 1 | noinst_PROGRAMS += \ 2 | zcash/GenerateParams \ 3 | zcash/CreateJoinSplit 4 | 5 | # tool for generating our public parameters 6 | zcash_GenerateParams_SOURCES = zcash/GenerateParams.cpp 7 | zcash_GenerateParams_LDADD = \ 8 | $(BOOST_LIBS) \ 9 | $(LIBZCASH) \ 10 | $(LIBBITCOIN_UTIL) \ 11 | $(LIBBITCOIN_CRYPTO) \ 12 | $(LIBZCASH_LIBS) 13 | 14 | # tool for profiling the creation of joinsplits 15 | zcash_CreateJoinSplit_SOURCES = zcash/CreateJoinSplit.cpp 16 | zcash_CreateJoinSplit_LDADD = \ 17 | $(LIBBITCOIN_COMMON) \ 18 | $(LIBZCASH) \ 19 | $(LIBBITCOIN_UTIL) \ 20 | $(LIBBITCOIN_CRYPTO) \ 21 | $(BOOST_LIBS) \ 22 | $(LIBZCASH_LIBS) 23 | -------------------------------------------------------------------------------- /src/REVS.batch2.txids: -------------------------------------------------------------------------------- 1 | bc4eca8000603d16ae491bf1bf4f5fda622f54d3b0ffdaefe12337461bb88d5f 2 | cda5da13119d348565085119b37951f0ee2f6866d677bbca2295d5d44e365b4a 3 | ce9516059a943070ec233716c878e90bfcf6456c9a35c587fc9f6c74008d2d72 4 | c1f32cbd341d9e7e51046378ad072b0aaa55d1fc3b970b606ed708d3bb02d7d6 5 | f2a2f2a2b4cc99b5cc89fefe8340252b0bbb7ecd83df809f2bf782a06d9bcdd0 6 | 5e44a6d50cd1cb64fa6349b49d5793d12988c4c3d517bb271f396a9fd66d3cae 7 | 6f6771ef52833bf504397c80f06e58a77e58387d809b42c8ae3bb6301796dcf0 8 | 96d12c7828f3f3fa7983aac02b724f5a53897856b7419e0728d78ae7e3756765 9 | 84fde41cd955564a18f6141349dffb26dc8ad498fcb3494052a8aeb0157ffb3c 10 | 93d6d89195f5332f7bae6e9ffc65d5892fa169446d90ed3d7d5017389a2a3ff6 11 | 2dc7e37ff11703c01e1a6301746d2586549fe091bbf6cf7bf80c6b49c1f38d1c 12 | 1732b6942035ba7482f9a6c77a47f90b529c51d8b22c4d14a7a430d7b8cf3303 13 | 733a0ef1b7ef603664271f7a3667e39809f9a4f7b618a4a9c00c3e8a6876d57c 14 | cf2ed6deeaf6600b2fff0b5db13c5f950dc655b06420eee816edbfad7c07c991 15 | 16ae9bf3ed2d47c8b8fc088a6773c3316642c97ff573d5f2e185f89dadf39b14 16 | -------------------------------------------------------------------------------- /src/REVS.batch4: -------------------------------------------------------------------------------- 1 | sleep 999999 2 | # RPYGEUfYMHizer5siX2CNpQ6xHAbjtgQuB KMD 843.49707566, REVS 16.72927581 3 | sleep 1 4 | fiat/revs sendtoaddress RPYGEUfYMHizer5siX2CNpQ6xHAbjtgQuB 16.72927581 5 | # RTrZWBu7SUZWf4ZdyUVddRPxsnDhZnre7n KMD 3090.02793673, REVS 3.67077856 6 | sleep 1 7 | fiat/revs sendtoaddress RTrZWBu7SUZWf4ZdyUVddRPxsnDhZnre7n 3.67077856 8 | # RRixT2CqGcr5cdPoP3G2rhrWDfSbVZR6sk KMD 79613.96546024, REVS 1579.43521640 9 | sleep 1 10 | fiat/revs sendtoaddress RRixT2CqGcr5cdPoP3G2rhrWDfSbVZR6sk 1579.43521640 11 | # RQgfzPR4zeCyLWaddHysGEVzoKLZa5E4Ut KMD 20106.39865075, REVS 0.09000000 12 | sleep 1 13 | fiat/revs sendtoaddress RQgfzPR4zeCyLWaddHysGEVzoKLZa5E4Ut 0.09000000 14 | # RA9G36WwA9K95bn8Cbycq5ZnoxhSzzhhBw KMD 867960.91662544, REVS 11685.48356181 15 | sleep 1 16 | fiat/revs sendtoaddress RA9G36WwA9K95bn8Cbycq5ZnoxhSzzhhBw 11685.48356181 17 | # RVcSdFR5fC3Qjk3CARvQSkra5PQwC8U3uj KMD 19695.58704144, REVS 390.89494454 18 | sleep 1 19 | fiat/revs sendtoaddress RVcSdFR5fC3Qjk3CARvQSkra5PQwC8U3uj 390.89494454 20 | # RQokxkBAizLmegMeWK5TyTpSHn2vP5adjo KMD 2981.62619009, REVS 30.35300490 21 | sleep 1 22 | fiat/revs sendtoaddress RQokxkBAizLmegMeWK5TyTpSHn2vP5adjo 30.35300490 23 | # RAMvDwi58oyArqfGseWZsYbR2BN3L7ghVX KMD 40914.30625015, REVS 476.17156540 24 | sleep 1 25 | fiat/revs sendtoaddress RAMvDwi58oyArqfGseWZsYbR2BN3L7ghVX 476.17156540 26 | 27 | # total KMD 0.00000000 REVS 14182.82834742 28 | -------------------------------------------------------------------------------- /src/alertkeys.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_ALERTKEYS_H 2 | #define BITCOIN_ALERTKEYS_H 3 | 4 | // REMINDER: DO NOT COMMIT YOUR PRIVATE KEYS TO THE GIT REPOSITORY! 5 | 6 | const char* pszPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; 7 | const char* pszTestNetPrivKey = "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; 8 | 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /src/amount.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "amount.h" 7 | 8 | #include "tinyformat.h" 9 | 10 | CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize) 11 | { 12 | if (nSize > 0) 13 | nSatoshisPerK = nFeePaid*1000/nSize; 14 | else 15 | nSatoshisPerK = 0; 16 | } 17 | 18 | CAmount CFeeRate::GetFee(size_t nSize) const 19 | { 20 | CAmount nFee = nSatoshisPerK*nSize / 1000; 21 | 22 | if (nFee == 0 && nSatoshisPerK > 0) 23 | nFee = nSatoshisPerK; 24 | 25 | return nFee; 26 | } 27 | 28 | std::string CFeeRate::ToString() const 29 | { 30 | return strprintf("%d.%08d BTC/kB", nSatoshisPerK / COIN, nSatoshisPerK % COIN); 31 | } 32 | -------------------------------------------------------------------------------- /src/assetfunds: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -x 3 | ./komodo-cli paxdeposit $1 0.01 aud 4 | ./komodo-cli paxdeposit $1 0.01 bgn 5 | ./komodo-cli paxdeposit $1 0.01 cad 6 | ./komodo-cli paxdeposit $1 0.01 chf 7 | ./komodo-cli paxdeposit $1 0.01 cny 8 | ./komodo-cli paxdeposit $1 0.01 czk 9 | ./komodo-cli paxdeposit $1 0.01 dkk 10 | ./komodo-cli paxdeposit $1 0.01 eur 11 | ./komodo-cli paxdeposit $1 0.01 gbp 12 | ./komodo-cli paxdeposit $1 0.01 hkd 13 | ./komodo-cli paxdeposit $1 0.01 hrk 14 | ./komodo-cli paxdeposit $1 0.01 huf 15 | ./komodo-cli paxdeposit $1 0.01 idr 16 | ./komodo-cli paxdeposit $1 0.01 ils 17 | ./komodo-cli paxdeposit $1 0.01 inr 18 | ./komodo-cli paxdeposit $1 0.01 jpy 19 | ./komodo-cli paxdeposit $1 0.01 krw 20 | ./komodo-cli paxdeposit $1 0.01 mxn 21 | ./komodo-cli paxdeposit $1 0.01 myr 22 | ./komodo-cli paxdeposit $1 0.01 nok 23 | ./komodo-cli paxdeposit $1 0.01 nzd 24 | ./komodo-cli paxdeposit $1 0.01 php 25 | ./komodo-cli paxdeposit $1 0.01 pln 26 | ./komodo-cli paxdeposit $1 0.01 brl 27 | ./komodo-cli paxdeposit $1 0.01 ron 28 | ./komodo-cli paxdeposit $1 0.01 rub 29 | ./komodo-cli paxdeposit $1 0.01 sek 30 | ./komodo-cli paxdeposit $1 0.01 sgd 31 | ./komodo-cli paxdeposit $1 0.01 thb 32 | ./komodo-cli paxdeposit $1 0.01 try 33 | ./komodo-cli paxdeposit $1 0.01 usd 34 | ./komodo-cli paxdeposit $1 0.01 zar 35 | -------------------------------------------------------------------------------- /src/chainparamsseeds.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_CHAINPARAMSSEEDS_H 2 | #define BITCOIN_CHAINPARAMSSEEDS_H 3 | /** 4 | * List of fixed seed nodes for the bitcoin network 5 | * AUTOGENERATED by contrib/seeds/generate-seeds.py 6 | * 7 | * Each line contains a 16-byte IPv6 address and a port. 8 | * IPv4 as well as onion addresses are wrapped inside a IPv6 address accordingly. 9 | */ 10 | static SeedSpec6 pnSeed6_main[] = { 11 | }; 12 | 13 | static SeedSpec6 pnSeed6_test[] = { 14 | }; 15 | #endif // BITCOIN_CHAINPARAMSSEEDS_H 16 | -------------------------------------------------------------------------------- /src/checkpoints.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CHECKPOINTS_H 6 | #define BITCOIN_CHECKPOINTS_H 7 | 8 | #include "uint256.h" 9 | 10 | #include 11 | 12 | class CBlockIndex; 13 | 14 | /** 15 | * Block-chain checkpoints are compiled-in sanity checks. 16 | * They are updated every release or three. 17 | */ 18 | namespace Checkpoints 19 | { 20 | typedef std::map MapCheckpoints; 21 | 22 | struct CCheckpointData { 23 | MapCheckpoints mapCheckpoints; 24 | int64_t nTimeLastCheckpoint; 25 | int64_t nTransactionsLastCheckpoint; 26 | double fTransactionsPerDay; 27 | }; 28 | bool CheckBlock(const CCheckpointData& data, int nHeight, const uint256& hash); 29 | 30 | //! Return conservative estimate of total number of blocks, 0 if unknown 31 | int GetTotalBlocksEstimate(const CCheckpointData& data); 32 | 33 | //! Returns last CBlockIndex* in mapBlockIndex that is a checkpoint 34 | CBlockIndex* GetLastCheckpoint(const CCheckpointData& data); 35 | 36 | double GuessVerificationProgress(const CCheckpointData& data, CBlockIndex* pindex, bool fSigchecks = true); 37 | 38 | } //namespace Checkpoints 39 | 40 | #endif // BITCOIN_CHECKPOINTS_H 41 | -------------------------------------------------------------------------------- /src/clearassets: -------------------------------------------------------------------------------- 1 | rm -rf ~/.komodo/USD 2 | rm -rf ~/.komodo/EUR 3 | rm -rf ~/.komodo/JPY 4 | rm -rf ~/.komodo/GBP 5 | rm -rf ~/.komodo/AUD 6 | rm -rf ~/.komodo/CAD 7 | rm -rf ~/.komodo/CHF 8 | rm -rf ~/.komodo/NZD 9 | rm -rf ~/.komodo/CNY 10 | rm -rf ~/.komodo/RUB 11 | rm -rf ~/.komodo/MXN 12 | rm -rf ~/.komodo/BRL 13 | rm -rf ~/.komodo/INR 14 | rm -rf ~/.komodo/HKD 15 | rm -rf ~/.komodo/TRY 16 | rm -rf ~/.komodo/ZAR 17 | rm -rf ~/.komodo/PLN 18 | rm -rf ~/.komodo/NOK 19 | rm -rf ~/.komodo/SEK 20 | rm -rf ~/.komodo/DKK 21 | rm -rf ~/.komodo/CZK 22 | rm -rf ~/.komodo/HUF 23 | rm -rf ~/.komodo/ILS 24 | rm -rf ~/.komodo/KRW 25 | rm -rf ~/.komodo/MYR 26 | rm -rf ~/.komodo/PHP 27 | rm -rf ~/.komodo/RON 28 | rm -rf ~/.komodo/SGD 29 | rm -rf ~/.komodo/THB 30 | rm -rf ~/.komodo/BGN 31 | rm -rf ~/.komodo/IDR 32 | rm -rf ~/.komodo/HRK 33 | -------------------------------------------------------------------------------- /src/compat/glibc_compat.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include "config/bitcoin-config.h" 7 | #endif 8 | 9 | #include 10 | 11 | #if defined(HAVE_SYS_SELECT_H) 12 | #include 13 | #endif 14 | 15 | // Prior to GLIBC_2.14, memcpy was aliased to memmove. 16 | extern "C" void* memmove(void* a, const void* b, size_t c); 17 | extern "C" void* memcpy(void* a, const void* b, size_t c) 18 | { 19 | return memmove(a, b, c); 20 | } 21 | 22 | extern "C" void __chk_fail(void) __attribute__((__noreturn__)); 23 | extern "C" FDELT_TYPE __fdelt_warn(FDELT_TYPE a) 24 | { 25 | if (a >= FD_SETSIZE) 26 | __chk_fail(); 27 | return a / __NFDBITS; 28 | } 29 | extern "C" FDELT_TYPE __fdelt_chk(FDELT_TYPE) __attribute__((weak, alias("__fdelt_warn"))); 30 | -------------------------------------------------------------------------------- /src/compat/sanity.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_COMPAT_SANITY_H 6 | #define BITCOIN_COMPAT_SANITY_H 7 | 8 | bool glibc_sanity_test(); 9 | bool glibcxx_sanity_test(); 10 | 11 | #endif // BITCOIN_COMPAT_SANITY_H 12 | -------------------------------------------------------------------------------- /src/compat/strnlen.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include "config/bitcoin-config.h" 7 | #endif 8 | 9 | #include 10 | 11 | #if HAVE_DECL_STRNLEN == 0 12 | size_t strnlen( const char *start, size_t max_len) 13 | { 14 | const char *end = (const char *)memchr(start, '\0', max_len); 15 | 16 | return end ? (size_t)(end - start) : max_len; 17 | } 18 | #endif // HAVE_DECL_STRNLEN 19 | -------------------------------------------------------------------------------- /src/config/.empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/src/config/.empty -------------------------------------------------------------------------------- /src/core_io.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CORE_IO_H 6 | #define BITCOIN_CORE_IO_H 7 | 8 | #include 9 | #include 10 | 11 | class CBlock; 12 | class CScript; 13 | class CTransaction; 14 | class uint256; 15 | class UniValue; 16 | 17 | // core_read.cpp 18 | extern CScript ParseScript(const std::string& s); 19 | extern bool DecodeHexTx(CTransaction& tx, const std::string& strHexTx); 20 | extern bool DecodeHexBlk(CBlock&, const std::string& strHexBlk); 21 | extern uint256 ParseHashUV(const UniValue& v, const std::string& strName); 22 | extern uint256 ParseHashStr(const std::string&, const std::string& strName); 23 | extern std::vector ParseHexUV(const UniValue& v, const std::string& strName); 24 | 25 | // core_write.cpp 26 | extern std::string FormatScript(const CScript& script); 27 | extern std::string EncodeHexTx(const CTransaction& tx); 28 | extern void ScriptPubKeyToUniv(const CScript& scriptPubKey, 29 | UniValue& out, bool fIncludeHex); 30 | extern void TxToUniv(const CTransaction& tx, const uint256& hashBlock, UniValue& entry); 31 | 32 | #endif // BITCOIN_CORE_IO_H 33 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "crypto/hmac_sha256.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[64]; 12 | if (keylen <= 64) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 64 - keylen); 15 | } else { 16 | CSHA256().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 32, 0, 32); 18 | } 19 | 20 | for (int n = 0; n < 64; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 64); 23 | 24 | for (int n = 0; n < 64; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 64); 27 | } 28 | 29 | void CHMAC_SHA256::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[32]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 32).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_HMAC_SHA256_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA256_H 7 | 8 | #include "crypto/sha256.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA256 15 | { 16 | private: 17 | CSHA256 outer; 18 | CSHA256 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 32; 22 | 23 | CHMAC_SHA256(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA256& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA256_H 33 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "crypto/hmac_sha512.h" 6 | 7 | #include 8 | 9 | CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen) 10 | { 11 | unsigned char rkey[128]; 12 | if (keylen <= 128) { 13 | memcpy(rkey, key, keylen); 14 | memset(rkey + keylen, 0, 128 - keylen); 15 | } else { 16 | CSHA512().Write(key, keylen).Finalize(rkey); 17 | memset(rkey + 64, 0, 64); 18 | } 19 | 20 | for (int n = 0; n < 128; n++) 21 | rkey[n] ^= 0x5c; 22 | outer.Write(rkey, 128); 23 | 24 | for (int n = 0; n < 128; n++) 25 | rkey[n] ^= 0x5c ^ 0x36; 26 | inner.Write(rkey, 128); 27 | } 28 | 29 | void CHMAC_SHA512::Finalize(unsigned char hash[OUTPUT_SIZE]) 30 | { 31 | unsigned char temp[64]; 32 | inner.Finalize(temp); 33 | outer.Write(temp, 64).Finalize(hash); 34 | } 35 | -------------------------------------------------------------------------------- /src/crypto/hmac_sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_HMAC_SHA512_H 6 | #define BITCOIN_CRYPTO_HMAC_SHA512_H 7 | 8 | #include "crypto/sha512.h" 9 | 10 | #include 11 | #include 12 | 13 | /** A hasher class for HMAC-SHA-512. */ 14 | class CHMAC_SHA512 15 | { 16 | private: 17 | CSHA512 outer; 18 | CSHA512 inner; 19 | 20 | public: 21 | static const size_t OUTPUT_SIZE = 64; 22 | 23 | CHMAC_SHA512(const unsigned char* key, size_t keylen); 24 | CHMAC_SHA512& Write(const unsigned char* data, size_t len) 25 | { 26 | inner.Write(data, len); 27 | return *this; 28 | } 29 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_HMAC_SHA512_H 33 | -------------------------------------------------------------------------------- /src/crypto/ripemd160.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_RIPEMD160_H 6 | #define BITCOIN_CRYPTO_RIPEMD160_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for RIPEMD-160. */ 12 | class CRIPEMD160 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CRIPEMD160(); 23 | CRIPEMD160& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CRIPEMD160& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_RIPEMD160_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha1.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA1_H 6 | #define BITCOIN_CRYPTO_SHA1_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA1. */ 12 | class CSHA1 13 | { 14 | private: 15 | uint32_t s[5]; 16 | unsigned char buf[64]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 20; 21 | 22 | CSHA1(); 23 | CSHA1& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA1& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA1_H 29 | -------------------------------------------------------------------------------- /src/crypto/sha256.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA256_H 6 | #define BITCOIN_CRYPTO_SHA256_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-256. */ 12 | class CSHA256 13 | { 14 | public: 15 | static const size_t OUTPUT_SIZE = 32; 16 | 17 | CSHA256(); 18 | CSHA256& Write(const unsigned char* data, size_t len); 19 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 20 | void FinalizeNoPadding(unsigned char hash[OUTPUT_SIZE]) { 21 | FinalizeNoPadding(hash, true); 22 | }; 23 | CSHA256& Reset(); 24 | 25 | private: 26 | uint32_t s[8]; 27 | unsigned char buf[64]; 28 | size_t bytes; 29 | void FinalizeNoPadding(unsigned char hash[OUTPUT_SIZE], bool enforce_compression); 30 | }; 31 | 32 | #endif // BITCOIN_CRYPTO_SHA256_H 33 | -------------------------------------------------------------------------------- /src/crypto/sha512.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_CRYPTO_SHA512_H 6 | #define BITCOIN_CRYPTO_SHA512_H 7 | 8 | #include 9 | #include 10 | 11 | /** A hasher class for SHA-512. */ 12 | class CSHA512 13 | { 14 | private: 15 | uint64_t s[8]; 16 | unsigned char buf[128]; 17 | size_t bytes; 18 | 19 | public: 20 | static const size_t OUTPUT_SIZE = 64; 21 | 22 | CSHA512(); 23 | CSHA512& Write(const unsigned char* data, size_t len); 24 | void Finalize(unsigned char hash[OUTPUT_SIZE]); 25 | CSHA512& Reset(); 26 | }; 27 | 28 | #endif // BITCOIN_CRYPTO_SHA512_H 29 | -------------------------------------------------------------------------------- /src/eccryptoverify.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_ECCRYPTOVERIFY_H 7 | #define BITCOIN_ECCRYPTOVERIFY_H 8 | 9 | #include 10 | #include 11 | 12 | class uint256; 13 | 14 | namespace eccrypto { 15 | 16 | bool Check(const unsigned char *vch); 17 | bool CheckSignatureElement(const unsigned char *vch, int len, bool half); 18 | 19 | } // eccrypto namespace 20 | 21 | #endif // BITCOIN_ECCRYPTOVERIFY_H 22 | -------------------------------------------------------------------------------- /src/ecwrapper.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ECWRAPPER_H 6 | #define BITCOIN_ECWRAPPER_H 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | class uint256; 14 | 15 | /** RAII Wrapper around OpenSSL's EC_KEY */ 16 | class CECKey { 17 | private: 18 | EC_KEY *pkey; 19 | 20 | public: 21 | CECKey(); 22 | ~CECKey(); 23 | 24 | void GetPubKey(std::vector& pubkey, bool fCompressed); 25 | bool SetPubKey(const unsigned char* pubkey, size_t size); 26 | bool Verify(const uint256 &hash, const std::vector& vchSig); 27 | 28 | /** 29 | * reconstruct public key from a compact signature 30 | * This is only slightly more CPU intensive than just verifying it. 31 | * If this function succeeds, the recovered public key is guaranteed to be valid 32 | * (the signature is a valid signature of the given data for that key) 33 | */ 34 | bool Recover(const uint256 &hash, const unsigned char *p64, int rec); 35 | 36 | bool TweakPublic(const unsigned char vchTweak[32]); 37 | static bool SanityCheck(); 38 | }; 39 | 40 | #endif // BITCOIN_ECWRAPPER_H 41 | -------------------------------------------------------------------------------- /src/fiat/aud: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=AUD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/bet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=BET $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/bgn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=BGN $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/bots: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=BOTS $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/brl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=BRL $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/cad: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CAD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/ceal: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CEAL $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/chf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CHF $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/cny: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CNY $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/coqui: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=COQUI $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/crypto: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CRYPTO $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/czk: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=CZK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/dex: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=DEX $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/dkk: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=DKK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/eur: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=EUR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/gbp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=GBP $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/hkd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=HKD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/hodl: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=HODL $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/hrk: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=HRK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/huf: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=HUF $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/idr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=IDR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/ils: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=ILS $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/inr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=INR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/jpy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=JPY $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/jumblr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=JUMBLR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/krw: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=KRW $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/kv: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=KV $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mesh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MESH $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mgw: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MGW $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mnz: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MNZ $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mshark: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MSHARK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mvp: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MVP $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/mxn: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MXN $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/myr: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=MYR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/nok: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=NOK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/nzd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=NZD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/pangea: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=PANGEA $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/php: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=PHP $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/pln: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=PLN $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/revs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=REVS $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/ron: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=RON $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/rub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=RUB $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/sek: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=SEK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/sgd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=SGD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/shark: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=SHARK $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/supernet: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=SUPERNET $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/thb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=THB $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/try: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=TRY $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/usd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=USD $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/wlc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=WLC $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/fiat/zar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=ZAR $1 $2 $3 $4 $5 $6 3 | -------------------------------------------------------------------------------- /src/gtest/json_test_vectors.cpp: -------------------------------------------------------------------------------- 1 | #include "json_test_vectors.h" 2 | 3 | UniValue 4 | read_json(const std::string& jsondata) 5 | { 6 | UniValue v; 7 | 8 | if (!(v.read(jsondata) && v.isArray())) 9 | { 10 | ADD_FAILURE(); 11 | return UniValue(UniValue::VARR); 12 | } 13 | return v.get_array(); 14 | } 15 | -------------------------------------------------------------------------------- /src/gtest/main.cpp: -------------------------------------------------------------------------------- 1 | #include "gtest/gtest.h" 2 | #include "crypto/common.h" 3 | 4 | #include "libsnark/common/default_types/r1cs_ppzksnark_pp.hpp" 5 | #include "libsnark/zk_proof_systems/ppzksnark/r1cs_ppzksnark/r1cs_ppzksnark.hpp" 6 | 7 | int main(int argc, char **argv) { 8 | assert(init_and_check_sodium() != -1); 9 | libsnark::default_r1cs_ppzksnark_pp::init_public_params(); 10 | libsnark::inhibit_profiling_info = true; 11 | libsnark::inhibit_profiling_counters = true; 12 | 13 | testing::InitGoogleTest(&argc, argv); 14 | return RUN_ALL_TESTS(); 15 | } 16 | -------------------------------------------------------------------------------- /src/gtest/test_block.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "primitives/block.h" 4 | 5 | 6 | TEST(block_tests, header_size_is_expected) { 7 | // Dummy header with an empty Equihash solution. 8 | CBlockHeader header; 9 | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); 10 | ss << header; 11 | 12 | ASSERT_EQ(ss.size(), CBlockHeader::HEADER_SIZE); 13 | } 14 | -------------------------------------------------------------------------------- /src/gtest/test_random.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "random.h" 4 | 5 | extern int GenZero(int n); 6 | extern int GenMax(int n); 7 | 8 | TEST(Random, MappedShuffle) { 9 | std::vector a {8, 4, 6, 3, 5}; 10 | std::vector m {0, 1, 2, 3, 4}; 11 | 12 | auto a1 = a; 13 | auto m1 = m; 14 | MappedShuffle(a1.begin(), m1.begin(), a1.size(), GenZero); 15 | std::vector ea1 {4, 6, 3, 5, 8}; 16 | std::vector em1 {1, 2, 3, 4, 0}; 17 | EXPECT_EQ(ea1, a1); 18 | EXPECT_EQ(em1, m1); 19 | 20 | auto a2 = a; 21 | auto m2 = m; 22 | MappedShuffle(a2.begin(), m2.begin(), a2.size(), GenMax); 23 | std::vector ea2 {8, 4, 6, 3, 5}; 24 | std::vector em2 {0, 1, 2, 3, 4}; 25 | EXPECT_EQ(ea2, a2); 26 | EXPECT_EQ(em2, m2); 27 | 28 | auto a3 = a; 29 | auto m3 = m; 30 | MappedShuffle(a3.begin(), m3.begin(), a3.size(), GenIdentity); 31 | std::vector ea3 {8, 4, 6, 3, 5}; 32 | std::vector em3 {0, 1, 2, 3, 4}; 33 | EXPECT_EQ(ea3, a3); 34 | EXPECT_EQ(em3, m3); 35 | } 36 | -------------------------------------------------------------------------------- /src/gtest/test_tautology.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TEST(tautologies, seven_eq_seven) { 4 | ASSERT_EQ(7, 7); 5 | } 6 | 7 | TEST(tautologies, DISABLED_ObviousFailure) 8 | { 9 | FAIL() << "This is expected"; 10 | } 11 | -------------------------------------------------------------------------------- /src/gtest/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/JoinSplit.hpp" 2 | 3 | ZCJoinSplit* params = ZCJoinSplit::Unopened(); 4 | 5 | int GenZero(int n) 6 | { 7 | return 0; 8 | } 9 | 10 | int GenMax(int n) 11 | { 12 | return n-1; 13 | } 14 | -------------------------------------------------------------------------------- /src/httprpc.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_HTTPRPC_H 6 | #define BITCOIN_HTTPRPC_H 7 | 8 | #include 9 | #include 10 | 11 | class HTTPRequest; 12 | 13 | /** Start HTTP RPC subsystem. 14 | * Precondition; HTTP and RPC has been started. 15 | */ 16 | bool StartHTTPRPC(); 17 | /** Interrupt HTTP RPC subsystem. 18 | */ 19 | void InterruptHTTPRPC(); 20 | /** Stop HTTP RPC subsystem. 21 | * Precondition; HTTP and RPC has been stopped. 22 | */ 23 | void StopHTTPRPC(); 24 | 25 | /** Start HTTP REST subsystem. 26 | * Precondition; HTTP and RPC has been started. 27 | */ 28 | bool StartREST(); 29 | /** Interrupt RPC REST subsystem. 30 | */ 31 | void InterruptREST(); 32 | /** Stop HTTP REST subsystem. 33 | * Precondition; HTTP and RPC has been stopped. 34 | */ 35 | void StopREST(); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/init.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_INIT_H 7 | #define BITCOIN_INIT_H 8 | 9 | #include 10 | 11 | #include "zcash/JoinSplit.hpp" 12 | 13 | class CScheduler; 14 | class CWallet; 15 | 16 | namespace boost 17 | { 18 | class thread_group; 19 | } // namespace boost 20 | 21 | extern CWallet* pwalletMain; 22 | extern ZCJoinSplit* pzcashParams; 23 | 24 | void StartShutdown(); 25 | bool ShutdownRequested(); 26 | /** Interrupt threads */ 27 | void Interrupt(boost::thread_group& threadGroup); 28 | void Shutdown(); 29 | bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler); 30 | 31 | /** The help message mode determines what help message to show */ 32 | enum HelpMessageMode { 33 | HMM_BITCOIND 34 | }; 35 | 36 | /** Help for options shared between UI and daemon (for -help) */ 37 | std::string HelpMessage(HelpMessageMode mode); 38 | 39 | #endif // BITCOIN_INIT_H 40 | -------------------------------------------------------------------------------- /src/komodo_defs.h: -------------------------------------------------------------------------------- 1 | #ifndef KOMODO_DEFS_H 2 | #define KOMODO_DEFS_H 3 | 4 | #define ASSETCHAINS_MINHEIGHT 128 5 | #define KOMODO_ELECTION_GAP 2000 6 | #define ROUNDROBIN_DELAY 61 7 | #define KOMODO_ASSETCHAIN_MAXLEN 65 8 | 9 | #endif 10 | -------------------------------------------------------------------------------- /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/NEWS: -------------------------------------------------------------------------------- 1 | Release 1.2 2011-05-16 2 | ---------------------- 3 | 4 | Fixes for larger databases (tested up to one billion 100-byte entries, 5 | i.e., ~100GB). 6 | 7 | (1) Place hard limit on number of level-0 files. This fixes errors 8 | of the form "too many open files". 9 | 10 | (2) Fixed memtable management. Before the fix, a heavy write burst 11 | could cause unbounded memory usage. 12 | 13 | A fix for a logging bug where the reader would incorrectly complain 14 | about corruption. 15 | 16 | Allow public access to WriteBatch contents so that users can easily 17 | wrap a DB. 18 | -------------------------------------------------------------------------------- /src/leveldb/TODO: -------------------------------------------------------------------------------- 1 | ss 2 | - Stats 3 | 4 | db 5 | - Maybe implement DB::BulkDeleteForRange(start_key, end_key) 6 | that would blow away files whose ranges are entirely contained 7 | within [start_key..end_key]? For Chrome, deletion of obsolete 8 | object stores, etc. can be done in the background anyway, so 9 | probably not that important. 10 | - There have been requests for MultiGet. 11 | 12 | After a range is completely deleted, what gets rid of the 13 | corresponding files if we do no future changes to that range. Make 14 | the conditions for triggering compactions fire in more situations? 15 | -------------------------------------------------------------------------------- /src/leveldb/WINDOWS.md: -------------------------------------------------------------------------------- 1 | # Building LevelDB On Windows 2 | 3 | ## Prereqs 4 | 5 | Install the [Windows Software Development Kit version 7.1](http://www.microsoft.com/downloads/dlx/en-us/listdetailsview.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b). 6 | 7 | Download and extract the [Snappy source distribution](http://snappy.googlecode.com/files/snappy-1.0.5.tar.gz) 8 | 9 | 1. Open the "Windows SDK 7.1 Command Prompt" : 10 | Start Menu -> "Microsoft Windows SDK v7.1" > "Windows SDK 7.1 Command Prompt" 11 | 2. Change the directory to the leveldb project 12 | 13 | ## Building the Static lib 14 | 15 | * 32 bit Version 16 | 17 | setenv /x86 18 | msbuild.exe /p:Configuration=Release /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 19 | 20 | * 64 bit Version 21 | 22 | setenv /x64 23 | msbuild.exe /p:Configuration=Release /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 24 | 25 | 26 | ## Building and Running the Benchmark app 27 | 28 | * 32 bit Version 29 | 30 | setenv /x86 31 | msbuild.exe /p:Configuration=Benchmark /p:Platform=Win32 /p:Snappy=..\snappy-1.0.5 32 | Benchmark\leveldb.exe 33 | 34 | * 64 bit Version 35 | 36 | setenv /x64 37 | msbuild.exe /p:Configuration=Benchmark /p:Platform=x64 /p:Snappy=..\snappy-1.0.5 38 | x64\Benchmark\leveldb.exe 39 | 40 | -------------------------------------------------------------------------------- /src/leveldb/db/builder.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_BUILDER_H_ 6 | #define STORAGE_LEVELDB_DB_BUILDER_H_ 7 | 8 | #include "leveldb/status.h" 9 | 10 | namespace leveldb { 11 | 12 | struct Options; 13 | struct FileMetaData; 14 | 15 | class Env; 16 | class Iterator; 17 | class TableCache; 18 | class VersionEdit; 19 | 20 | // Build a Table file from the contents of *iter. The generated file 21 | // will be named according to meta->number. On success, the rest of 22 | // *meta will be filled with metadata about the generated table. 23 | // If no data is present in *iter, meta->file_size will be set to 24 | // zero, and no Table file will be produced. 25 | extern Status BuildTable(const std::string& dbname, 26 | Env* env, 27 | const Options& options, 28 | TableCache* table_cache, 29 | Iterator* iter, 30 | FileMetaData* meta); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_DB_BUILDER_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/db/db_iter.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_DB_DB_ITER_H_ 6 | #define STORAGE_LEVELDB_DB_DB_ITER_H_ 7 | 8 | #include 9 | #include "leveldb/db.h" 10 | #include "db/dbformat.h" 11 | 12 | namespace leveldb { 13 | 14 | class DBImpl; 15 | 16 | // Return a new iterator that converts internal keys (yielded by 17 | // "*internal_iter") that were live at the specified "sequence" number 18 | // into appropriate user keys. 19 | extern Iterator* NewDBIterator( 20 | DBImpl* db, 21 | const Comparator* user_key_comparator, 22 | Iterator* internal_iter, 23 | SequenceNumber sequence, 24 | uint32_t seed); 25 | 26 | } // namespace leveldb 27 | 28 | #endif // STORAGE_LEVELDB_DB_DB_ITER_H_ 29 | -------------------------------------------------------------------------------- /src/leveldb/db/log_format.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | // 5 | // Log format information shared by reader and writer. 6 | // See ../doc/log_format.txt for more detail. 7 | 8 | #ifndef STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 9 | #define STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 10 | 11 | namespace leveldb { 12 | namespace log { 13 | 14 | enum RecordType { 15 | // Zero is reserved for preallocated files 16 | kZeroType = 0, 17 | 18 | kFullType = 1, 19 | 20 | // For fragments 21 | kFirstType = 2, 22 | kMiddleType = 3, 23 | kLastType = 4 24 | }; 25 | static const int kMaxRecordType = kLastType; 26 | 27 | static const int kBlockSize = 32768; 28 | 29 | // Header is checksum (4 bytes), length (2 bytes), type (1 byte). 30 | static const int kHeaderSize = 4 + 2 + 1; 31 | 32 | } // namespace log 33 | } // namespace leveldb 34 | 35 | #endif // STORAGE_LEVELDB_DB_LOG_FORMAT_H_ 36 | -------------------------------------------------------------------------------- /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/include/leveldb/dumpfile.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014 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_INCLUDE_DUMPFILE_H_ 6 | #define STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 7 | 8 | #include 9 | #include "leveldb/env.h" 10 | #include "leveldb/status.h" 11 | 12 | namespace leveldb { 13 | 14 | // Dump the contents of the file named by fname in text format to 15 | // *dst. Makes a sequence of dst->Append() calls; each call is passed 16 | // the newline-terminated text corresponding to a single item found 17 | // in the file. 18 | // 19 | // Returns a non-OK result if fname does not name a leveldb storage 20 | // file, or if the file cannot be read. 21 | Status DumpFile(Env* env, const std::string& fname, WritableFile* dst); 22 | 23 | } // namespace leveldb 24 | 25 | #endif // STORAGE_LEVELDB_INCLUDE_DUMPFILE_H_ 26 | -------------------------------------------------------------------------------- /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/win/stdint.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | // MSVC didn't ship with this file until the 2010 version. 6 | 7 | #ifndef STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 8 | #define STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 9 | 10 | #if !defined(_MSC_VER) 11 | #error This file should only be included when compiling with MSVC. 12 | #endif 13 | 14 | // Define C99 equivalent types. 15 | typedef signed char int8_t; 16 | typedef signed short int16_t; 17 | typedef signed int int32_t; 18 | typedef signed long long int64_t; 19 | typedef unsigned char uint8_t; 20 | typedef unsigned short uint16_t; 21 | typedef unsigned int uint32_t; 22 | typedef unsigned long long uint64_t; 23 | 24 | #endif // STORAGE_LEVELDB_PORT_WIN_STDINT_H_ 25 | -------------------------------------------------------------------------------- /src/leveldb/table/block.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_BLOCK_H_ 6 | #define STORAGE_LEVELDB_TABLE_BLOCK_H_ 7 | 8 | #include 9 | #include 10 | #include "leveldb/iterator.h" 11 | 12 | namespace leveldb { 13 | 14 | struct BlockContents; 15 | class Comparator; 16 | 17 | class Block { 18 | public: 19 | // Initialize the block with the specified contents. 20 | explicit Block(const BlockContents& contents); 21 | 22 | ~Block(); 23 | 24 | size_t size() const { return size_; } 25 | Iterator* NewIterator(const Comparator* comparator); 26 | 27 | private: 28 | uint32_t NumRestarts() const; 29 | 30 | const char* data_; 31 | size_t size_; 32 | uint32_t restart_offset_; // Offset in data_ of restart array 33 | bool owned_; // Block owns data_[] 34 | 35 | // No copying allowed 36 | Block(const Block&); 37 | void operator=(const Block&); 38 | 39 | class Iter; 40 | }; 41 | 42 | } // namespace leveldb 43 | 44 | #endif // STORAGE_LEVELDB_TABLE_BLOCK_H_ 45 | -------------------------------------------------------------------------------- /src/leveldb/table/merger.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_MERGER_H_ 6 | #define STORAGE_LEVELDB_TABLE_MERGER_H_ 7 | 8 | namespace leveldb { 9 | 10 | class Comparator; 11 | class Iterator; 12 | 13 | // Return an iterator that provided the union of the data in 14 | // children[0,n-1]. Takes ownership of the child iterators and 15 | // will delete them when the result iterator is deleted. 16 | // 17 | // The result does no duplicate suppression. I.e., if a particular 18 | // key is present in K child iterators, it will be yielded K times. 19 | // 20 | // REQUIRES: n >= 0 21 | extern Iterator* NewMergingIterator( 22 | const Comparator* comparator, Iterator** children, int n); 23 | 24 | } // namespace leveldb 25 | 26 | #endif // STORAGE_LEVELDB_TABLE_MERGER_H_ 27 | -------------------------------------------------------------------------------- /src/leveldb/table/two_level_iterator.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 The LevelDB Authors. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. See the AUTHORS file for names of contributors. 4 | 5 | #ifndef STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 6 | #define STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 7 | 8 | #include "leveldb/iterator.h" 9 | 10 | namespace leveldb { 11 | 12 | struct ReadOptions; 13 | 14 | // Return a new two level iterator. A two-level iterator contains an 15 | // index iterator whose values point to a sequence of blocks where 16 | // each block is itself a sequence of key,value pairs. The returned 17 | // two-level iterator yields the concatenation of all key/value pairs 18 | // in the sequence of blocks. Takes ownership of "index_iter" and 19 | // will delete it when no longer needed. 20 | // 21 | // Uses a supplied function to convert an index_iter value into 22 | // an iterator over the contents of the corresponding block. 23 | extern Iterator* NewTwoLevelIterator( 24 | Iterator* index_iter, 25 | Iterator* (*block_function)( 26 | void* arg, 27 | const ReadOptions& options, 28 | const Slice& index_value), 29 | void* arg, 30 | const ReadOptions& options); 31 | 32 | } // namespace leveldb 33 | 34 | #endif // STORAGE_LEVELDB_TABLE_TWO_LEVEL_ITERATOR_H_ 35 | -------------------------------------------------------------------------------- /src/leveldb/util/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.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/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/noui.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_NOUI_H 6 | #define BITCOIN_NOUI_H 7 | 8 | extern void noui_connect(); 9 | 10 | #endif // BITCOIN_NOUI_H 11 | -------------------------------------------------------------------------------- /src/obj-test/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/obj/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /src/purge: -------------------------------------------------------------------------------- 1 | rm -rf ~/.komodo/$1/chainstate 2 | rm -rf ~/.komodo/$1/database 3 | rm -rf ~/.komodo/$1/blocks 4 | rm -rf ~/.komodo/$1/komodostate 5 | 6 | -------------------------------------------------------------------------------- /src/qt/Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: FORCE 2 | all: FORCE 3 | $(MAKE) -C .. komodo_qt test_komodo_qt 4 | clean: FORCE 5 | $(MAKE) -C .. komodo_qt_clean test_komodo_qt_clean 6 | check: FORCE 7 | $(MAKE) -C .. test_komodo_qt_check 8 | komodo-qt komodo-qt.exe: FORCE 9 | $(MAKE) -C .. komodo_qt 10 | -------------------------------------------------------------------------------- /src/qt/test/test_main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #if defined(HAVE_CONFIG_H) 6 | #include "config/bitcoin-config.h" 7 | #endif 8 | 9 | #include "util.h" 10 | #include "uritests.h" 11 | 12 | #ifdef ENABLE_WALLET 13 | #include "paymentservertests.h" 14 | #endif 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #if defined(QT_STATICPLUGIN) && QT_VERSION < 0x050000 21 | #include 22 | Q_IMPORT_PLUGIN(qcncodecs) 23 | Q_IMPORT_PLUGIN(qjpcodecs) 24 | Q_IMPORT_PLUGIN(qtwcodecs) 25 | Q_IMPORT_PLUGIN(qkrcodecs) 26 | #endif 27 | 28 | // This is all you need to run all the tests 29 | int main(int argc, char *argv[]) 30 | { 31 | SetupEnvironment(); 32 | bool fInvalid = false; 33 | 34 | // Don't remove this, it's needed to access 35 | // QCoreApplication:: in the tests 36 | QCoreApplication app(argc, argv); 37 | app.setApplicationName("Komodo-Qt-test"); 38 | 39 | URITests test1; 40 | if (QTest::qExec(&test1) != 0) 41 | fInvalid = true; 42 | #ifdef ENABLE_WALLET 43 | PaymentServerTests test2; 44 | if (QTest::qExec(&test2) != 0) 45 | fInvalid = true; 46 | #endif 47 | 48 | return fInvalid; 49 | } 50 | -------------------------------------------------------------------------------- /src/reverselock.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_REVERSELOCK_H 6 | #define BITCOIN_REVERSELOCK_H 7 | 8 | /** 9 | * An RAII-style reverse lock. Unlocks on construction and locks on destruction. 10 | */ 11 | template 12 | class reverse_lock 13 | { 14 | public: 15 | 16 | explicit reverse_lock(Lock& lock) : lock(lock) { 17 | lock.unlock(); 18 | } 19 | 20 | ~reverse_lock() noexcept(false) { 21 | lock.lock(); 22 | } 23 | 24 | private: 25 | reverse_lock(reverse_lock const&); 26 | reverse_lock& operator=(reverse_lock const&); 27 | 28 | Lock& lock; 29 | }; 30 | 31 | #endif // BITCOIN_REVERSELOCK_H 32 | -------------------------------------------------------------------------------- /src/revs: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ./komodo-cli -ac_name=REVS $1 $2 $3 $4 3 | -------------------------------------------------------------------------------- /src/rpcclient.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_RPCCLIENT_H 7 | #define BITCOIN_RPCCLIENT_H 8 | 9 | #include 10 | 11 | UniValue RPCConvertValues(const std::string& strMethod, const std::vector& strParams); 12 | /** Non-RFC4627 JSON parser, accepts internal values (such as numbers, true, false, null) 13 | * as well as objects and arrays. 14 | */ 15 | UniValue ParseNonRFCJSONValue(const std::string& strVal); 16 | 17 | #endif // BITCOIN_RPCCLIENT_H 18 | -------------------------------------------------------------------------------- /src/script/sigcache.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SCRIPT_SIGCACHE_H 7 | #define BITCOIN_SCRIPT_SIGCACHE_H 8 | 9 | #include "script/interpreter.h" 10 | 11 | #include 12 | 13 | class CPubKey; 14 | 15 | class CachingTransactionSignatureChecker : public TransactionSignatureChecker 16 | { 17 | private: 18 | bool store; 19 | 20 | public: 21 | CachingTransactionSignatureChecker(const CTransaction* txToIn, unsigned int nInIn, bool storeIn=true) : TransactionSignatureChecker(txToIn, nInIn), store(storeIn) {} 22 | 23 | bool VerifySignature(const std::vector& vchSig, const CPubKey& vchPubKey, const uint256& sighash) const; 24 | }; 25 | 26 | #endif // BITCOIN_SCRIPT_SIGCACHE_H 27 | -------------------------------------------------------------------------------- /src/secp256k1/.gitignore: -------------------------------------------------------------------------------- 1 | bench_inv 2 | bench_sign 3 | bench_verify 4 | bench_recover 5 | bench_internal 6 | tests 7 | *.exe 8 | *.so 9 | *.a 10 | !.gitignore 11 | 12 | Makefile 13 | configure 14 | .libs/ 15 | Makefile.in 16 | aclocal.m4 17 | autom4te.cache/ 18 | config.log 19 | config.status 20 | *.tar.gz 21 | *.la 22 | libtool 23 | .deps/ 24 | .dirstamp 25 | build-aux/ 26 | *.lo 27 | *.o 28 | *~ 29 | src/libsecp256k1-config.h 30 | src/libsecp256k1-config.h.in 31 | m4/libtool.m4 32 | m4/ltoptions.m4 33 | m4/ltsugar.m4 34 | m4/ltversion.m4 35 | m4/lt~obsolete.m4 36 | src/stamp-h1 37 | libsecp256k1.pc 38 | -------------------------------------------------------------------------------- /src/secp256k1/COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Pieter Wuille 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /src/secp256k1/TODO: -------------------------------------------------------------------------------- 1 | * Unit tests for fieldelem/groupelem, including ones intended to 2 | trigger fieldelem's boundary cases. 3 | * Complete constant-time operations for signing/keygen 4 | -------------------------------------------------------------------------------- /src/secp256k1/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | autoreconf -if --warnings=all 4 | -------------------------------------------------------------------------------- /src/secp256k1/libsecp256k1.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libsecp256k1 7 | Description: Optimized C library for EC operations on curve secp256k1 8 | URL: https://github.com/bitcoin/secp256k1 9 | Version: @PACKAGE_VERSION@ 10 | Cflags: -I${includedir} 11 | Libs.private: @SECP_LIBS@ 12 | Libs: -L${libdir} -lsecp256k1 13 | 14 | -------------------------------------------------------------------------------- /src/secp256k1/obj/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/src/secp256k1/obj/.gitignore -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.c: -------------------------------------------------------------------------------- 1 | #include "org_bitcoin_NativeSecp256k1.h" 2 | #include "include/secp256k1.h" 3 | 4 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 5 | (JNIEnv* env, jclass classObject, jobject byteBufferObject) 6 | { 7 | unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); 8 | int sigLen = *((int*)(data + 32)); 9 | int pubLen = *((int*)(data + 32 + 4)); 10 | 11 | return secp256k1_ecdsa_verify(data, 32, data+32+8, sigLen, data+32+8+sigLen, pubLen); 12 | } 13 | 14 | static void __javasecp256k1_attach(void) __attribute__((constructor)); 15 | static void __javasecp256k1_detach(void) __attribute__((destructor)); 16 | 17 | static void __javasecp256k1_attach(void) { 18 | secp256k1_start(SECP256K1_START_VERIFY); 19 | } 20 | 21 | static void __javasecp256k1_detach(void) { 22 | secp256k1_stop(); 23 | } 24 | -------------------------------------------------------------------------------- /src/secp256k1/src/java/org_bitcoin_NativeSecp256k1.h: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | /* Header for class org_bitcoin_NativeSecp256k1 */ 4 | 5 | #ifndef _Included_org_bitcoin_NativeSecp256k1 6 | #define _Included_org_bitcoin_NativeSecp256k1 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | /* 11 | * Class: org_bitcoin_NativeSecp256k1 12 | * Method: secp256k1_ecdsa_verify 13 | * Signature: (Ljava/nio/ByteBuffer;)I 14 | */ 15 | JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify 16 | (JNIEnv *, jclass, jobject); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | #endif 22 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_gmp.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_REPR_ 8 | #define _SECP256K1_NUM_REPR_ 9 | 10 | #include 11 | 12 | #define NUM_LIMBS ((256+GMP_NUMB_BITS-1)/GMP_NUMB_BITS) 13 | 14 | typedef struct { 15 | mp_limb_t data[2*NUM_LIMBS]; 16 | int neg; 17 | int limbs; 18 | } secp256k1_num_t; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /src/secp256k1/src/num_impl.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_NUM_IMPL_H_ 8 | #define _SECP256K1_NUM_IMPL_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | #include "num.h" 15 | 16 | #if defined(USE_NUM_GMP) 17 | #include "num_gmp_impl.h" 18 | #elif defined(USE_NUM_NONE) 19 | /* Nothing. */ 20 | #else 21 | #error "Please select num implementation" 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_4x64.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint64_t d[4]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{((uint64_t)(d1)) << 32 | (d0), ((uint64_t)(d3)) << 32 | (d2), ((uint64_t)(d5)) << 32 | (d4), ((uint64_t)(d7)) << 32 | (d6)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/scalar_8x32.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_SCALAR_REPR_ 8 | #define _SECP256K1_SCALAR_REPR_ 9 | 10 | #include 11 | 12 | /** A scalar modulo the group order of the secp256k1 curve. */ 13 | typedef struct { 14 | uint32_t d[8]; 15 | } secp256k1_scalar_t; 16 | 17 | #define SECP256K1_SCALAR_CONST(d7, d6, d5, d4, d3, d2, d1, d0) {{(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)}} 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/secp256k1/src/testrand.h: -------------------------------------------------------------------------------- 1 | /********************************************************************** 2 | * Copyright (c) 2013, 2014 Pieter Wuille * 3 | * Distributed under the MIT software license, see the accompanying * 4 | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* 5 | **********************************************************************/ 6 | 7 | #ifndef _SECP256K1_TESTRAND_H_ 8 | #define _SECP256K1_TESTRAND_H_ 9 | 10 | #if defined HAVE_CONFIG_H 11 | #include "libsecp256k1-config.h" 12 | #endif 13 | 14 | /* A non-cryptographic RNG used only for test infrastructure. */ 15 | 16 | /** Seed the pseudorandom number generator for testing. */ 17 | SECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16); 18 | 19 | /** Generate a pseudorandom 32-bit number. */ 20 | static uint32_t secp256k1_rand32(void); 21 | 22 | /** Generate a pseudorandom 32-byte array. */ 23 | static void secp256k1_rand256(unsigned char *b32); 24 | 25 | /** Generate a pseudorandom 32-byte array with long sequences of zero and one bits. */ 26 | static void secp256k1_rand256_test(unsigned char *b32); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /src/support/cleanse.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #include "cleanse.h" 7 | 8 | #include 9 | 10 | void memory_cleanse(void *ptr, size_t len) 11 | { 12 | OPENSSL_cleanse(ptr, len); 13 | } 14 | -------------------------------------------------------------------------------- /src/support/cleanse.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SUPPORT_CLEANSE_H 7 | #define BITCOIN_SUPPORT_CLEANSE_H 8 | 9 | #include 10 | 11 | void memory_cleanse(void *ptr, size_t len); 12 | 13 | #endif // BITCOIN_SUPPORT_CLEANSE_H 14 | -------------------------------------------------------------------------------- /src/test/Checkpoints_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | // 6 | // Unit tests for block-chain checkpoints 7 | // 8 | 9 | #include "checkpoints.h" 10 | 11 | #include "uint256.h" 12 | #include "test/test_bitcoin.h" 13 | #include "chainparams.h" 14 | 15 | #include 16 | 17 | using namespace std; 18 | 19 | BOOST_FIXTURE_TEST_SUITE(Checkpoints_tests, BasicTestingSetup) 20 | 21 | // TODO: checkpoints have been removed for now. 22 | /* 23 | BOOST_AUTO_TEST_CASE(sanity) 24 | { 25 | const Checkpoints::CCheckpointData& checkpoints = Params(CBaseChainParams::MAIN).Checkpoints(); 26 | BOOST_CHECK(Checkpoints::GetTotalBlocksEstimate(checkpoints) >= 134444); 27 | } 28 | */ 29 | BOOST_AUTO_TEST_SUITE_END() 30 | -------------------------------------------------------------------------------- /src/test/Makefile: -------------------------------------------------------------------------------- 1 | all: 2 | $(MAKE) -C .. bitcoin_test 3 | clean: 4 | $(MAKE) -C .. bitcoin_test_clean 5 | check: 6 | $(MAKE) -C .. bitcoin_test_check 7 | -------------------------------------------------------------------------------- /src/test/README.md: -------------------------------------------------------------------------------- 1 | # Notes 2 | The sources in this directory are unit test cases. Boost includes a 3 | unit testing framework, and since bitcoin already uses boost, it makes 4 | sense to simply use this framework rather than require developers to 5 | configure some other framework (we want as few impediments to creating 6 | unit tests as possible). 7 | 8 | The build system is setup to compile an executable called "test_bitcoin" 9 | that runs all of the unit tests. The main source file is called 10 | test_bitcoin.cpp, which simply includes other files that contain the 11 | actual unit tests (outside of a couple required preprocessor 12 | directives). The pattern is to create one test file for each class or 13 | source file for which you want to create unit tests. The file naming 14 | convention is "_tests.cpp" and such files should wrap 15 | their tests in a test suite called "_tests". For an 16 | examples of this pattern, examine uint160_tests.cpp and 17 | uint256_tests.cpp. 18 | 19 | Add the source files to /src/Makefile.test.include to add them to the build. 20 | 21 | For further reading, I found the following website to be helpful in 22 | explaining how the boost unit test framework works: 23 | [http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/](http://www.alittlemadness.com/2009/03/31/c-unit-testing-with-boosttest/). -------------------------------------------------------------------------------- /src/test/base32_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012-2013 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "utilstrencodings.h" 6 | #include "test/test_bitcoin.h" 7 | 8 | #include 9 | 10 | BOOST_FIXTURE_TEST_SUITE(base32_tests, BasicTestingSetup) 11 | 12 | BOOST_AUTO_TEST_CASE(base32_testvectors) 13 | { 14 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 15 | static const std::string vstrOut[] = {"","my======","mzxq====","mzxw6===","mzxw6yq=","mzxw6ytb","mzxw6ytboi======"}; 16 | for (unsigned int i=0; i 9 | 10 | BOOST_FIXTURE_TEST_SUITE(base64_tests, BasicTestingSetup) 11 | 12 | BOOST_AUTO_TEST_CASE(base64_testvectors) 13 | { 14 | static const std::string vstrIn[] = {"","f","fo","foo","foob","fooba","foobar"}; 15 | static const std::string vstrOut[] = {"","Zg==","Zm8=","Zm9v","Zm9vYg==","Zm9vYmE=","Zm9vYmFy"}; 16 | for (unsigned int i=0; i 10 | 11 | BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup) 12 | 13 | BOOST_AUTO_TEST_CASE(basic_sanity) 14 | { 15 | BOOST_CHECK_MESSAGE(glibc_sanity_test() == true, "libc sanity test"); 16 | BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test"); 17 | BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "openssl ECC test"); 18 | } 19 | 20 | BOOST_AUTO_TEST_SUITE_END() 21 | -------------------------------------------------------------------------------- /src/test/test_bitcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef BITCOIN_TEST_TEST_BITCOIN_H 2 | #define BITCOIN_TEST_TEST_BITCOIN_H 3 | 4 | #include "txdb.h" 5 | 6 | #include 7 | #include 8 | 9 | /** Basic testing setup. 10 | * This just configures logging and chain parameters. 11 | */ 12 | struct BasicTestingSetup { 13 | BasicTestingSetup(); 14 | ~BasicTestingSetup(); 15 | }; 16 | 17 | /** Testing setup that configures a complete environment. 18 | * Included are data directory, coins database, script check threads 19 | * and wallet (if enabled) setup. 20 | */ 21 | struct TestingSetup: public BasicTestingSetup { 22 | CCoinsViewDB *pcoinsdbview; 23 | boost::filesystem::path pathTemp; 24 | boost::thread_group threadGroup; 25 | 26 | TestingSetup(); 27 | ~TestingSetup(); 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /src/test/timedata_tests.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011-2014 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | // 5 | #include "timedata.h" 6 | #include "test/test_bitcoin.h" 7 | 8 | #include 9 | 10 | using namespace std; 11 | 12 | BOOST_FIXTURE_TEST_SUITE(timedata_tests, BasicTestingSetup) 13 | 14 | BOOST_AUTO_TEST_CASE(util_MedianFilter) 15 | { 16 | CMedianFilter filter(5, 15); 17 | 18 | BOOST_CHECK_EQUAL(filter.median(), 15); 19 | 20 | filter.input(20); // [15 20] 21 | BOOST_CHECK_EQUAL(filter.median(), 17); 22 | 23 | filter.input(30); // [15 20 30] 24 | BOOST_CHECK_EQUAL(filter.median(), 20); 25 | 26 | filter.input(3); // [3 15 20 30] 27 | BOOST_CHECK_EQUAL(filter.median(), 17); 28 | 29 | filter.input(7); // [3 7 15 20 30] 30 | BOOST_CHECK_EQUAL(filter.median(), 15); 31 | 32 | filter.input(18); // [3 7 18 20 30] 33 | BOOST_CHECK_EQUAL(filter.median(), 18); 34 | 35 | filter.input(0); // [0 3 7 18 30] 36 | BOOST_CHECK_EQUAL(filter.median(), 7); 37 | } 38 | 39 | BOOST_AUTO_TEST_SUITE_END() 40 | -------------------------------------------------------------------------------- /src/torcontrol.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | /** 6 | * Functionality for communicating with Tor. 7 | */ 8 | #ifndef BITCOIN_TORCONTROL_H 9 | #define BITCOIN_TORCONTROL_H 10 | 11 | #include "scheduler.h" 12 | 13 | extern const std::string DEFAULT_TOR_CONTROL; 14 | static const bool DEFAULT_LISTEN_ONION = true; 15 | 16 | void StartTorControl(boost::thread_group& threadGroup, CScheduler& scheduler); 17 | void InterruptTorControl(); 18 | void StopTorControl(); 19 | 20 | #endif /* BITCOIN_TORCONTROL_H */ 21 | -------------------------------------------------------------------------------- /src/uint252.h: -------------------------------------------------------------------------------- 1 | #ifndef UINT252_H 2 | #define UINT252_H 3 | 4 | #include 5 | #include "uint256.h" 6 | #include "serialize.h" 7 | 8 | // Wrapper of uint256 with guarantee that first 9 | // four bits are zero. 10 | class uint252 { 11 | private: 12 | uint256 contents; 13 | 14 | public: 15 | ADD_SERIALIZE_METHODS; 16 | 17 | template 18 | inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) { 19 | READWRITE(contents); 20 | 21 | if ((*contents.begin()) & 0xF0) { 22 | throw std::ios_base::failure("spending key has invalid leading bits"); 23 | } 24 | } 25 | 26 | const unsigned char* begin() const 27 | { 28 | return contents.begin(); 29 | } 30 | 31 | const unsigned char* end() const 32 | { 33 | return contents.end(); 34 | } 35 | 36 | uint252() : contents() {}; 37 | explicit uint252(const uint256& in) : contents(in) { 38 | if (*contents.begin() & 0xF0) { 39 | throw std::domain_error("leading bits are set in argument given to uint252 constructor"); 40 | } 41 | } 42 | 43 | uint256 inner() const { 44 | return contents; 45 | } 46 | 47 | friend inline bool operator==(const uint252& a, const uint252& b) { return a.contents == b.contents; } 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /src/univalue/.gitignore: -------------------------------------------------------------------------------- 1 | .deps/ 2 | INSTALL 3 | Makefile 4 | Makefile.in 5 | aclocal.m4 6 | autom4te.cache/ 7 | compile 8 | config.log 9 | config.status 10 | config.guess 11 | config.sub 12 | configure 13 | depcomp 14 | install-sh 15 | missing 16 | stamp-h1 17 | univalue-config.h* 18 | test-driver 19 | libtool 20 | ltmain.sh 21 | test-suite.log 22 | 23 | *.a 24 | *.la 25 | *.lo 26 | *.logs 27 | *.o 28 | *.pc 29 | *.trs 30 | 31 | .dirstamp 32 | .libs 33 | -------------------------------------------------------------------------------- /src/univalue/COPYING: -------------------------------------------------------------------------------- 1 | 2 | Permission is hereby granted, free of charge, to any person obtaining a copy 3 | of this software and associated documentation files (the "Software"), to deal 4 | in the Software without restriction, including without limitation the rights 5 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 6 | copies of the Software, and to permit persons to whom the Software is 7 | furnished to do so, subject to the following conditions: 8 | 9 | The above copyright notice and this permission notice shall be included in 10 | all copies or substantial portions of the Software. 11 | 12 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 13 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 14 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 15 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 16 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 17 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 18 | THE SOFTWARE. 19 | 20 | -------------------------------------------------------------------------------- /src/univalue/README: -------------------------------------------------------------------------------- 1 | 2 | UniValue 3 | 4 | A universal value object, with JSON encoding (output) and decoding (input). 5 | 6 | Built as a single dynamic RAII C++ object class, and no templates. 7 | 8 | -------------------------------------------------------------------------------- /src/univalue/TODO: -------------------------------------------------------------------------------- 1 | 2 | Rearrange tree for easier 'git subtree' style use 3 | 4 | Move towards C++11 etc. 5 | 6 | Namespace support - must come up with useful shorthand, avoiding 7 | long Univalue::Univalue::Univalue usages forced upon library users. 8 | 9 | Improve test suite 10 | 11 | -------------------------------------------------------------------------------- /src/univalue/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | srcdir="$(dirname $0)" 4 | cd "$srcdir" 5 | if [ -z ${LIBTOOLIZE} ] && GLIBTOOLIZE="`which glibtoolize 2>/dev/null`"; then 6 | LIBTOOLIZE="${GLIBTOOLIZE}" 7 | export LIBTOOLIZE 8 | fi 9 | autoreconf --install --force 10 | -------------------------------------------------------------------------------- /src/univalue/build-aux/m4/.gitignore: -------------------------------------------------------------------------------- 1 | /*.m4 2 | -------------------------------------------------------------------------------- /src/univalue/lib/.gitignore: -------------------------------------------------------------------------------- 1 | gen 2 | .libs 3 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue-uninstalled.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: ${pc_top_builddir}/${pcfiledir}/libunivalue.la 10 | -------------------------------------------------------------------------------- /src/univalue/pc/libunivalue.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libunivalue 7 | Description: libunivalue, C++ universal value object and JSON library 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -lunivalue 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /src/univalue/test/.gitignore: -------------------------------------------------------------------------------- 1 | unitester 2 | test_json 3 | no_nul 4 | 5 | *.trs 6 | *.log 7 | -------------------------------------------------------------------------------- /src/univalue/test/fail1.json: -------------------------------------------------------------------------------- 1 | "This is a string that never ends, yes it goes on and on, my friends. 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail10.json: -------------------------------------------------------------------------------- 1 | {"Extra value after close": true} "misplaced quoted value" -------------------------------------------------------------------------------- /src/univalue/test/fail11.json: -------------------------------------------------------------------------------- 1 | {"Illegal expression": 1 + 2} -------------------------------------------------------------------------------- /src/univalue/test/fail12.json: -------------------------------------------------------------------------------- 1 | {"Illegal invocation": alert()} -------------------------------------------------------------------------------- /src/univalue/test/fail13.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot have leading zeroes": 013} -------------------------------------------------------------------------------- /src/univalue/test/fail14.json: -------------------------------------------------------------------------------- 1 | {"Numbers cannot be hex": 0x14} -------------------------------------------------------------------------------- /src/univalue/test/fail15.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \x15"] -------------------------------------------------------------------------------- /src/univalue/test/fail16.json: -------------------------------------------------------------------------------- 1 | [\naked] -------------------------------------------------------------------------------- /src/univalue/test/fail17.json: -------------------------------------------------------------------------------- 1 | ["Illegal backslash escape: \017"] -------------------------------------------------------------------------------- /src/univalue/test/fail18.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/fail19.json: -------------------------------------------------------------------------------- 1 | {"Missing colon" null} -------------------------------------------------------------------------------- /src/univalue/test/fail2.json: -------------------------------------------------------------------------------- 1 | ["Unclosed array" -------------------------------------------------------------------------------- /src/univalue/test/fail20.json: -------------------------------------------------------------------------------- 1 | {"Double colon":: null} -------------------------------------------------------------------------------- /src/univalue/test/fail21.json: -------------------------------------------------------------------------------- 1 | {"Comma instead of colon", null} -------------------------------------------------------------------------------- /src/univalue/test/fail22.json: -------------------------------------------------------------------------------- 1 | ["Colon instead of comma": false] -------------------------------------------------------------------------------- /src/univalue/test/fail23.json: -------------------------------------------------------------------------------- 1 | ["Bad value", truth] -------------------------------------------------------------------------------- /src/univalue/test/fail24.json: -------------------------------------------------------------------------------- 1 | ['single quote'] -------------------------------------------------------------------------------- /src/univalue/test/fail25.json: -------------------------------------------------------------------------------- 1 | [" tab character in string "] -------------------------------------------------------------------------------- /src/univalue/test/fail26.json: -------------------------------------------------------------------------------- 1 | ["tab\ character\ in\ string\ "] -------------------------------------------------------------------------------- /src/univalue/test/fail27.json: -------------------------------------------------------------------------------- 1 | ["line 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail28.json: -------------------------------------------------------------------------------- 1 | ["line\ 2 | break"] -------------------------------------------------------------------------------- /src/univalue/test/fail29.json: -------------------------------------------------------------------------------- 1 | [0e] -------------------------------------------------------------------------------- /src/univalue/test/fail3.json: -------------------------------------------------------------------------------- 1 | {unquoted_key: "keys must be quoted"} -------------------------------------------------------------------------------- /src/univalue/test/fail30.json: -------------------------------------------------------------------------------- 1 | [0e+] -------------------------------------------------------------------------------- /src/univalue/test/fail31.json: -------------------------------------------------------------------------------- 1 | [0e+-1] -------------------------------------------------------------------------------- /src/univalue/test/fail32.json: -------------------------------------------------------------------------------- 1 | {"Comma instead if closing brace": true, -------------------------------------------------------------------------------- /src/univalue/test/fail33.json: -------------------------------------------------------------------------------- 1 | ["mismatch"} -------------------------------------------------------------------------------- /src/univalue/test/fail34.json: -------------------------------------------------------------------------------- 1 | {} garbage -------------------------------------------------------------------------------- /src/univalue/test/fail35.json: -------------------------------------------------------------------------------- 1 | [ true true true [] [] [] ] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail36.json: -------------------------------------------------------------------------------- 1 | {"a":} 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail37.json: -------------------------------------------------------------------------------- 1 | {"a":1 "b":2} 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail38.json: -------------------------------------------------------------------------------- 1 | ["\ud834"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail39.json: -------------------------------------------------------------------------------- 1 | ["\udd61"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail4.json: -------------------------------------------------------------------------------- 1 | ["extra comma",] -------------------------------------------------------------------------------- /src/univalue/test/fail40.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/src/univalue/test/fail40.json -------------------------------------------------------------------------------- /src/univalue/test/fail41.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SuperNETorg/komodo/045287f5a2a7edaa7f588a7c6290ed6cfa9f14bd/src/univalue/test/fail41.json -------------------------------------------------------------------------------- /src/univalue/test/fail42.json: -------------------------------------------------------------------------------- 1 | ["before nul byte"]"after nul byte" 2 | -------------------------------------------------------------------------------- /src/univalue/test/fail5.json: -------------------------------------------------------------------------------- 1 | ["double extra comma",,] -------------------------------------------------------------------------------- /src/univalue/test/fail6.json: -------------------------------------------------------------------------------- 1 | [ , "<-- missing value"] -------------------------------------------------------------------------------- /src/univalue/test/fail7.json: -------------------------------------------------------------------------------- 1 | ["Comma after the close"], -------------------------------------------------------------------------------- /src/univalue/test/fail8.json: -------------------------------------------------------------------------------- 1 | ["Extra close"]] -------------------------------------------------------------------------------- /src/univalue/test/fail9.json: -------------------------------------------------------------------------------- 1 | {"Extra comma": true,} -------------------------------------------------------------------------------- /src/univalue/test/no_nul.cpp: -------------------------------------------------------------------------------- 1 | #include "univalue.h" 2 | 3 | int main (int argc, char *argv[]) 4 | { 5 | char buf[] = "___[1,2,3]___"; 6 | UniValue val; 7 | return val.read(buf + 3, 7) ? 0 : 1; 8 | } 9 | -------------------------------------------------------------------------------- /src/univalue/test/pass2.json: -------------------------------------------------------------------------------- 1 | [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] -------------------------------------------------------------------------------- /src/univalue/test/pass3.json: -------------------------------------------------------------------------------- 1 | { 2 | "JSON Test Pattern pass3": { 3 | "The outermost value": "must be an object or array.", 4 | "In this test": "It is an object." 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/univalue/test/round1.json: -------------------------------------------------------------------------------- 1 | ["\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u007f"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/round2.json: -------------------------------------------------------------------------------- 1 | ["a§■𐎒𝅘𝅥𝅯"] 2 | -------------------------------------------------------------------------------- /src/univalue/test/round3.json: -------------------------------------------------------------------------------- 1 | "abcdefghijklmnopqrstuvwxyz" 2 | -------------------------------------------------------------------------------- /src/univalue/test/round4.json: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /src/univalue/test/round5.json: -------------------------------------------------------------------------------- 1 | true 2 | -------------------------------------------------------------------------------- /src/univalue/test/round6.json: -------------------------------------------------------------------------------- 1 | false 2 | -------------------------------------------------------------------------------- /src/univalue/test/round7.json: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /src/univalue/test/test_json.cpp: -------------------------------------------------------------------------------- 1 | // Test program that can be called by the JSON test suite at 2 | // https://github.com/nst/JSONTestSuite. 3 | // 4 | // It reads JSON input from stdin and exits with code 0 if it can be parsed 5 | // successfully. It also pretty prints the parsed JSON value to stdout. 6 | 7 | #include 8 | #include 9 | #include "univalue.h" 10 | 11 | using namespace std; 12 | 13 | int main (int argc, char *argv[]) 14 | { 15 | UniValue val; 16 | if (val.read(string(istreambuf_iterator(cin), 17 | istreambuf_iterator()))) { 18 | cout << val.write(1 /* prettyIndent */, 4 /* indentLevel */) << endl; 19 | return 0; 20 | } else { 21 | cerr << "JSON Parse Error." << endl; 22 | return 1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/utilmoneystr.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | /** 7 | * Money parsing/formatting utilities. 8 | */ 9 | #ifndef BITCOIN_UTILMONEYSTR_H 10 | #define BITCOIN_UTILMONEYSTR_H 11 | 12 | #include 13 | #include 14 | 15 | #include "amount.h" 16 | 17 | std::string FormatMoney(const CAmount& n); 18 | bool ParseMoney(const std::string& str, CAmount& nRet); 19 | bool ParseMoney(const char* pszIn, CAmount& nRet); 20 | 21 | #endif // BITCOIN_UTILMONEYSTR_H 22 | -------------------------------------------------------------------------------- /src/utiltest.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2016 The Zcash developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "wallet/wallet.h" 6 | #include "zcash/JoinSplit.hpp" 7 | #include "zcash/Note.hpp" 8 | #include "zcash/NoteEncryption.hpp" 9 | 10 | CWalletTx GetValidReceive(ZCJoinSplit& params, 11 | const libzcash::SpendingKey& sk, CAmount value, 12 | bool randomInputs); 13 | libzcash::Note GetNote(ZCJoinSplit& params, 14 | const libzcash::SpendingKey& sk, 15 | const CTransaction& tx, size_t js, size_t n); 16 | CWalletTx GetValidSpend(ZCJoinSplit& params, 17 | const libzcash::SpendingKey& sk, 18 | const libzcash::Note& note, CAmount value); 19 | -------------------------------------------------------------------------------- /src/utiltime.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_UTILTIME_H 7 | #define BITCOIN_UTILTIME_H 8 | 9 | #include 10 | #include 11 | 12 | int64_t GetTime(); 13 | int64_t GetTimeMillis(); 14 | int64_t GetTimeMicros(); 15 | void SetMockTime(int64_t nMockTimeIn); 16 | void MilliSleep(int64_t n); 17 | 18 | std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime); 19 | 20 | #endif // BITCOIN_UTILTIME_H 21 | -------------------------------------------------------------------------------- /src/wallet/wallet_ismine.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2014 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_WALLET_WALLET_ISMINE_H 7 | #define BITCOIN_WALLET_WALLET_ISMINE_H 8 | 9 | #include "key.h" 10 | #include "script/standard.h" 11 | 12 | class CKeyStore; 13 | class CScript; 14 | 15 | /** IsMine() return codes */ 16 | enum isminetype 17 | { 18 | ISMINE_NO = 0, 19 | ISMINE_WATCH_ONLY = 1, 20 | ISMINE_SPENDABLE = 2, 21 | ISMINE_ALL = ISMINE_WATCH_ONLY | ISMINE_SPENDABLE 22 | }; 23 | /** used for bitflags of isminetype */ 24 | typedef uint8_t isminefilter; 25 | 26 | isminetype IsMine(const CKeyStore& keystore, const CScript& scriptPubKey); 27 | isminetype IsMine(const CKeyStore& keystore, const CTxDestination& dest); 28 | 29 | #endif // BITCOIN_WALLET_WALLET_ISMINE_H 30 | -------------------------------------------------------------------------------- /src/zcash/Address.cpp: -------------------------------------------------------------------------------- 1 | #include "Address.hpp" 2 | #include "NoteEncryption.hpp" 3 | #include "hash.h" 4 | #include "prf.h" 5 | #include "streams.h" 6 | 7 | namespace libzcash { 8 | 9 | uint256 PaymentAddress::GetHash() const { 10 | CDataStream ss(SER_NETWORK, PROTOCOL_VERSION); 11 | ss << *this; 12 | return Hash(ss.begin(), ss.end()); 13 | } 14 | 15 | uint256 ViewingKey::pk_enc() { 16 | return ZCNoteEncryption::generate_pubkey(*this); 17 | } 18 | 19 | ViewingKey SpendingKey::viewing_key() const { 20 | return ViewingKey(ZCNoteEncryption::generate_privkey(*this)); 21 | } 22 | 23 | SpendingKey SpendingKey::random() { 24 | return SpendingKey(random_uint252()); 25 | } 26 | 27 | PaymentAddress SpendingKey::address() const { 28 | return PaymentAddress(PRF_addr_a_pk(*this), viewing_key().pk_enc()); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/zcash/GenerateParams.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/JoinSplit.hpp" 2 | 3 | #include 4 | #include "crypto/common.h" 5 | 6 | int64_t MAX_MONEY = 200000000 * 100000000LL; 7 | 8 | int main(int argc, char **argv) 9 | { 10 | if (init_and_check_sodium() == -1) { 11 | return 1; 12 | } 13 | 14 | if(argc != 4) { 15 | std::cerr << "Usage: " << argv[0] << " provingKeyFileName verificationKeyFileName r1csFileName" << std::endl; 16 | return 1; 17 | } 18 | 19 | std::string pkFile = argv[1]; 20 | std::string vkFile = argv[2]; 21 | std::string r1csFile = argv[3]; 22 | 23 | auto p = ZCJoinSplit::Generate(); 24 | 25 | p->saveProvingKey(pkFile); 26 | p->saveVerifyingKey(vkFile); 27 | p->saveR1CS(r1csFile); 28 | 29 | delete p; 30 | 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /src/zcash/Zcash.h: -------------------------------------------------------------------------------- 1 | #ifndef _ZCCONSTANTS_H_ 2 | #define _ZCCONSTANTS_H_ 3 | 4 | #define ZC_NUM_JS_INPUTS 2 5 | #define ZC_NUM_JS_OUTPUTS 2 6 | #define INCREMENTAL_MERKLE_TREE_DEPTH 29 7 | #define INCREMENTAL_MERKLE_TREE_DEPTH_TESTING 4 8 | 9 | #define ZC_NOTEPLAINTEXT_LEADING 1 10 | #define ZC_V_SIZE 8 11 | #define ZC_RHO_SIZE 32 12 | #define ZC_R_SIZE 32 13 | #define ZC_MEMO_SIZE 512 14 | 15 | #define ZC_NOTEPLAINTEXT_SIZE (ZC_NOTEPLAINTEXT_LEADING + ZC_V_SIZE + ZC_RHO_SIZE + ZC_R_SIZE + ZC_MEMO_SIZE) 16 | 17 | #endif // _ZCCONSTANTS_H_ 18 | -------------------------------------------------------------------------------- /src/zcash/prf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Zcash uses SHA256Compress as a PRF for various components 3 | within the zkSNARK circuit. 4 | */ 5 | 6 | #ifndef _PRF_H_ 7 | #define _PRF_H_ 8 | 9 | #include "uint256.h" 10 | #include "uint252.h" 11 | 12 | uint256 PRF_addr_a_pk(const uint252& a_sk); 13 | uint256 PRF_addr_sk_enc(const uint252& a_sk); 14 | uint256 PRF_nf(const uint252& a_sk, const uint256& rho); 15 | uint256 PRF_pk(const uint252& a_sk, size_t i0, const uint256& h_sig); 16 | uint256 PRF_rho(const uint252& phi, size_t i0, const uint256& h_sig); 17 | 18 | #endif // _PRF_H_ 19 | -------------------------------------------------------------------------------- /src/zcash/util.cpp: -------------------------------------------------------------------------------- 1 | #include "zcash/util.h" 2 | #include 3 | #include 4 | 5 | std::vector convertIntToVectorLE(const uint64_t val_int) { 6 | std::vector bytes; 7 | 8 | for(size_t i = 0; i < 8; i++) { 9 | bytes.push_back(val_int >> (i * 8)); 10 | } 11 | 12 | return bytes; 13 | } 14 | 15 | // Convert bytes into boolean vector. (MSB to LSB) 16 | std::vector convertBytesVectorToVector(const std::vector& bytes) { 17 | std::vector ret; 18 | ret.resize(bytes.size() * 8); 19 | 20 | unsigned char c; 21 | for (size_t i = 0; i < bytes.size(); i++) { 22 | c = bytes.at(i); 23 | for (size_t j = 0; j < 8; j++) { 24 | ret.at((i*8)+j) = (c >> (7-j)) & 1; 25 | } 26 | } 27 | 28 | return ret; 29 | } 30 | 31 | // Convert boolean vector (big endian) to integer 32 | uint64_t convertVectorToInt(const std::vector& v) { 33 | if (v.size() > 64) { 34 | throw std::length_error ("boolean vector can't be larger than 64 bits"); 35 | } 36 | 37 | uint64_t result = 0; 38 | for (size_t i=0; i 5 | #include 6 | 7 | std::vector convertIntToVectorLE(const uint64_t val_int); 8 | std::vector convertBytesVectorToVector(const std::vector& bytes); 9 | uint64_t convertVectorToInt(const std::vector& v); 10 | 11 | #endif // __ZCASH_UTIL_H 12 | -------------------------------------------------------------------------------- /src/zcbenchmarks.h: -------------------------------------------------------------------------------- 1 | #ifndef BENCHMARKS_H 2 | #define BENCHMARKS_H 3 | 4 | #include 5 | #include 6 | 7 | extern double benchmark_sleep(); 8 | extern double benchmark_parameter_loading(); 9 | extern double benchmark_create_joinsplit(); 10 | extern std::vector benchmark_create_joinsplit_threaded(int nThreads); 11 | extern double benchmark_solve_equihash(); 12 | extern std::vector benchmark_solve_equihash_threaded(int nThreads); 13 | extern double benchmark_verify_joinsplit(const JSDescription &joinsplit); 14 | extern double benchmark_verify_equihash(); 15 | extern double benchmark_large_tx(); 16 | extern double benchmark_try_decrypt_notes(size_t nAddrs); 17 | extern double benchmark_increment_note_witnesses(size_t nTxs); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /src/zmq/zmqabstractnotifier.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #include "zmqabstractnotifier.h" 6 | #include "util.h" 7 | 8 | 9 | CZMQAbstractNotifier::~CZMQAbstractNotifier() 10 | { 11 | assert(!psocket); 12 | } 13 | 14 | bool CZMQAbstractNotifier::NotifyBlock(const CBlockIndex * /*CBlockIndex*/) 15 | { 16 | return true; 17 | } 18 | 19 | bool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/) 20 | { 21 | return true; 22 | } 23 | -------------------------------------------------------------------------------- /src/zmq/zmqabstractnotifier.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 6 | #define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 7 | 8 | #include "zmqconfig.h" 9 | 10 | class CBlockIndex; 11 | class CZMQAbstractNotifier; 12 | 13 | typedef CZMQAbstractNotifier* (*CZMQNotifierFactory)(); 14 | 15 | class CZMQAbstractNotifier 16 | { 17 | public: 18 | CZMQAbstractNotifier() : psocket(0) { } 19 | virtual ~CZMQAbstractNotifier(); 20 | 21 | template 22 | static CZMQAbstractNotifier* Create() 23 | { 24 | return new T(); 25 | } 26 | 27 | std::string GetType() const { return type; } 28 | void SetType(const std::string &t) { type = t; } 29 | std::string GetAddress() const { return address; } 30 | void SetAddress(const std::string &a) { address = a; } 31 | 32 | virtual bool Initialize(void *pcontext) = 0; 33 | virtual void Shutdown() = 0; 34 | 35 | virtual bool NotifyBlock(const CBlockIndex *pindex); 36 | virtual bool NotifyTransaction(const CTransaction &transaction); 37 | 38 | protected: 39 | void *psocket; 40 | std::string type; 41 | std::string address; 42 | }; 43 | 44 | #endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H 45 | -------------------------------------------------------------------------------- /src/zmq/zmqconfig.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQCONFIG_H 6 | #define BITCOIN_ZMQ_ZMQCONFIG_H 7 | 8 | #if defined(HAVE_CONFIG_H) 9 | #include "config/bitcoin-config.h" 10 | #endif 11 | 12 | #include 13 | #include 14 | 15 | #if ENABLE_ZMQ 16 | #include 17 | #endif 18 | 19 | #include "primitives/block.h" 20 | #include "primitives/transaction.h" 21 | 22 | void zmqError(const char *str); 23 | 24 | #endif // BITCOIN_ZMQ_ZMQCONFIG_H 25 | -------------------------------------------------------------------------------- /src/zmq/zmqnotificationinterface.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015 The Bitcoin Core developers 2 | // Distributed under the MIT software license, see the accompanying 3 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 4 | 5 | #ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 6 | #define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 7 | 8 | #include "validationinterface.h" 9 | #include 10 | #include 11 | 12 | class CBlockIndex; 13 | class CZMQAbstractNotifier; 14 | 15 | class CZMQNotificationInterface : public CValidationInterface 16 | { 17 | public: 18 | virtual ~CZMQNotificationInterface(); 19 | 20 | static CZMQNotificationInterface* CreateWithArguments(const std::map &args); 21 | 22 | protected: 23 | bool Initialize(); 24 | void Shutdown(); 25 | 26 | // CValidationInterface 27 | void SyncTransaction(const CTransaction &tx, const CBlock *pblock); 28 | void UpdatedBlockTip(const CBlockIndex *pindex); 29 | 30 | private: 31 | CZMQNotificationInterface(); 32 | 33 | void *pcontext; 34 | std::list notifiers; 35 | }; 36 | 37 | #endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H 38 | -------------------------------------------------------------------------------- /toolchain-info.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | tools=("gcc-5" "g++-5" "otool" "nm") 4 | 5 | echo "Platform: `uname -a`" 6 | echo "-------------------------------------" 7 | echo "Tool info:" 8 | echo 9 | for tool in "${tools[@]}" 10 | do 11 | echo "$tool location: `which $tool`" 12 | echo "$tool version: `$tool --version`" 13 | echo 14 | echo "-------" 15 | echo 16 | done 17 | -------------------------------------------------------------------------------- /user-config.jam: -------------------------------------------------------------------------------- 1 | using : : : " " "" "" "" "" "" : ; 2 | -------------------------------------------------------------------------------- /zcutil/build-win.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | HOST=x86_64-w64-mingw32 3 | CXX=x86_64-w64-mingw32-g++-posix 4 | CC=x86_64-w64-mingw32-gcc-posix 5 | PREFIX="$(pwd)/depends/$HOST" 6 | 7 | set -eu -o pipefail 8 | 9 | set -x 10 | cd "$(dirname "$(readlink -f "$0")")/.." 11 | 12 | cd depends/ && make HOST=$HOST V=1 NO_QT=1 && cd ../ 13 | ./autogen.sh 14 | CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site CXXFLAGS="-DPTW32_STATIC_LIB -DCURL_STATICLIB -DCURVE_ALT_BN128 -fopenmp -pthread" ./configure --prefix="${PREFIX}" --host=x86_64-w64-mingw32 --enable-static --disable-shared 15 | sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure 16 | cd src/ 17 | CC="${CC}" CXX="${CXX}" make V=1 komodod.exe komodo-cli.exe komodo-tx.exe 18 | -------------------------------------------------------------------------------- /zcutil/cleanup-tags.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Warning: This deletes tags on "origin", so point that at the right target! 4 | # 5 | # Note: It doesn't delete any local tags. 6 | 7 | set -exu -o pipefail 8 | 9 | ZCASH_TAG_RGX='^v[0-9]+.[0-9]+.[0-9]+.z[0-9]+' 10 | MAXJOBS=7 11 | 12 | i=0 13 | 14 | for nonzctag in $(git ls-remote origin \ 15 | | grep refs/tags/ \ 16 | | grep -v '\^{}$' \ 17 | | sed 's,^.*refs/tags/,,'\ 18 | | grep -Ev "$ZCASH_TAG_RGX" 19 | ) 20 | do 21 | git push origin ":refs/tags/${nonzctag}" & 22 | i="$(expr "$i" + 1)" 23 | [ "$i" -ge "$MAXJOBS" ] && wait -n 24 | done 25 | 26 | wait 27 | -------------------------------------------------------------------------------- /zcutil/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set -ex 4 | 5 | echo "...Checking komodo.conf" 6 | 7 | if [ ! -e "$HOME/.komodo/komodo.conf" ]; then 8 | mkdir -p $HOME/.komodo 9 | 10 | echo "...Creating komodo.conf" 11 | cat < $HOME/.komodo/komodo.conf 12 | rpcuser=${rpcuser:-komodorpc} 13 | rpcpassword=${rpcpassword:-`dd if=/dev/urandom bs=33 count=1 2>/dev/null | base64`} 14 | txindex=1 15 | bind=${listenip:-127.0.0.1} 16 | rpcbind=${listenip:-127.0.0.1} 17 | EOF 18 | 19 | cat $HOME/.komodo/komodo.conf 20 | fi 21 | 22 | echo "...Checking fetch-params" 23 | $HOME/zcutil/fetch-params.sh 24 | echo "Initialization completed successfully" 25 | echo 26 | 27 | # ToDo: Needs some rework. I was sick 28 | if [ $# -gt 0 ]; then 29 | 30 | args=("$@") 31 | 32 | elif [ -z ${assetchain+x} ]; then 33 | 34 | args=("-gen -genproclimit=${genproclimit:-2} -pubkey=${pubkey}") 35 | 36 | else 37 | 38 | args=("-pubkey=${pubkey} -ac_name=${assetchain} -addnode=${seednode}") 39 | 40 | fi 41 | 42 | echo 43 | echo "****************************************************" 44 | echo "Running: komodod ${args[@]}" 45 | echo "****************************************************" 46 | 47 | exec komodod ${args[@]} 48 | -------------------------------------------------------------------------------- /zcutil/docker-komodo-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ToDo: check for docker arg ac_name 4 | 5 | /komodo/src/komodo-cli $1 $2 $3 $4 6 | 7 | --------------------------------------------------------------------------------